[llvm-commits] [llvm] r106946 - /llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp

Gabor Greif ggreif at gmail.com
Sat Jun 26 05:17:21 PDT 2010


Author: ggreif
Date: Sat Jun 26 07:17:21 2010
New Revision: 106946

URL: http://llvm.org/viewvc/llvm-project?rev=106946&view=rev
Log:
use ArgOperand API

Modified:
    llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp

Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp?rev=106946&r1=106945&r2=106946&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp (original)
+++ llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Sat Jun 26 07:17:21 2010
@@ -1289,7 +1289,7 @@
           << allocaI->getAlignment() << ");";
     break;
   }
-  case Instruction::Load:{
+  case Instruction::Load: {
     const LoadInst* load = cast<LoadInst>(I);
     Out << "LoadInst* " << iName << " = new LoadInst("
         << opNames[0] << ", \"";
@@ -1384,7 +1384,7 @@
     Out << "\", " << bbname << ");";
     break;
   }
-  case Instruction::Call:{
+  case Instruction::Call: {
     const CallInst* call = cast<CallInst>(I);
     if (const InlineAsm* ila = dyn_cast<InlineAsm>(call->getCalledValue())) {
       Out << "InlineAsm* " << getCppName(ila) << " = InlineAsm::get("
@@ -1394,7 +1394,7 @@
           << (ila->hasSideEffects() ? "true" : "false") << ");";
       nl(Out);
     }
-    if (call->getNumOperands() > 2) {
+    if (call->getNumArgOperands() > 1) {
       Out << "std::vector<Value*> " << iName << "_params;";
       nl(Out);
       for (unsigned i = 1; i < call->getNumOperands(); ++i) {
@@ -1404,7 +1404,7 @@
       Out << "CallInst* " << iName << " = CallInst::Create("
           << opNames[0] << ", " << iName << "_params.begin(), "
           << iName << "_params.end(), \"";
-    } else if (call->getNumOperands() == 2) {
+    } else if (call->getNumArgOperands() == 1) {
       Out << "CallInst* " << iName << " = CallInst::Create("
           << opNames[0] << ", " << opNames[1] << ", \"";
     } else {
@@ -1417,7 +1417,7 @@
     printCallingConv(call->getCallingConv());
     Out << ");";
     nl(Out) << iName << "->setTailCall("
-        << (call->isTailCall() ? "true":"false");
+        << (call->isTailCall() ? "true" : "false");
     Out << ");";
     printAttributes(call->getAttributes(), iName);
     Out << iName << "->setAttributes(" << iName << "_PAL);";





More information about the llvm-commits mailing list