Don't instantiate GC metadata for declarations.
[oota-llvm.git] / lib / CodeGen / GCMetadata.cpp
index c02a73b70804f0a98a63c75f499db5342cf85335..0b5c6f0662cf27a45d881bba7c56b72ea6176317 100644 (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;