diff options
Diffstat (limited to 'include/llvm/CodeGen/MachineModuleInfo.h')
-rw-r--r-- | include/llvm/CodeGen/MachineModuleInfo.h | 6 |
1 files changed, 3 insertions, 3 deletions
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>(); } |