diff options
| author | Anton Korobeynikov <asl@math.spbu.ru> | 2007-04-28 13:45:00 +0000 |
|---|---|---|
| committer | Anton Korobeynikov <asl@math.spbu.ru> | 2007-04-28 13:45:00 +0000 |
| commit | b18f8f85e9151195a81833d6862063323338854e (patch) | |
| tree | 3bbb4f5593defb3935aa086ffccc1edb0f2c606a /llvm/lib/Bytecode/Writer/SlotCalculator.cpp | |
| parent | 1deacd61f4a93742e3e12bac91026158bdb1aaf0 (diff) | |
| download | bcm5719-llvm-b18f8f85e9151195a81833d6862063323338854e.tar.gz bcm5719-llvm-b18f8f85e9151195a81833d6862063323338854e.zip | |
Implement review feedback. Aliasees can be either GlobalValue's or
bitcasts of them.
llvm-svn: 36537
Diffstat (limited to 'llvm/lib/Bytecode/Writer/SlotCalculator.cpp')
| -rw-r--r-- | llvm/lib/Bytecode/Writer/SlotCalculator.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/Bytecode/Writer/SlotCalculator.cpp b/llvm/lib/Bytecode/Writer/SlotCalculator.cpp index 85ccad58c5b..3a038cd449a 100644 --- a/llvm/lib/Bytecode/Writer/SlotCalculator.cpp +++ b/llvm/lib/Bytecode/Writer/SlotCalculator.cpp @@ -89,6 +89,12 @@ void SlotCalculator::processModule() { I != E; ++I) CreateSlotIfNeeded(I); + // Add all of the global aliases to the value table... + // + for (Module::const_alias_iterator I = TheModule->alias_begin(), + E = TheModule->alias_end(); I != E; ++I) + CreateSlotIfNeeded(I); + // Add all of the module level constants used as initializers // for (Module::const_global_iterator I = TheModule->global_begin(), @@ -96,6 +102,13 @@ void SlotCalculator::processModule() { if (I->hasInitializer()) CreateSlotIfNeeded(I->getInitializer()); + // Add all of the module level constants used as aliasees + // + for (Module::const_alias_iterator I = TheModule->alias_begin(), + E = TheModule->alias_end(); I != E; ++I) + if (I->getAliasee()) + CreateSlotIfNeeded(I->getAliasee()); + // Now that all global constants have been added, rearrange constant planes // that contain constant strings so that the strings occur at the start of the // plane, not somewhere in the middle. |

