mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
[ORC][NFC] Refactor loop to determine name of init symbol in IRMaterializationUnit
This loop caused me a little headache once, because I didn't see the assigned variable is a member. The refactored version appears more readable to me. Differential Revision: https://reviews.llvm.org/D85922
This commit is contained in:
parent
e03618a9ec
commit
cc0c266c03
@ -83,17 +83,14 @@ IRMaterializationUnit::IRMaterializationUnit(
|
||||
if (!llvm::empty(getStaticInitGVs(M))) {
|
||||
size_t Counter = 0;
|
||||
|
||||
while (true) {
|
||||
do {
|
||||
std::string InitSymbolName;
|
||||
raw_string_ostream(InitSymbolName)
|
||||
<< "$." << M.getModuleIdentifier() << ".__inits." << Counter++;
|
||||
InitSymbol = ES.intern(InitSymbolName);
|
||||
if (SymbolFlags.count(InitSymbol))
|
||||
continue;
|
||||
SymbolFlags[InitSymbol] =
|
||||
JITSymbolFlags::MaterializationSideEffectsOnly;
|
||||
break;
|
||||
}
|
||||
} while (SymbolFlags.count(InitSymbol));
|
||||
|
||||
SymbolFlags[InitSymbol] = JITSymbolFlags::MaterializationSideEffectsOnly;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user