From 237f95996c82f63582c13987ce5e64629f7539b0 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Sat, 29 Jan 2011 22:15:18 +0000 Subject: [PATCH] Remove dead code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124554 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGRTTI.cpp | 60 +++--------------------------------------- 1 file changed, 3 insertions(+), 57 deletions(-) diff --git a/lib/CodeGen/CGRTTI.cpp b/lib/CodeGen/CGRTTI.cpp index 957b21893c..100f73377d 100644 --- a/lib/CodeGen/CGRTTI.cpp +++ b/lib/CodeGen/CGRTTI.cpp @@ -63,64 +63,10 @@ class RTTIBuilder { void BuildPointerToMemberTypeInfo(const MemberPointerType *Ty); public: - RTTIBuilder(CodeGenModule &cgm) - : CGM(cgm), VMContext(cgm.getModule().getContext()), - Int8PtrTy(llvm::Type::getInt8PtrTy(VMContext)) { } - - llvm::Constant *BuildName(QualType Ty, bool Hidden, - llvm::GlobalVariable::LinkageTypes Linkage) { - llvm::SmallString<256> OutName; - CGM.getCXXABI().getMangleContext().mangleCXXRTTIName(Ty, OutName); - llvm::StringRef Name = OutName.str(); - - llvm::GlobalVariable *OGV = CGM.getModule().getNamedGlobal(Name); - if (OGV && !OGV->isDeclaration()) - return llvm::ConstantExpr::getBitCast(OGV, Int8PtrTy); - - llvm::Constant *C = llvm::ConstantArray::get(VMContext, Name.substr(4)); - - llvm::GlobalVariable *GV = - new llvm::GlobalVariable(CGM.getModule(), C->getType(), true, Linkage, - C, Name); - if (OGV) { - GV->takeName(OGV); - llvm::Constant *NewPtr = llvm::ConstantExpr::getBitCast(GV, - OGV->getType()); - OGV->replaceAllUsesWith(NewPtr); - OGV->eraseFromParent(); - } - if (Hidden && Linkage != llvm::GlobalValue::InternalLinkage) - GV->setVisibility(llvm::GlobalVariable::HiddenVisibility); - return llvm::ConstantExpr::getBitCast(GV, Int8PtrTy); - } + RTTIBuilder(CodeGenModule &CGM) : CGM(CGM), + VMContext(CGM.getModule().getContext()), + Int8PtrTy(llvm::Type::getInt8PtrTy(VMContext)) { } - // FIXME: unify with DecideExtern - bool DecideHidden(QualType Ty) { - // For this type, see if all components are never hidden. - if (const MemberPointerType *MPT = Ty->getAs()) - return (DecideHidden(MPT->getPointeeType()) - && DecideHidden(QualType(MPT->getClass(), 0))); - if (const PointerType *PT = Ty->getAs()) - return DecideHidden(PT->getPointeeType()); - if (const FunctionType *FT = Ty->getAs()) { - if (DecideHidden(FT->getResultType()) == false) - return false; - if (const FunctionProtoType *FPT = Ty->getAs()) { - for (unsigned i = 0; i getNumArgs(); ++i) - if (DecideHidden(FPT->getArgType(i)) == false) - return false; - for (unsigned i = 0; i getNumExceptions(); ++i) - if (DecideHidden(FPT->getExceptionType(i)) == false) - return false; - return true; - } - } - if (const RecordType *RT = Ty->getAs()) - if (const CXXRecordDecl *RD = dyn_cast(RT->getDecl())) - return RD->getVisibility() == HiddenVisibility; - return false; - } - // Pointer type info flags. enum { /// PTI_Const - Type has const qualifier. -- 2.40.0