diff options
| author | Levente Kurusa <lkurusa@acm.org> | 2018-09-25 20:35:19 +0200 |
|---|---|---|
| committer | Levente Kurusa <lkurusa@acm.org> | 2018-09-25 20:38:35 +0200 |
| commit | fec86c8352d57fd7764d0fa2c4975010c7de793e (patch) | |
| tree | 76d7eb0fbda781b8ee5a5c6aca645a99d4946d7f /src/librustc_codegen_llvm/llvm | |
| parent | e5c6575801028f5e089ef2e7720aa1af9d452334 (diff) | |
codegen_llvm: check inline assembly constraints with LLVM
LLVM provides a way of checking whether the constraints and the actual
inline assembly make sense. This commit introduces a check before
emitting code for the inline assembly. If LLVM rejects the inline
assembly (or its constraints), then the compiler emits an error E0668
("malformed inline assembly").
Signed-off-by: Levente Kurusa <lkurusa@acm.org>
Diffstat (limited to 'src/librustc_codegen_llvm/llvm')
| -rw-r--r-- | src/librustc_codegen_llvm/llvm/ffi.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/librustc_codegen_llvm/llvm/ffi.rs b/src/librustc_codegen_llvm/llvm/ffi.rs index a5f4137c62b..7975e7ad670 100644 --- a/src/librustc_codegen_llvm/llvm/ffi.rs +++ b/src/librustc_codegen_llvm/llvm/ffi.rs @@ -1208,6 +1208,9 @@ extern "C" { AlignStack: Bool, Dialect: AsmDialect) -> &Value; + pub fn LLVMRustInlineAsmVerify(Ty: &Type, + Constraints: *const c_char) + -> Bool; pub fn LLVMRustDebugMetadataVersion() -> u32; pub fn LLVMRustVersionMajor() -> u32; |
