public:
bool isSequential() const { return NumTranslationThreads == 0; }
+ bool isParseParallel() const {
+ return getParseParallel() && !isSequential() && getBuildOnRead();
+ }
std::string getAppName() const { return AppName; }
void setAppName(const std::string &Value) { AppName = Value; }
ELFStreamer *ELFStr)
: Strings(new StringPool()), ConstPool(new ConstantPool()), ErrorStatus(),
StrDump(OsDump), StrEmit(OsEmit), StrError(OsError), IntrinsicsInfo(this),
- ObjectWriter(), OptQ(/*Sequential=*/Flags.isSequential(),
- /*MaxSize=*/
- (Flags.getParseParallel() && Flags.getBuildOnRead())
- ? MaxOptQSize
- : Flags.getNumTranslationThreads()),
+ ObjectWriter(),
+ OptQ(/*Sequential=*/Flags.isSequential(),
+ /*MaxSize=*/
+ Flags.isParseParallel() ? MaxOptQSize
+ : Flags.getNumTranslationThreads()),
// EmitQ is allowed unlimited size.
EmitQ(/*Sequential=*/Flags.isSequential()),
DataLowering(TargetDataLowering::createLowering(this)) {
ModuleParser(unsigned BlockID, TopLevelParser *Context)
: BlockParserBaseClass(BlockID, Context),
Timer(Ice::TimerStack::TT_parseModule,
- Context->getTranslator().getContext()) {}
+ Context->getTranslator().getContext()),
+ IsParseParallel(Ice::GlobalContext::Flags.isParseParallel()) {}
~ModuleParser() override = default;
const char *getBlockName() const override { return "module"; }
NaClBitstreamCursor &getCursor() const { return Record.GetCursor(); }
bool GlobalDeclarationNamesAndInitializersInstalled = false;
// True if we have already processed the symbol table for the module.
bool FoundValuesymtab = false;
+ const bool IsParseParallel;
// Generates names for unnamed global addresses (i.e. functions and global
// variables). Then lowers global variable declaration initializers to the
Ice::GlobalContext *Ctx = Context->getTranslator().getContext();
uint32_t SeqNumber = Context->getTranslator().getNextSequenceNumber();
NaClBcIndexSize_t FcnId = Context->getNextFunctionBlockValueID();
- if (Ctx->getFlags().getParseParallel()) {
+ if (IsParseParallel) {
// Skip the block and copy into a buffer. Note: We copy into a buffer
// using the top-level parser to make sure that the underlying
// buffer reading from the data streamer is not thread safe.