diff options
author | Dan Gohman <sunfish@mozilla.com> | 2014-03-05 17:48:22 -0800 |
---|---|---|
committer | Dan Gohman <sunfish@mozilla.com> | 2014-03-05 17:48:22 -0800 |
commit | 9bef807b3bfa2397fb24f4f9c4df5a633a9717b3 (patch) | |
tree | f4a8ca2d8a2a0b4bfa23dd1c3407c2fdfa8bd07b /lib/Target | |
parent | d9003e75353416cfcdb9f03d5fba7e1060a35196 (diff) |
Clean up the handling of inline asm.
Make inline asm a report_fatal_error instead of an assertion failure so
that it's a little friendlier, and add a test to make sure llc -march=js
rejects inline asm.
Also disable the PNaCl inline asm("":::"memory") lowering pass. If people
are using this, it's best that we diagnose it as it likely isn't portable.
There are usually better alternatives.
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/JSBackend/CallHandlers.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Target/JSBackend/CallHandlers.h b/lib/Target/JSBackend/CallHandlers.h index eefe491d16..bfdd86571c 100644 --- a/lib/Target/JSBackend/CallHandlers.h +++ b/lib/Target/JSBackend/CallHandlers.h @@ -1034,7 +1034,9 @@ void setupCallHandlers() { std::string handleCall(const Instruction *CI) { const Value *CV = getActuallyCalledValue(CI); - assert(!isa<InlineAsm>(CV) && "asm() not supported, use EM_ASM() (see emscripten.h)"); + if (isa<InlineAsm>(CV)) { + report_fatal_error("asm() not supported, use EM_ASM() (see emscripten.h)"); + } // Get the name to call this function by. If it's a direct call, meaning // which know which Function we're calling, avoid calling getValueAsStr, as |