diff options
author | Chris Lattner <sabre@nondot.org> | 2009-09-16 06:25:03 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-09-16 06:25:03 +0000 |
commit | dc62ea0f1c6eb0673f39c543f1936ce125efdb30 (patch) | |
tree | 10aa59bbe54df14c669b87fc44ce589e08932a48 /include/llvm/CodeGen | |
parent | 29cf5557b28f9c2bd7badf4dc37b2465d49d546d (diff) |
move FnStubs/GVSTubs/HiddenGVStub handling out of the X86 asmprinter
and use MachineModuleInfoMachO instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82022 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r-- | include/llvm/CodeGen/AsmPrinter.h | 3 | ||||
-rw-r--r-- | include/llvm/CodeGen/MachineModuleInfo.h | 6 | ||||
-rw-r--r-- | include/llvm/CodeGen/MachineModuleInfoImpls.h | 5 |
3 files changed, 8 insertions, 6 deletions
diff --git a/include/llvm/CodeGen/AsmPrinter.h b/include/llvm/CodeGen/AsmPrinter.h index fe6249b88d..a1765c4c25 100644 --- a/include/llvm/CodeGen/AsmPrinter.h +++ b/include/llvm/CodeGen/AsmPrinter.h @@ -76,10 +76,11 @@ namespace llvm { /// MachineLoopInfo *LI; - protected: + public: /// MMI - If available, this is a pointer to the current MachineModuleInfo. MachineModuleInfo *MMI; + protected: /// DW - If available, this is a pointer to the current dwarf writer. DwarfWriter *DW; diff --git a/include/llvm/CodeGen/MachineModuleInfo.h b/include/llvm/CodeGen/MachineModuleInfo.h index 2d23495b48..e5a962d26b 100644 --- a/include/llvm/CodeGen/MachineModuleInfo.h +++ b/include/llvm/CodeGen/MachineModuleInfo.h @@ -163,17 +163,17 @@ public: /// backends that would like to do so. /// template<typename Ty> - Ty *getObjFileInfo() { + Ty &getObjFileInfo() { if (ObjFileMMI == 0) ObjFileMMI = new Ty(*this); assert((void*)dynamic_cast<Ty*>(ObjFileMMI) == (void*)ObjFileMMI && "Invalid concrete type or multiple inheritence for getInfo"); - return static_cast<Ty*>(ObjFileMMI); + return *static_cast<Ty*>(ObjFileMMI); } template<typename Ty> - const Ty *getObjFileInfo() const { + const Ty &getObjFileInfo() const { return const_cast<MachineModuleInfo*>(this)->getObjFileInfo<Ty>(); } diff --git a/include/llvm/CodeGen/MachineModuleInfoImpls.h b/include/llvm/CodeGen/MachineModuleInfoImpls.h index 492c016fd6..44813cbdcd 100644 --- a/include/llvm/CodeGen/MachineModuleInfoImpls.h +++ b/include/llvm/CodeGen/MachineModuleInfoImpls.h @@ -38,18 +38,19 @@ namespace llvm { virtual void Anchor(); // Out of line virtual method. public: + MachineModuleInfoMachO(const MachineModuleInfo &) {} const MCSymbol *&getFnStubEntry(const MCSymbol *Sym) { assert(Sym && "Key cannot be null"); return FnStubs[Sym]; } - const MCSymbol *&getGVStubsEntry(const MCSymbol *Sym) { + const MCSymbol *&getGVStubEntry(const MCSymbol *Sym) { assert(Sym && "Key cannot be null"); return GVStubs[Sym]; } - const MCSymbol *&getHiddenGVStubsEntry(const MCSymbol *Sym) { + const MCSymbol *&getHiddenGVStubEntry(const MCSymbol *Sym) { assert(Sym && "Key cannot be null"); return HiddenGVStubs[Sym]; } |