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
This commit is contained in:
Chris Lattner
2009-09-16 06:25:03 +00:00
parent 29cf5557b2
commit dc62ea0f1c
7 changed files with 52 additions and 49 deletions

View File

@ -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>();
}