improve a comment
authorChris Lattner <sabre@nondot.org>
Thu, 26 Apr 2007 03:32:43 +0000 (03:32 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 26 Apr 2007 03:32:43 +0000 (03:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36464 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Bitcode/Writer/BitcodeWriter.cpp

index 654eafea0cd32424bc9f8494f0d505bcfbe2b524..53431dd4e012a9a9c6f7197b82f600e484e13c90 100644 (file)
@@ -572,8 +572,9 @@ static void WriteModule(const Module *M, BitstreamWriter &Stream) {
   // Emit constants.
   WriteModuleConstants(VE, Stream);
   
-  // FIXME: Purge aggregate values from the VE, emit a record that indicates how
-  // many to purge.
+  // If we have any aggregate values in the value table, purge them - these can
+  // only be used to initialize global variables.  Doing so makes the value
+  // namespace smaller for code in functions.
   int NumNonAggregates = VE.PurgeAggregateValues();
   if (NumNonAggregates != -1) {
     SmallVector<unsigned, 1> Vals;
@@ -583,7 +584,8 @@ static void WriteModule(const Module *M, BitstreamWriter &Stream) {
   
   // Emit function bodies.
   for (Module::const_iterator I = M->begin(), E = M->end(); I != E; ++I)
-    WriteFunction(*I, VE, Stream);
+    if (!I->isDeclaration())
+      WriteFunction(*I, VE, Stream);
   
   // Emit the type symbol table information.
   WriteTypeSymbolTable(M->getTypeSymbolTable(), VE, Stream);