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 \ ...@@ -86,12 +86,11 @@ CXXFLAGS := $(LLVM_CXXFLAGS) -std=c++11 -Wall -Wextra -Werror -fno-rtti \
-I$(LIBCXX_INSTALL_PATH)/include/c++/v1 -I$(LIBCXX_INSTALL_PATH)/include/c++/v1
LDFLAGS := $(HOST_FLAGS) -L$(LIBCXX_INSTALL_PATH)/lib LDFLAGS := $(HOST_FLAGS) -L$(LIBCXX_INSTALL_PATH)/lib
SRCS= \ SRCS = \
assembler.cpp \ assembler.cpp \
assembler_ia32.cpp \ assembler_ia32.cpp \
IceCfg.cpp \ IceCfg.cpp \
IceCfgNode.cpp \ IceCfgNode.cpp \
IceConverter.cpp \
IceGlobalContext.cpp \ IceGlobalContext.cpp \
IceGlobalInits.cpp \ IceGlobalInits.cpp \
IceInst.cpp \ IceInst.cpp \
...@@ -111,6 +110,10 @@ SRCS= \ ...@@ -111,6 +110,10 @@ SRCS= \
llvm2ice.cpp \ llvm2ice.cpp \
PNaClTranslator.cpp PNaClTranslator.cpp
ifndef MINIMAL
SRCS += IceConverter.cpp
endif
OBJS=$(patsubst %.cpp, $(OBJDIR)/%.o, $(SRCS)) OBJS=$(patsubst %.cpp, $(OBJDIR)/%.o, $(SRCS))
# Keep all the first target so it's the default. # Keep all the first target so it's the default.
...@@ -146,8 +149,13 @@ check-lit: llvm2ice make_symlink ...@@ -146,8 +149,13 @@ check-lit: llvm2ice make_symlink
LLVM_BIN_PATH=$(LLVM_BIN_PATH) \ LLVM_BIN_PATH=$(LLVM_BIN_PATH) \
$(LLVM_SRC_PATH)/utils/lit/lit.py -sv tests_lit $(LLVM_SRC_PATH)/utils/lit/lit.py -sv tests_lit
ifdef MINIMAL
check: check-lit
@echo "Crosstests ignored, minimal build"
else
check: check-lit check: check-lit
(cd crosstest; ./runtests.sh) (cd crosstest; ./runtests.sh)
endif
# TODO: Fix the use of wildcards. # TODO: Fix the use of wildcards.
# Assumes clang-format is within $PATH. # Assumes clang-format is within $PATH.
......
...@@ -105,6 +105,7 @@ if __name__ == '__main__': ...@@ -105,6 +105,7 @@ if __name__ == '__main__':
'--target=' + args.target, '--target=' + args.target,
'--prefix=' + args.prefix, '--prefix=' + args.prefix,
'-allow-uninitialized-globals', '-allow-uninitialized-globals',
'-build-on-read=0',
'-o=' + asm_sz, '-o=' + asm_sz,
bitcode]) bitcode])
shellcmd(['llvm-mc', shellcmd(['llvm-mc',
......
...@@ -74,8 +74,10 @@ def main(): ...@@ -74,8 +74,10 @@ def main():
cmd += ['--bitcode-format=pnacl'] cmd += ['--bitcode-format=pnacl']
if not args.no_local_syms: if not args.no_local_syms:
cmd += ['--allow-local-symbol-tables'] cmd += ['--allow-local-symbol-tables']
if not (args.llvm or args.llvm_source): if args.llvm or args.llvm_source:
cmd += ['--build-on-read'] cmd += ['--build-on-read=0']
else:
cmd += ['--build-on-read=1']
if args.args: if args.args:
cmd += args.args cmd += args.args
if args.llvm_source: if args.llvm_source:
......
...@@ -148,10 +148,14 @@ static cl::opt<std::string> ...@@ -148,10 +148,14 @@ static cl::opt<std::string>
"unnamed functions"), "unnamed functions"),
cl::init("Function")); 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> static cl::opt<bool>
BuildOnRead("build-on-read", BuildOnRead("build-on-read",
cl::desc("Build ICE instructions when reading bitcode"), cl::desc("Build ICE instructions when reading bitcode"),
cl::init(false)); cl::init(true));
static cl::opt<bool> static cl::opt<bool>
UseIntegratedAssembler("integrated-as", UseIntegratedAssembler("integrated-as",
...@@ -271,7 +275,7 @@ int main(int argc, char **argv) { ...@@ -271,7 +275,7 @@ int main(int argc, char **argv) {
Ice::PNaClTranslator Translator(&Ctx, Flags); Ice::PNaClTranslator Translator(&Ctx, Flags);
Translator.translate(IRFilename); Translator.translate(IRFilename);
ErrorStatus = Translator.getErrorStatus(); ErrorStatus = Translator.getErrorStatus();
} else { } else if (ALLOW_LLVM_IR) {
// Parse the input LLVM IR file into a module. // Parse the input LLVM IR file into a module.
SMDiagnostic Err; SMDiagnostic Err;
Ice::TimerMarker T1(Ice::TimerStack::TT_parse, &Ctx); Ice::TimerMarker T1(Ice::TimerStack::TT_parse, &Ctx);
...@@ -286,6 +290,10 @@ int main(int argc, char **argv) { ...@@ -286,6 +290,10 @@ int main(int argc, char **argv) {
Ice::Converter Converter(Mod, &Ctx, Flags); Ice::Converter Converter(Mod, &Ctx, Flags);
Converter.convertToIce(); Converter.convertToIce();
ErrorStatus = Converter.getErrorStatus(); ErrorStatus = Converter.getErrorStatus();
} else {
*Ls << "Error: Build doesn't allow LLVM IR, "
<< "--build-on-read=0 not allowed\n";
return GetReturnValue(1);
} }
if (TimeEachFunction) { if (TimeEachFunction) {
const bool DumpCumulative = false; 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