From e431adbfc7c444f6bc0d100705e8e467d7be1680 Mon Sep 17 00:00:00 2001 From: Gordon Henriksen Date: Sun, 17 Aug 2008 16:18:50 +0000 Subject: Don't instantiate GC metadata for declarations. llvm-svn: 54895 --- llvm/lib/CodeGen/GCMetadata.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'llvm/lib/CodeGen/GCMetadata.cpp') diff --git a/llvm/lib/CodeGen/GCMetadata.cpp b/llvm/lib/CodeGen/GCMetadata.cpp index c02a73b7080..0b5c6f0662c 100644 --- a/llvm/lib/CodeGen/GCMetadata.cpp +++ b/llvm/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; -- cgit v1.2.3