Move some flag-like props from GlobalContext and TargetLowering to ClFlags.
Simplifies the GlobalContext constructor so that a future
change may just set up the flags and the GlobalContext
before calling into what is currently "main".
Namely this change:
https://codereview.chromium.org/997773002/
This also moves all uses of LLVM's CommandLine.h to
a single file, so that in the future we may be able
to simplify the flags parsing (especially for the
minimal build).
BUG= https://code.google.com/p/nativeclient/issues/detail?id=4091
BUG= https://code.google.com/p/nativeclient/issues/detail?id=4084
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/1024203002
diff --git a/src/IceTargetLowering.h b/src/IceTargetLowering.h
index 8b4bd27..112572c 100644
--- a/src/IceTargetLowering.h
+++ b/src/IceTargetLowering.h
@@ -99,7 +99,7 @@
static std::unique_ptr<Assembler> createAssembler(TargetArch Target,
Cfg *Func);
void translate() {
- switch (Ctx->getOptLevel()) {
+ switch (Ctx->getFlags().getOptLevel()) {
case Opt_m1:
translateOm1();
break;
@@ -164,7 +164,6 @@
virtual SizeT getFrameOrStackReg() const = 0;
virtual size_t typeWidthInBytesOnStack(Type Ty) const = 0;
bool hasComputedFrame() const { return HasComputedFrame; }
- bool shouldDoNopInsertion() const;
// Returns true if this function calls a function that has the
// "returns twice" attribute.
bool callsReturnsTwice() const { return CallsReturnsTwice; }
@@ -244,7 +243,6 @@
Cfg *Func;
GlobalContext *Ctx;
- const bool RandomizeRegisterAllocation;
bool HasComputedFrame;
bool CallsReturnsTwice;
// StackAdjustment keeps track of the current stack offset from its