From 01de7a44cea9f77cbcda65faad8edc8b48a3b617 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 3 Feb 2011 06:30:58 +0000 Subject: Revert 124768. This reopens PR99114, but that one at least can be avoided with an #include. PR9130 cannot. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124780 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.cpp | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'lib/CodeGen/CodeGenModule.cpp') diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 0c541b9670..b8f91b464d 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -650,8 +650,7 @@ llvm::Constant *CodeGenModule::GetWeakRefReference(const ValueDecl *VD) { llvm::Constant *Aliasee; if (isa(DeclTy)) - Aliasee = GetOrCreateLLVMFunction(AA->getAliasee(), DeclTy, GlobalDecl(), - /*ForVTable=*/false); + Aliasee = GetOrCreateLLVMFunction(AA->getAliasee(), DeclTy, GlobalDecl()); else Aliasee = GetOrCreateLLVMGlobal(AA->getAliasee(), llvm::PointerType::getUnqual(DeclTy), 0); @@ -783,7 +782,7 @@ void CodeGenModule::EmitGlobalDefinition(GlobalDecl GD) { llvm::Constant * CodeGenModule::GetOrCreateLLVMFunction(llvm::StringRef MangledName, const llvm::Type *Ty, - GlobalDecl D, bool ForVTable) { + GlobalDecl D) { // Lookup the entry, lazily creating it if necessary. llvm::GlobalValue *Entry = GetGlobalValue(MangledName); if (Entry) { @@ -841,11 +840,7 @@ CodeGenModule::GetOrCreateLLVMFunction(llvm::StringRef MangledName, // - special member functions with implicit definitions // If we ever change our AST traversal to walk into class methods, // this will be unnecessary. - // - // We also don't emit a definition for a function if it's going to be an entry - // in a vtable, unless it's already marked as used. - } else if (getLangOptions().CPlusPlus && D.getDecl() && - !(ForVTable && !D.getDecl()->isUsed())) { + } else if (getLangOptions().CPlusPlus && D.getDecl()) { // Look for a declaration that's lexically in a record. const FunctionDecl *FD = cast(D.getDecl()); do { @@ -877,14 +872,13 @@ CodeGenModule::GetOrCreateLLVMFunction(llvm::StringRef MangledName, /// non-null, then this function will use the specified type if it has to /// create it (this occurs when we see a definition of the function). llvm::Constant *CodeGenModule::GetAddrOfFunction(GlobalDecl GD, - const llvm::Type *Ty, - bool ForVTable) { + const llvm::Type *Ty) { // If there was no specific requested type, just convert it now. if (!Ty) Ty = getTypes().ConvertType(cast(GD.getDecl())->getType()); llvm::StringRef MangledName = getMangledName(GD); - return GetOrCreateLLVMFunction(MangledName, Ty, GD, ForVTable); + return GetOrCreateLLVMFunction(MangledName, Ty, GD); } /// CreateRuntimeFunction - Create a new runtime function with the specified @@ -892,7 +886,7 @@ llvm::Constant *CodeGenModule::GetAddrOfFunction(GlobalDecl GD, llvm::Constant * CodeGenModule::CreateRuntimeFunction(const llvm::FunctionType *FTy, llvm::StringRef Name) { - return GetOrCreateLLVMFunction(Name, FTy, GlobalDecl(), /*ForVTable=*/false); + return GetOrCreateLLVMFunction(Name, FTy, GlobalDecl()); } static bool DeclIsConstantGlobal(ASTContext &Context, const VarDecl *D) { @@ -1451,8 +1445,7 @@ void CodeGenModule::EmitAliasDefinition(GlobalDecl GD) { // if a deferred decl. llvm::Constant *Aliasee; if (isa(DeclTy)) - Aliasee = GetOrCreateLLVMFunction(AA->getAliasee(), DeclTy, GlobalDecl(), - /*ForVTable=*/false); + Aliasee = GetOrCreateLLVMFunction(AA->getAliasee(), DeclTy, GlobalDecl()); else Aliasee = GetOrCreateLLVMGlobal(AA->getAliasee(), llvm::PointerType::getUnqual(DeclTy), 0); @@ -1518,7 +1511,7 @@ llvm::Value *CodeGenModule::getBuiltinLibFunction(const FunctionDecl *FD, const llvm::FunctionType *Ty = cast(getTypes().ConvertType(FD->getType())); - return GetOrCreateLLVMFunction(Name, Ty, GlobalDecl(FD), /*ForVTable=*/false); + return GetOrCreateLLVMFunction(Name, Ty, GlobalDecl(FD)); } llvm::Function *CodeGenModule::getIntrinsic(unsigned IID,const llvm::Type **Tys, -- cgit v1.2.3-70-g09d2