diff options
author | Chris Lattner <sabre@nondot.org> | 2009-05-12 20:21:39 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-05-12 20:21:39 +0000 |
commit | 43ac9654d088a0e27599e5fa3df532d6de142f5e (patch) | |
tree | f38b40266965a0cff7ae6a1e7a4513291a21513c /lib/CodeGen/CodeGenModule.cpp | |
parent | 78a35a3900b39702ffb9835702a1329f8d3e04b3 (diff) |
static methods don't get this pointers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71583 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 08f2b27bea..a6191c5bb3 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/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 |