From 7073ef96824242669735a8681519e1a0cee14309 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Thu, 25 Oct 2007 07:18:01 -0400 Subject: Implement else ops. --- src/mesa/pipe/llvm/instructions.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/mesa/pipe/llvm/instructions.cpp') diff --git a/src/mesa/pipe/llvm/instructions.cpp b/src/mesa/pipe/llvm/instructions.cpp index 622d420f64..a0645c5804 100644 --- a/src/mesa/pipe/llvm/instructions.cpp +++ b/src/mesa/pipe/llvm/instructions.cpp @@ -956,7 +956,7 @@ Function* makeLitFunction(Module *mod) { void Instructions::ifop(llvm::Value *in) { BasicBlock *ifthen = new BasicBlock(name("ifthen"), m_func,0); - BasicBlock *ifend = new BasicBlock(name("ifend"), m_func,0); + BasicBlock *ifend = new BasicBlock(name("ifthenend"), m_func,0); //BasicBlock *yblock = new BasicBlock(name("yblock"), m_func,0); //BasicBlock *zblock = new BasicBlock(name("zblock"), m_func,0); @@ -981,6 +981,17 @@ llvm::BasicBlock * Instructions::currentBlock() const return m_block; } +void Instructions::elseop() +{ + assert(!m_ifStack.empty()); + BasicBlock *ifend = new BasicBlock(name("ifend"), m_func,0); + new BranchInst(ifend, m_block); + m_block = m_ifStack.top(); + m_block->setName(name("ifelse")); + m_ifStack.pop(); + m_ifStack.push(ifend); +} + void Instructions::endif() { assert(!m_ifStack.empty()); -- cgit v1.2.3