llvm-project/llvm/test
Sanne Wouda 09adc245ea [Assembler] Enable nicer diagnostics for inline assembly.
Summary:
Enables source location in diagnostic messages from the backend.  This
is after parsing, during finalization.  This requires the SourceMgr, the
inline assembly string buffer, and DiagInfo to still be alive after
EmitInlineAsm returns.

This patch creates a single SourceMgr for inline assembly inside the
AsmPrinter.  MCContext gets a pointer to this SourceMgr.  Using one
SourceMgr per call to EmitInlineAsm would make it difficult for
MCContext to figure out in which SourceMgr the SMLoc is located, while a
single SourceMgr can figure it out if it has multiple buffers.

The Str argument to EmitInlineAsm is copied into a buffer and owned by
the inline asm SourceMgr.  This ensures that DiagHandlers won't print
garbage.  (Clang emits a "note: instantiated into assembly here", which
refers to this string.)

The AsmParser gets destroyed before finalization, which means that the
DiagHandlers the AsmParser installs into the SourceMgr will be stale.
Restore the saved DiagHandlers.

Since now we're using just one SourceMgr for multiple inline asm
strings, we need to tell the AsmParser which buffer it needs to parse
currently.  Hand a buffer id -- returned from SourceMgr::
AddNewSourceBuffer -- to the AsmParser.

Reviewers: rnk, grosbach, compnerd, rengolin, rovka, anemet

Reviewed By: rnk

Subscribers: llvm-commits

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

llvm-svn: 294433
2017-02-08 10:20:07 +00:00
..
Analysis [X86] Add costs for non-AVX512 single-source permutation integer shuffles 2017-02-02 20:27:13 +00:00
Assembler [Assembler] Enable nicer diagnostics for inline assembly. 2017-02-08 10:20:07 +00:00
Bindings [cmake] Canonicalize CMake booleans to 0/1 for lit interop 2017-01-06 21:33:48 +00:00
Bitcode Fix the bitcode upgrade for DIGlobalVariable in a DIImportedEntity context. 2017-02-07 17:35:41 +00:00
BugPoint
CodeGen AMDGPU: Enable InferAddressSpaces 2017-02-08 06:16:04 +00:00
DebugInfo DebugInfo: Track spilled variables in LiveDebugValues 2017-02-07 21:23:15 +00:00
Examples
ExecutionEngine RuntimeDyldELF/AArch64: Implement basic GOT support 2017-02-06 15:31:28 +00:00
Feature Add intrinsics for constrained floating point operations 2017-01-26 23:27:59 +00:00
FileCheck Commit a test for match-full-lines. 2017-01-09 23:11:25 +00:00
Instrumentation SanitizerCoverage: Support sanitizer guard section on darwin 2017-02-01 02:38:39 +00:00
Integer
JitListener [cmake] Canonicalize CMake booleans to 0/1 for lit interop 2017-01-06 21:33:48 +00:00
LTO LTO: Link non-prevailing weak_odr or linkonce_odr globals into the combined module with available_externally linkage. 2017-02-02 05:22:42 +00:00
LibDriver LibDriver: Allow resource files to be archive members. 2016-12-15 19:37:46 +00:00
Linker Linker: Move special casing for available_externally in IRMover to clients. NFCI. 2017-02-02 05:12:15 +00:00
MC [X86] Remove PCOMMIT instruction support since Intel has deprecated this instruction with no plans to release products with it. 2017-02-08 05:45:39 +00:00
Object Fix a typo in an error message for a check of invalid Mach-O files where 2017-02-07 21:20:44 +00:00
ObjectYAML Attempt to fix the testcase in r292824 2017-01-23 20:42:17 +00:00
Other [PM] Port LoopLoadElimination to the new pass manager and wire it into 2017-01-27 01:32:26 +00:00
SymbolRewriter
TableGen [GlobalISel] Print the matched patterns using an action. 2017-02-04 00:47:08 +00:00
ThinLTO/X86 Revert "[ThinLTO] Add an auto-hide feature" 2017-02-03 07:41:43 +00:00
Transforms [ArgPromote] Delete a test that makes no sense (any more). 2017-02-08 08:54:08 +00:00
Unit
Verifier Add intrinsics for constrained floating point operations 2017-01-26 23:27:59 +00:00
YAMLParser
tools Use dynamic symbols for ELF disassembly 2017-02-08 09:44:18 +00:00
.clang-format
CMakeLists.txt [llvm-config] Print --system-libs only when static linking 2017-01-06 21:33:54 +00:00
TestRunner.sh
lit.cfg [llvm-config] Print --system-libs only when static linking 2017-01-06 21:33:54 +00:00
lit.site.cfg.in [llvm-config] Print --system-libs only when static linking 2017-01-06 21:33:54 +00:00