summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-04-26 03:32:43 +0000
committerChris Lattner <sabre@nondot.org>2007-04-26 03:32:43 +0000
commita5211c43c273c38102cbbb4933a50dd466398f9c (patch)
treebe033bf6259088f7822d9845034664c1725d32ba /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parent831d420256e9c6ad4b94e33483ec4c136e1f571b (diff)
downloadbcm5719-llvm-a5211c43c273c38102cbbb4933a50dd466398f9c.tar.gz
bcm5719-llvm-a5211c43c273c38102cbbb4933a50dd466398f9c.zip
improve a comment
llvm-svn: 36464
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 654eafea0cd..53431dd4e01 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -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);
OpenPOWER on IntegriCloud