Avoid adding some decls to DeferredDeclsToEmit.

Before this patch GetOrCreateLLVMFunction would add a decl to
DeferredDeclsToEmit even when it was being called by the function trying to
emit that decl.

llvm-svn: 196753
This commit is contained in:
Rafael Espindola
2013-12-09 04:29:47 +00:00
parent 048f90cc04
commit 94abb8ffed
4 changed files with 90 additions and 75 deletions

View File

@@ -54,7 +54,8 @@ llvm::Constant *CodeGenModule::GetAddrOfThunk(GlobalDecl GD,
Out.flush();
llvm::Type *Ty = getTypes().GetFunctionTypeForVTable(GD);
return GetOrCreateLLVMFunction(Name, Ty, GD, /*ForVTable=*/true);
return GetOrCreateLLVMFunction(Name, Ty, GD, /*ForVTable=*/true,
/*DontDefer*/ true);
}
static void setThunkVisibility(CodeGenModule &CGM, const CXXMethodDecl *MD,