summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-05-12 20:21:39 +0000
committerChris Lattner <sabre@nondot.org>2009-05-12 20:21:39 +0000
commitcd74ffa3eb0c5b789a5165748ca7747d98bb73e8 (patch)
treea7443b3ba81de830482fe5595dba32111f83c304 /clang/lib/CodeGen/CodeGenModule.cpp
parentb41de47856bc4b39d84303b648ecbc4694a70f54 (diff)
downloadbcm5719-llvm-cd74ffa3eb0c5b789a5165748ca7747d98bb73e8.tar.gz
bcm5719-llvm-cd74ffa3eb0c5b789a5165748ca7747d98bb73e8.zip
static methods don't get this pointers.
llvm-svn: 71583
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 08f2b27bea5..a6191c5bb37 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -245,7 +245,7 @@ GetLinkageForFunction(const FunctionDecl *FD, const LangOptions &Features) {
if (FD->getStorageClass() == FunctionDecl::Static)
return CodeGenModule::GVA_Internal;
- if (!FD->isInline())
+ if (!FD->isInline() && !isa<CXXMethodDecl>(FD))
return CodeGenModule::GVA_StrongExternal;
// If the inline function explicitly has the GNU inline attribute on it, or if
@@ -600,12 +600,20 @@ llvm::Constant *CodeGenModule::GetOrCreateLLVMFunction(const char *MangledName,
// deferred decl with this name, remember that we need to emit it at the end
// of the file.
llvm::DenseMap<const char*, GlobalDecl>::iterator DDI =
- DeferredDecls.find(MangledName);
+ DeferredDecls.find(MangledName);
if (DDI != DeferredDecls.end()) {
// Move the potentially referenced deferred decl to the DeferredDeclsToEmit
// list, and remove it from DeferredDecls (since we don't need it anymore).
DeferredDeclsToEmit.push_back(DDI->second);
DeferredDecls.erase(DDI);
+ } else
+ if (MayDeferGeneration(D)) {
+ // If this the first reference to a C++ inline function in a class, queue up
+ // the deferred function body for emission. These are not seen as
+ // top-level declarations.
+ if (!isa<CXXConstructorDecl>(D) &&
+ !isa<CXXDestructorDecl>(D))
+ DeferredDeclsToEmit.push_back(GlobalDecl(D));
}
// This function doesn't have a complete type (for example, the return
OpenPOWER on IntegriCloud