diff --git a/lib/ExecutionEngine/Orc/Layer.cpp b/lib/ExecutionEngine/Orc/Layer.cpp index 61e7ab5ae68..0a5d5577e99 100644 --- a/lib/ExecutionEngine/Orc/Layer.cpp +++ b/lib/ExecutionEngine/Orc/Layer.cpp @@ -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; } }); }