Commit ab06df31 by Karl Schimpf

Remove IceConverter when LLVM IR is not allowed.

BUG= R=stichnot@chromium.org Review URL: https://codereview.chromium.org/689433002
parent 6af6336d
......@@ -86,12 +86,11 @@ CXXFLAGS := $(LLVM_CXXFLAGS) -std=c++11 -Wall -Wextra -Werror -fno-rtti \
-I$(LIBCXX_INSTALL_PATH)/include/c++/v1
LDFLAGS := $(HOST_FLAGS) -L$(LIBCXX_INSTALL_PATH)/lib
SRCS= \
SRCS = \
assembler.cpp \
assembler_ia32.cpp \
IceCfg.cpp \
IceCfgNode.cpp \
IceConverter.cpp \
IceGlobalContext.cpp \
IceGlobalInits.cpp \
IceInst.cpp \
......@@ -111,6 +110,10 @@ SRCS= \
llvm2ice.cpp \
PNaClTranslator.cpp
ifndef MINIMAL
SRCS += IceConverter.cpp
endif
OBJS=$(patsubst %.cpp, $(OBJDIR)/%.o, $(SRCS))
# Keep all the first target so it's the default.
......@@ -146,8 +149,13 @@ check-lit: llvm2ice make_symlink
LLVM_BIN_PATH=$(LLVM_BIN_PATH) \
$(LLVM_SRC_PATH)/utils/lit/lit.py -sv tests_lit
ifdef MINIMAL
check: check-lit
@echo "Crosstests ignored, minimal build"
else
check: check-lit
(cd crosstest; ./runtests.sh)
endif
# TODO: Fix the use of wildcards.
# Assumes clang-format is within $PATH.
......
......@@ -105,6 +105,7 @@ if __name__ == '__main__':
'--target=' + args.target,
'--prefix=' + args.prefix,
'-allow-uninitialized-globals',
'-build-on-read=0',
'-o=' + asm_sz,
bitcode])
shellcmd(['llvm-mc',
......
......@@ -74,8 +74,10 @@ def main():
cmd += ['--bitcode-format=pnacl']
if not args.no_local_syms:
cmd += ['--allow-local-symbol-tables']
if not (args.llvm or args.llvm_source):
cmd += ['--build-on-read']
if args.llvm or args.llvm_source:
cmd += ['--build-on-read=0']
else:
cmd += ['--build-on-read=1']
if args.args:
cmd += args.args
if args.llvm_source:
......
......@@ -148,10 +148,14 @@ static cl::opt<std::string>
"unnamed functions"),
cl::init("Function"));
// Note: While this flag isn't used in the minimal build, we keep this
// flag so that tests can set this command-line flag without concern
// to the type of build. We double check that this flag at runtime
// to make sure the consistency is maintained.
static cl::opt<bool>
BuildOnRead("build-on-read",
cl::desc("Build ICE instructions when reading bitcode"),
cl::init(false));
BuildOnRead("build-on-read",
cl::desc("Build ICE instructions when reading bitcode"),
cl::init(true));
static cl::opt<bool>
UseIntegratedAssembler("integrated-as",
......@@ -271,7 +275,7 @@ int main(int argc, char **argv) {
Ice::PNaClTranslator Translator(&Ctx, Flags);
Translator.translate(IRFilename);
ErrorStatus = Translator.getErrorStatus();
} else {
} else if (ALLOW_LLVM_IR) {
// Parse the input LLVM IR file into a module.
SMDiagnostic Err;
Ice::TimerMarker T1(Ice::TimerStack::TT_parse, &Ctx);
......@@ -286,6 +290,10 @@ int main(int argc, char **argv) {
Ice::Converter Converter(Mod, &Ctx, Flags);
Converter.convertToIce();
ErrorStatus = Converter.getErrorStatus();
} else {
*Ls << "Error: Build doesn't allow LLVM IR, "
<< "--build-on-read=0 not allowed\n";
return GetReturnValue(1);
}
if (TimeEachFunction) {
const bool DumpCumulative = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment