1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Don't instantiate GC metadata for declarations.

llvm-svn: 54895
This commit is contained in:
Gordon Henriksen 2008-08-17 16:18:50 +00:00
parent dd94221bda
commit caf246344c
2 changed files with 3 additions and 1 deletions

View File

@ -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;

View File

@ -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;