OSDN Git Service

CBE support for indbr.
authorChris Lattner <sabre@nondot.org>
Tue, 27 Oct 2009 21:21:06 +0000 (21:21 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 27 Oct 2009 21:21:06 +0000 (21:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85311 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/CBackend/CBackend.cpp

index fb61651..dae830d 100644 (file)
@@ -282,6 +282,7 @@ namespace {
     void visitReturnInst(ReturnInst &I);
     void visitBranchInst(BranchInst &I);
     void visitSwitchInst(SwitchInst &I);
+    void visitIndBrInst(IndBrInst &I);
     void visitInvokeInst(InvokeInst &I) {
       llvm_unreachable("Lowerinvoke pass didn't work!");
     }
@@ -2578,6 +2579,12 @@ void CWriter::visitSwitchInst(SwitchInst &SI) {
   Out << "  }\n";
 }
 
+void CWriter::visitIndBrInst(IndBrInst &IBI) {
+  Out << "  goto *(void*)(";
+  writeOperand(IBI.getOperand(0));
+  Out << ");\n";
+}
+
 void CWriter::visitUnreachableInst(UnreachableInst &I) {
   Out << "  /*UNREACHABLE*/;\n";
 }