From 2a8f11112ce7a5475c50a81e055b92b6120e3f59 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 14 Mar 2014 19:42:52 -0700 Subject: warn if given the wrong triple --- lib/Target/JSBackend/JSBackend.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Target/JSBackend/JSBackend.cpp b/lib/Target/JSBackend/JSBackend.cpp index 0e0e199c49..76f1a630e0 100644 --- a/lib/Target/JSBackend/JSBackend.cpp +++ b/lib/Target/JSBackend/JSBackend.cpp @@ -2346,6 +2346,10 @@ void JSWriter::printModule(const std::string& fname, } bool JSWriter::runOnModule(Module &M) { + if (M.getTargetTriple() != "asmjs-unknown-emscripten") { + prettyWarning() << "incorrect target triple '" << M.getTargetTriple() << "' (did you use emcc/em++ on all source files and not clang directly?)\n"; + } + TheModule = &M; DL = &getAnalysis(); -- cgit v1.2.3-18-g5258