diff options
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index addf8d09e41..92f49379f1b 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1177,12 +1177,14 @@ void CodeGenModule::EmitGlobal(GlobalDecl GD) { if (!FD->doesDeclarationForceExternallyVisibleDefinition()) return; - const FunctionDecl *InlineDefinition = 0; - FD->getBody(InlineDefinition); - StringRef MangledName = getMangledName(GD); - DeferredDecls.erase(MangledName); - EmitGlobalDefinition(InlineDefinition); + + // Compute the function info and LLVM type. + const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD); + llvm::Type *Ty = getTypes().GetFunctionType(FI); + + GetOrCreateLLVMFunction(MangledName, Ty, GD, /*ForVTable=*/false, + /*DontDefer=*/false); return; } } else { |