llvm-project/llvm/lib
Reid Kleckner 953bdce68d [MC] Separate masm integer literal lexer support from inline asm
Summary:
This renames the IsParsingMSInlineAsm member variable of AsmLexer to
LexMasmIntegers and moves it up to MCAsmLexer. This is the only behavior
controlled by that variable. I added a public setter, so that it can be
set from outside or from the llvm-mc command line. We may need to
arrange things so that users can get this behavior from clang, but
that's future work.

I also put additional hex literal lexing functionality under this flag
to fix PR32973. It appears that this hex literal parsing wasn't intended
to be enabled in non-masm-style blocks.

Now, masm integers (0b1101 and 0ABCh) work in __asm blocks from clang,
but 0b label references work when using .intel_syntax in standalone .s
files.

However, 0b label references will *not* work from __asm blocks in clang.
They will work from GCC inline asm blocks, which it sounds like is
important for Crypto++ as mentioned in PR36144.

Essentially, we only lex masm literals for inline asm blobs that use
intel syntax. If the .intel_syntax directive is used inside a gnu-style
inline asm statement, masm literals will not be lexed, which is
compatible with gas and llvm-mc standalone .s assembly.

This fixes PR36144 and PR32973.

Reviewers: Gerolf, avt77

Subscribers: eraman, hiraditya, llvm-commits

Differential Revision: https://reviews.llvm.org/D53535

llvm-svn: 345189
2018-10-24 20:23:57 +00:00
..
Analysis [IAI,LV] Avoid creating a scalar epilogue due to gaps in interleave-groups when 2018-10-22 06:17:09 +00:00
AsmParser Emit template type and value parameter DIEs for template variables. 2018-10-03 18:44:53 +00:00
BinaryFormat Revert r343317 2018-09-28 17:01:50 +00:00
Bitcode Revert "[ThinLTO] Fix a crash in lazy loading of Metadata" 2018-10-23 23:00:29 +00:00
CodeGen [MC] Separate masm integer literal lexer support from inline asm 2018-10-24 20:23:57 +00:00
DebugInfo [PDB] Fix -Wunused-private-field in DIA 2018-10-23 17:20:16 +00:00
Demangle Port libcxxabi r344607 into llvm 2018-10-17 18:50:25 +00:00
ExecutionEngine [ORC] Re-apply r345077 with fixes to remove ambiguity in lookup calls. 2018-10-23 23:01:39 +00:00
FuzzMutate [New PM] Introducing PassInstrumentation framework 2018-09-20 17:08:45 +00:00
Fuzzer
IR IR: Optimize FunctionType::get to perform one hash lookup instead of two, NFCI 2018-10-24 15:18:51 +00:00
IRReader
LTO [NewPM] teach -passes= to emit meaningful error messages 2018-10-17 10:36:23 +00:00
LineEditor
Linker llvm-link: Improve diagnostic for module-level metadata mismatch 2018-10-09 01:17:27 +00:00
MC [MC] Separate masm integer literal lexer support from inline asm 2018-10-24 20:23:57 +00:00
Object llvm-ar: Darwin archive format fixes. 2018-10-10 21:07:02 +00:00
ObjectYAML [AMDGPU] Defined gfx909 Raven Ridge 2 2018-10-24 08:14:07 +00:00
OptRemarks Reland: [OptRemarks] Add library for parsing optimization remarks 2018-10-10 18:43:42 +00:00
Option [opt] Change the parameter of OptTable::PrintHelp from Name to Usage and don't append "[options] <inputs>" 2018-10-10 00:15:31 +00:00
Passes [hot-cold-split] Only perform splitting in ThinLTO backend post-link 2018-10-23 22:57:40 +00:00
ProfileData Support for remapping profile data when symbols change, for sample-based 2018-10-10 21:31:01 +00:00
Support [AMDGPU] Defined gfx909 Raven Ridge 2 2018-10-24 08:14:07 +00:00
TableGen [TableGen] fix assert in !cast when used out of definition in a multiclass 2018-10-10 10:52:57 +00:00
Target [MC] Separate masm integer literal lexer support from inline asm 2018-10-24 20:23:57 +00:00
Testing Fix error with SmallString implicit conversion. 2018-09-06 22:47:32 +00:00
ToolDrivers [opt] Change the parameter of OptTable::PrintHelp from Name to Usage and don't append "[options] <inputs>" 2018-10-10 00:15:31 +00:00
Transforms [hot-cold-split] Name split functions with ".cold" suffix 2018-10-24 18:53:47 +00:00
WindowsManifest Convert line endings of lib/WindowsManifest/CMakeLists.txt to unix. 2018-04-07 04:28:08 +00:00
XRay Use the container form llvm::sort(C, ...) 2018-09-30 22:31:29 +00:00
CMakeLists.txt Reland: [OptRemarks] Add library for parsing optimization remarks 2018-10-10 18:43:42 +00:00
LLVMBuild.txt Reland: [OptRemarks] Add library for parsing optimization remarks 2018-10-10 18:43:42 +00:00