[llvm-commits] [llvm] r98378 - in /llvm/trunk: include/llvm/Target/Mangler.h lib/CodeGen/AsmPrinter/AsmPrinter.cpp lib/CodeGen/ELFWriter.cpp lib/Target/CBackend/CBackend.cpp tools/lto/LTOCodeGenerator.cpp tools/lto/LTOModule.cpp

Chris Lattner sabre at nondot.org
Fri Mar 12 12:47:28 PST 2010


Author: lattner
Date: Fri Mar 12 14:47:28 2010
New Revision: 98378

URL: http://llvm.org/viewvc/llvm-project?rev=98378&view=rev
Log:
give Mangler access to TargetData.

Modified:
    llvm/trunk/include/llvm/Target/Mangler.h
    llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
    llvm/trunk/lib/CodeGen/ELFWriter.cpp
    llvm/trunk/lib/Target/CBackend/CBackend.cpp
    llvm/trunk/tools/lto/LTOCodeGenerator.cpp
    llvm/trunk/tools/lto/LTOModule.cpp

Modified: llvm/trunk/include/llvm/Target/Mangler.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/Mangler.h?rev=98378&r1=98377&r2=98378&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/Mangler.h (original)
+++ llvm/trunk/include/llvm/Target/Mangler.h Fri Mar 12 14:47:28 2010
@@ -25,6 +25,7 @@
 template <typename T> class SmallVectorImpl; 
 class MCContext;
 class MCSymbol;
+class TargetData;
 
 class Mangler {
 public:
@@ -36,6 +37,7 @@
 
 private:
   MCContext &Context;
+  const TargetData &TD;
 
   /// AnonGlobalIDs - We need to give global values the same name every time
   /// they are mangled.  This keeps track of the number we give to anonymous
@@ -48,7 +50,8 @@
   unsigned NextAnonGlobalID;
 
 public:
-  Mangler(MCContext &context) : Context(context), NextAnonGlobalID(1) {}
+  Mangler(MCContext &context, const TargetData &td)
+    : Context(context), TD(td), NextAnonGlobalID(1) {}
 
   /// getSymbol - Return the MCSymbol for the specified global value.  This
   /// symbol is the main label that is the address of the global.

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=98378&r1=98377&r2=98378&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Fri Mar 12 14:47:28 2010
@@ -104,7 +104,7 @@
   const_cast<TargetLoweringObjectFile&>(getObjFileLowering())
     .Initialize(OutContext, TM);
   
-  Mang = new Mangler(OutContext);
+  Mang = new Mangler(OutContext, *TM.getTargetData());
   
   // Allow the target to emit any magic that it wants at the start of the file.
   EmitStartOfAsmFile(M);

Modified: llvm/trunk/lib/CodeGen/ELFWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ELFWriter.cpp?rev=98378&r1=98377&r2=98378&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ELFWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/ELFWriter.cpp Fri Mar 12 14:47:28 2010
@@ -109,7 +109,7 @@
   // Initialize TargetLoweringObjectFile.
   const_cast<TargetLoweringObjectFile&>(TLOF).Initialize(OutContext, TM);
   
-  Mang = new Mangler(OutContext);
+  Mang = new Mangler(OutContext, *TM.getTargetData());
 
   // ELF Header
   // ----------

Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CBackend.cpp?rev=98378&r1=98377&r2=98378&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CBackend/CBackend.cpp (original)
+++ llvm/trunk/lib/Target/CBackend/CBackend.cpp Fri Mar 12 14:47:28 2010
@@ -1734,7 +1734,7 @@
 #endif    
   TAsm = new CBEMCAsmInfo();
   TCtx = new MCContext(*TAsm);
-  Mang = new Mangler(*TCtx);
+  Mang = new Mangler(*TCtx, *TD);
 
   // Keep track of which functions are static ctors/dtors so they can have
   // an attribute added to their prototypes.

Modified: llvm/trunk/tools/lto/LTOCodeGenerator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/LTOCodeGenerator.cpp?rev=98378&r1=98377&r2=98378&view=diff
==============================================================================
--- llvm/trunk/tools/lto/LTOCodeGenerator.cpp (original)
+++ llvm/trunk/tools/lto/LTOCodeGenerator.cpp Fri Mar 12 14:47:28 2010
@@ -322,7 +322,7 @@
   // mark which symbols can not be internalized 
   if (!_mustPreserveSymbols.empty()) {
     MCContext Context(*_target->getMCAsmInfo());
-    Mangler mangler(Context);
+    Mangler mangler(Context, *_target->getTargetData());
     std::vector<const char*> mustPreserveList;
     for (Module::iterator f = mergedModule->begin(),
          e = mergedModule->end(); f != e; ++f) {

Modified: llvm/trunk/tools/lto/LTOModule.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/LTOModule.cpp?rev=98378&r1=98377&r2=98378&view=diff
==============================================================================
--- llvm/trunk/tools/lto/LTOModule.cpp (original)
+++ llvm/trunk/tools/lto/LTOModule.cpp Fri Mar 12 14:47:28 2010
@@ -439,7 +439,7 @@
         
         // Use mangler to add GlobalPrefix to names to match linker names.
         MCContext Context(*_target->getMCAsmInfo());
-        Mangler mangler(Context);
+        Mangler mangler(Context, *_target->getTargetData());
 
         // add functions
         for (Module::iterator f = _module->begin(); f != _module->end(); ++f) {





More information about the llvm-commits mailing list