Don't remove aggregate-typed module level constants before encoding functions

since functions may contain aggregate constants too.

llvm-svn: 73220
This commit is contained in:
Nick Lewycky
2009-06-12 05:20:12 +00:00
parent e68347bde5
commit a879819918
4 changed files with 12 additions and 31 deletions

View File

@@ -1308,16 +1308,6 @@ static void WriteModule(const Module *M, BitstreamWriter &Stream) {
// Emit constants.
WriteModuleConstants(VE, Stream);
// 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;
Vals.push_back(NumNonAggregates);
Stream.EmitRecord(bitc::MODULE_CODE_PURGEVALS, Vals);
}
// Emit function bodies.
for (Module::const_iterator I = M->begin(), E = M->end(); I != E; ++I)
if (!I->isDeclaration())