[llvm-commits] [llvm] r149090 - in /llvm/trunk: include/llvm/MC/MCContext.h lib/MC/MCContext.cpp

Jim Grosbach grosbach at apple.com
Thu Jan 26 15:20:05 PST 2012


Author: grosbach
Date: Thu Jan 26 17:20:05 2012
New Revision: 149090

URL: http://llvm.org/viewvc/llvm-project?rev=149090&view=rev
Log:
Add SourceMgr to MCContext for backend diagnostics.

Modified:
    llvm/trunk/include/llvm/MC/MCContext.h
    llvm/trunk/lib/MC/MCContext.cpp

Modified: llvm/trunk/include/llvm/MC/MCContext.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCContext.h?rev=149090&r1=149089&r2=149090&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCContext.h (original)
+++ llvm/trunk/include/llvm/MC/MCContext.h Thu Jan 26 17:20:05 2012
@@ -43,6 +43,8 @@
   public:
     typedef StringMap<MCSymbol*, BumpPtrAllocator&> SymbolTable;
   private:
+    /// The SourceMgr for this object, if any.
+    const SourceMgr *SrcMgr;
 
     /// The MCAsmInfo for this target.
     const MCAsmInfo &MAI;
@@ -137,9 +139,11 @@
 
   public:
     explicit MCContext(const MCAsmInfo &MAI, const MCRegisterInfo &MRI,
-                       const MCObjectFileInfo *MOFI);
+                       const MCObjectFileInfo *MOFI, const SourceMgr *Mgr = 0);
     ~MCContext();
 
+    const SourceMgr *getSourceManager() const { return SrcMgr; }
+
     const MCAsmInfo &getAsmInfo() const { return MAI; }
 
     const MCRegisterInfo &getRegisterInfo() const { return MRI; }

Modified: llvm/trunk/lib/MC/MCContext.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCContext.cpp?rev=149090&r1=149089&r2=149090&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCContext.cpp (original)
+++ llvm/trunk/lib/MC/MCContext.cpp Thu Jan 26 17:20:05 2012
@@ -28,8 +28,8 @@
 
 
 MCContext::MCContext(const MCAsmInfo &mai, const MCRegisterInfo &mri,
-                     const MCObjectFileInfo *mofi) :
-  MAI(mai), MRI(mri), MOFI(mofi),
+                     const MCObjectFileInfo *mofi, const SourceMgr *mgr) :
+  SrcMgr(mgr), MAI(mai), MRI(mri), MOFI(mofi),
   Allocator(), Symbols(Allocator), UsedNames(Allocator),
   NextUniqueID(0),
   CurrentDwarfLoc(0,0,0,DWARF2_FLAG_IS_STMT,0,0),





More information about the llvm-commits mailing list