From a80e1181b78183dc36ec6568559d38faa86981f0 Mon Sep 17 00:00:00 2001 From: Anton Korobeynikov Date: Sat, 28 Apr 2007 13:45:00 +0000 Subject: Implement review feedback. Aliasees can be either GlobalValue's or bitcasts of them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36537 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Bytecode/Writer/SlotCalculator.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/Bytecode/Writer/SlotCalculator.cpp') diff --git a/lib/Bytecode/Writer/SlotCalculator.cpp b/lib/Bytecode/Writer/SlotCalculator.cpp index 85ccad58c5..3a038cd449 100644 --- a/lib/Bytecode/Writer/SlotCalculator.cpp +++ b/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. -- cgit v1.2.3-70-g09d2