diff options
author | Gordon Henriksen <gordonhenriksen@mac.com> | 2008-08-17 16:18:50 +0000 |
---|---|---|
committer | Gordon Henriksen <gordonhenriksen@mac.com> | 2008-08-17 16:18:50 +0000 |
commit | 418b6e875f844261064c5dd43e76cb401117ac74 (patch) | |
tree | 7f74ce030ec8d7b73fe16937ffc3bf37f1e90ea2 /lib | |
parent | 3813bcaa89a12bc305fe41019fcc84dafa364e07 (diff) | |
download | external_llvm-418b6e875f844261064c5dd43e76cb401117ac74.tar.gz external_llvm-418b6e875f844261064c5dd43e76cb401117ac74.tar.bz2 external_llvm-418b6e875f844261064c5dd43e76cb401117ac74.zip |
Don't instantiate GC metadata for declarations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54895 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/GCMetadata.cpp | 2 | ||||
-rw-r--r-- | lib/CodeGen/GCStrategy.cpp | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/GCMetadata.cpp b/lib/CodeGen/GCMetadata.cpp index c02a73b708..0b5c6f0662 100644 --- a/lib/CodeGen/GCMetadata.cpp +++ b/lib/CodeGen/GCMetadata.cpp @@ -99,7 +99,9 @@ getOrCreateCollector(const Module *M, const std::string &Name) { } CollectorMetadata &CollectorModuleMetadata::get(const Function &F) { + assert(!F.isDeclaration() && "Can only get GCFunctionInfo for a definition!"); assert(F.hasCollector()); + function_map_type::iterator I = Map.find(&F); if (I != Map.end()) return *I->second; diff --git a/lib/CodeGen/GCStrategy.cpp b/lib/CodeGen/GCStrategy.cpp index 629a2e13de..f5cb9ab631 100644 --- a/lib/CodeGen/GCStrategy.cpp +++ b/lib/CodeGen/GCStrategy.cpp @@ -144,7 +144,7 @@ bool LowerIntrinsics::doInitialization(Module &M) { CollectorModuleMetadata *CMM = getAnalysisToUpdate<CollectorModuleMetadata>(); assert(CMM && "LowerIntrinsics didn't require CollectorModuleMetadata!?"); for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - if (I->hasCollector()) + if (!I->isDeclaration() && I->hasCollector()) CMM->get(*I); // Instantiate the Collector. bool MadeChange = false; |