Commit 681f90fe by John Porto

Subzero. Fixes Browser build.

BUG= R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1856323004 .
parent 16f8061c
......@@ -22,9 +22,9 @@ CXX.Flags += -std=gnu++11
ifeq ($(PNACL_BROWSER_TRANSLATOR),1)
CPP.Defines += -DALLOW_DUMP=0 -DALLOW_LLVM_CL=0 -DALLOW_LLVM_IR=0 \
-DALLOW_TIMERS=0 -DALLOW_LLVM_IR_AS_INPUT=0 -DALLOW_MINIMAL_BUILD=1 \
-DPNACL_BROWSER_TRANSLATOR=1
-DALLOW_WASM=0 -DPNACL_BROWSER_TRANSLATOR=1
else
CPP.Defines += -DALLOW_DUMP=1 -DALLOW_LLVM_CL=1 -DALLOW_LLVM_IR=1 \
-DALLOW_TIMERS=1 -DALLOW_LLVM_IR_AS_INPUT=1 -DALLOW_MINIMAL_BUILD=0 \
-DPNACL_BROWSER_TRANSLATOR=0
-DALLOW_WASM=0 -DPNACL_BROWSER_TRANSLATOR=0
endif
......@@ -92,11 +92,15 @@ void Compiler::run(const Ice::ClFlags &Flags, GlobalContext &Ctx,
Translator.reset(PTranslator.release());
} else if (WasmBuildOnRead) {
if (BuildDefs::wasm()) {
#if !ALLOW_WASM
assert(false && "wasm not allowed");
#else
std::unique_ptr<WasmTranslator> WTranslator(new WasmTranslator(&Ctx));
WTranslator->translate(IRFilename, std::move(InputStream));
Translator.reset(WTranslator.release());
#endif // !ALLOW_WASM
} else {
Ctx.getStrError() << "WASM support not enabled\n";
Ctx.getErrorStatus()->assign(EC_Args);
......
......@@ -15,6 +15,8 @@
///
//===----------------------------------------------------------------------===//
#if ALLOW_WASM
#include "llvm/Support/StreamingMemoryObject.h"
#include "WasmTranslator.h"
......@@ -813,3 +815,5 @@ void WasmTranslator::translate(
return;
}
#endif // ALLOW_WASM
......@@ -15,6 +15,8 @@
#ifndef SUBZERO_SRC_WASMTRANSLATOR_H
#define SUBZERO_SRC_WASMTRANSLATOR_H
#if ALLOW_WASM
#include "IceGlobalContext.h"
#include "IceTranslator.h"
......@@ -66,4 +68,7 @@ private:
SizeT BufferSize;
};
}
#endif // ALLOW_WASM
#endif // SUBZERO_SRC_WASMTRANSLATOR_H
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