[llvm-commits] CVS: llvm/lib/Target/CBackend/CBackend.cpp

Reid Spencer reid at x10sys.com
Mon Jan 29 09:50:45 PST 2007



Changes in directory llvm/lib/Target/CBackend:

CBackend.cpp updated: 1.321 -> 1.322
---
Log message:

Implement use of new IntrinsicLowering interface.


---
Diffs of the changes:  (+9 -4)

 CBackend.cpp |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)


Index: llvm/lib/Target/CBackend/CBackend.cpp
diff -u llvm/lib/Target/CBackend/CBackend.cpp:1.321 llvm/lib/Target/CBackend/CBackend.cpp:1.322
--- llvm/lib/Target/CBackend/CBackend.cpp:1.321	Sun Jan 28 07:31:35 2007
+++ llvm/lib/Target/CBackend/CBackend.cpp	Mon Jan 29 11:50:30 2007
@@ -32,6 +32,7 @@
 #include "llvm/Transforms/Scalar.h"
 #include "llvm/Target/TargetMachineRegistry.h"
 #include "llvm/Target/TargetAsmInfo.h"
+#include "llvm/Target/TargetData.h"
 #include "llvm/Support/CallSite.h"
 #include "llvm/Support/CFG.h"
 #include "llvm/Support/GetElementPtrTypeIterator.h"
@@ -70,16 +71,18 @@
   /// module to a C translation unit.
   class CWriter : public FunctionPass, public InstVisitor<CWriter> {
     std::ostream &Out;
-    IntrinsicLowering IL;
+    IntrinsicLowering *IL;
     Mangler *Mang;
     LoopInfo *LI;
     const Module *TheModule;
     const TargetAsmInfo* TAsm;
+    const TargetData* TD;
     std::map<const Type *, std::string> TypeNames;
 
     std::map<const ConstantFP *, unsigned> FPConstantMap;
   public:
-    CWriter(std::ostream &o) : Out(o), TAsm(0) {}
+    CWriter(std::ostream &o) : Out(o), IL(0), Mang(0), LI(0), TheModule(0), 
+                               TAsm(0), TD(0) {}
 
     virtual const char *getPassName() const { return "C backend"; }
 
@@ -1416,7 +1419,9 @@
   // Initialize
   TheModule = &M;
 
-  IL.AddPrototypes(M);
+  TD = new TargetData(&M);
+  IL = new IntrinsicLowering(*TD);
+  IL->AddPrototypes(M);
 
   // Ensure that all structure types have names...
   Mang = new Mangler(M);
@@ -2348,7 +2353,7 @@
             if (CI != &BB->front())
               Before = prior(BasicBlock::iterator(CI));
 
-            IL.LowerIntrinsicCall(CI);
+            IL->LowerIntrinsicCall(CI);
             if (Before) {        // Move iterator to instruction after call
               I = Before; ++I;
             } else {






More information about the llvm-commits mailing list