diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-07-12 21:08:32 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-07-12 21:08:32 +0000 |
commit | 553f3a9b300fa709379ee77e0ae698b26350a964 (patch) | |
tree | 9a219c28e6d461b0883e43bc00dc6a5433f3e89b /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 0cb91cfc74b935331f2480f0b9230be45712be50 (diff) | |
download | bcm5719-llvm-553f3a9b300fa709379ee77e0ae698b26350a964.tar.gz bcm5719-llvm-553f3a9b300fa709379ee77e0ae698b26350a964.zip |
Speculatively revert r108156; it appears to be breaking self-host.
llvm-svn: 108194
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index d544d4c2334..cb83ffde6f0 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -817,22 +817,14 @@ void CodeGenModule::EmitGlobalDefinition(GlobalDecl GD) { if (Method->isVirtual()) getVTables().EmitThunks(GD); - if (const FunctionDecl *Function = dyn_cast<FunctionDecl>(D)) { - // At -O0, don't generate IR for functions with available_externally - // linkage. - if (CodeGenOpts.OptimizationLevel == 0 && - getFunctionLinkage(Function) - == llvm::Function::AvailableExternallyLinkage) - return; - - if (const CXXConstructorDecl *CD = dyn_cast<CXXConstructorDecl>(Function)) - return EmitCXXConstructor(CD, GD.getCtorType()); + if (const CXXConstructorDecl *CD = dyn_cast<CXXConstructorDecl>(D)) + return EmitCXXConstructor(CD, GD.getCtorType()); - if (const CXXDestructorDecl *DD = dyn_cast<CXXDestructorDecl>(Function)) - return EmitCXXDestructor(DD, GD.getDtorType()); + if (const CXXDestructorDecl *DD = dyn_cast<CXXDestructorDecl>(D)) + return EmitCXXDestructor(DD, GD.getDtorType()); + if (isa<FunctionDecl>(D)) return EmitGlobalFunctionDefinition(GD); - } if (const VarDecl *VD = dyn_cast<VarDecl>(D)) return EmitGlobalVarDefinition(VD); |