llvm-project/llvm/include/llvm/CodeGen
Sanne Wouda 2933875cc2 [Assembler] Enable nicer diagnostics for inline assembly.
Fixed test.

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: 294458
2017-02-08 14:48:05 +00:00
..
GlobalISel GlobalISel: legalize G_INSERT instructions 2017-02-06 21:56:47 +00:00
MIRParser [NFC] Header cleanup 2016-04-18 09:17:29 +00:00
PBQP [pbqp] unique_ptr-ify (Vector|Matrix)::Data, NFC. 2016-10-24 20:51:46 +00:00
Analysis.h [CGP] Be less conservative about tail-duplicating a ret to allow tail calls 2016-09-08 00:48:37 +00:00
AsmPrinter.h [Assembler] Enable nicer diagnostics for inline assembly. 2017-02-08 14:48:05 +00:00
AtomicExpandUtils.h
BasicTTIImpl.h NVPTX: Refactor NVPTXInferAddressSpaces to check TTI 2017-01-30 23:02:12 +00:00
CalcSpillWeights.h
CallingConvLower.h [CodeGen] Remove dead call-or-prologue enum from CCState 2017-02-02 21:58:22 +00:00
CommandFlags.h DAG: Recognize no-signed-zeros-fp-math attribute 2017-01-25 06:08:42 +00:00
DAGCombine.h
DFAPacketizer.h
DIE.h DebugInfo: support for DW_FORM_implicit_const 2017-01-10 21:18:26 +00:00
DIEValue.def Make a DWARF generator so we can unit test DWARF APIs with gtest. 2016-12-08 01:03:48 +00:00
DwarfStringPoolEntry.h
EdgeBundles.h
FastISel.h FastISel: Remove unused/un-overridden entry points. NFCI. 2016-10-05 19:25:20 +00:00
FaultMaps.h [ImplicitNullCheck] Extend Implicit Null Check scope by using stores 2017-02-07 19:19:49 +00:00
FunctionLoweringInfo.h [CodeGen] Pull MMI helpers from FunctionLoweringInfo to MMI. NFC. 2016-11-16 22:24:56 +00:00
GCMetadata.h Pass DebugLoc and SDLoc by const ref. 2016-06-12 15:39:02 +00:00
GCMetadataPrinter.h
GCStrategy.h
GCs.h
ISDOpcodes.h Add intrinsics for constrained floating point operations 2017-01-26 23:27:59 +00:00
IntrinsicLowering.h
LatencyPriorityQueue.h
LexicalScopes.h
LinkAllAsmWriterComponents.h
LinkAllCodegenComponents.h
LiveInterval.h Fix comment typos. NFC. 2016-11-20 13:47:59 +00:00
LiveIntervalAnalysis.h [RegisterCoalescing] Recommit the patch "Remove partial redundent copy". 2017-01-28 01:05:27 +00:00
LiveIntervalUnion.h
LivePhysRegs.h BranchRelaxation: Recompute live-ins when splitting a block 2016-12-16 23:55:37 +00:00
LiveRangeEdit.h Allow dead insts to be kept in DeadRemat only when they are rematerializable. 2016-07-08 21:08:09 +00:00
LiveRegMatrix.h
LiveRegUnits.h LiveRegUnits: Add accumulateBackward() function 2017-01-21 02:21:04 +00:00
LiveStackAnalysis.h
LiveVariables.h Use the range variant of find instead of unpacking begin/end 2016-08-11 22:21:41 +00:00
LowLevelType.h GlobalISel: produce correct code for signext/zeroext ABI flags. 2016-09-21 12:57:45 +00:00
MIRYamlMapping.h Apply clang-tidy's performance-unnecessary-value-param to LLVM. 2017-01-13 14:39:03 +00:00
MachORelocation.h
MachineBasicBlock.h [MachineBasicBlock] Add a non-assert live-in accessor for debug mode. 2017-01-07 00:46:30 +00:00
MachineBlockFrequencyInfo.h Add support to dump dot graph block layout after MBP 2017-01-29 01:57:02 +00:00
MachineBranchProbabilityInfo.h
MachineCombinerPattern.h [MachineCombiner] Support for floating-point FMA on ARM64 (re-commit r267098) 2016-04-24 05:14:01 +00:00
MachineConstantPool.h
MachineDominanceFrontier.h
MachineDominators.h Fix for InlineSpiller accessing not updated dom tree base information. 2017-01-04 09:41:56 +00:00
MachineFrameInfo.h Test commit. Comment formatting, it's -> its. 2017-01-07 00:22:31 +00:00
MachineFunction.h Move most EH from MachineModuleInfo to MachineFunction 2016-12-01 19:32:15 +00:00
MachineFunctionInitializer.h
MachineFunctionPass.h
MachineInstr.h MachineInstr: Remove parameter from dump() 2017-01-29 18:20:42 +00:00
MachineInstrBuilder.h [CodeGen] Rename MachineInstrBuilder::addOperand. NFC 2017-01-13 09:58:52 +00:00
MachineInstrBundle.h MachineInstrBundle: Pass iterators to getBundle(Start|End); NFC 2016-10-25 02:55:17 +00:00
MachineInstrBundleIterator.h ADT: Add explicit conversions for reverse ilist iterators 2017-02-07 21:03:50 +00:00
MachineJumpTableInfo.h
MachineLoopInfo.h New OptimizationRemarkEmitter pass for MIR 2017-01-25 23:20:33 +00:00
MachineMemOperand.h [MachineMemOperand][AtomicSDNode] Remove getSuccessOrdering() 2016-10-21 16:02:35 +00:00
MachineModuleInfo.h Move most EH from MachineModuleInfo to MachineFunction 2016-12-01 19:32:15 +00:00
MachineModuleInfoImpls.h Drop support for creating $stubs. 2016-06-29 14:59:50 +00:00
MachineOperand.h Cleanup dump() functions. 2017-01-28 02:02:38 +00:00
MachineOptimizationRemarkEmitter.h New OptimizationRemarkEmitter pass for MIR 2017-01-25 23:20:33 +00:00
MachinePassRegistry.h Use StringRef in CommandLine Options handling (NFC) 2016-10-01 03:43:20 +00:00
MachinePostDominators.h
MachineRegionInfo.h Modify df_iterator to support post-order actions 2016-10-05 21:36:16 +00:00
MachineRegisterInfo.h GlobalISel: fix mistaken comment change 2016-11-10 22:47:38 +00:00
MachineSSAUpdater.h [NFC] Header cleanup 2016-04-18 09:17:29 +00:00
MachineScheduler.h [CodeGen] Move MacroFusion to the target 2017-02-01 02:54:34 +00:00
MachineTraceMetrics.h
MachineValueType.h [CodeGen] Add v32i1 to is32BitVector and v64i1 to is64BitVector. 2017-02-04 03:09:42 +00:00
PBQPRAConstraint.h
ParallelCG.h [NFC] Header cleanup 2016-04-18 09:17:29 +00:00
Passes.h Revamp llvm::once_flag to be closer to std::once_flag 2017-02-05 21:13:06 +00:00
PreISelIntrinsicLowering.h [PM] Port PreISelIntrinsicLowering to the new PM 2016-06-24 20:13:42 +00:00
PseudoSourceValue.h Add custom type for PseudoSourceValue 2016-12-17 04:41:53 +00:00
RegAllocPBQP.h Apply clang-tidy's performance-unnecessary-value-param to LLVM. 2017-01-13 14:39:03 +00:00
RegAllocRegistry.h
RegisterClassInfo.h
RegisterPressure.h Cleanup dump() functions. 2017-01-28 02:02:38 +00:00
RegisterScavenging.h CodeGen: Add/Factor out LiveRegUnits class; NFCI 2017-01-20 00:16:14 +00:00
RegisterUsageInfo.h Interprocedural Register Allocation (IPRA) Analysis 2016-06-10 16:19:46 +00:00
ResourcePriorityQueue.h Replace silly uses of 'signed' with 'int' 2016-06-21 05:10:24 +00:00
RuntimeLibcalls.h Introduce element-wise atomic memcpy intrinsic 2016-12-29 14:31:07 +00:00
ScheduleDAG.h Revert "(origin/master, origin/HEAD) MachineScheduler/ScheduleDAG: Add support to skipping a node." 2016-11-11 22:39:50 +00:00
ScheduleDAGInstrs.h ScheduleDAGInstrs: Cleanup toggleKillFlag(); NFC 2017-01-27 18:53:05 +00:00
ScheduleDAGMutation.h
ScheduleDFS.h
ScheduleHazardRecognizer.h CodeGen: Add a stand-alone hazard recognizer pass 2016-04-22 14:43:50 +00:00
SchedulerRegistry.h
ScoreboardHazardRecognizer.h ScoreboardHazardRecognizer: unbreak TSAN by moving a static mutated variable to a member 2016-04-20 00:21:24 +00:00
SelectionDAG.h [DAGCombiner] Make DAGCombiner smarter about overflow 2017-02-06 14:54:49 +00:00
SelectionDAGISel.h SDAG: Update ChainNodesMatched during UpdateChains if a node is replaced 2017-01-30 18:29:46 +00:00
SelectionDAGNodes.h [X86][SSE] Combine shuffle nodes with multiple uses if all the users are being combined. 2017-02-06 13:44:45 +00:00
SelectionDAGTargetInfo.h Pass DebugLoc and SDLoc by const ref. 2016-06-12 15:39:02 +00:00
SlotIndexes.h MachineInstrBundle: Pass iterators to getBundle(Start|End); NFC 2016-10-25 02:55:17 +00:00
StackMaps.h [Stackmap] Added callsite counts to emitted function information. 2016-09-14 20:22:03 +00:00
StackProtector.h [SSP] Remove llvm.stackprotectorcheck. 2016-04-08 21:26:31 +00:00
TailDuplicator.h Codegen: Tail-duplicate during placement. 2016-10-11 20:36:43 +00:00
TargetLoweringObjectFileImpl.h [lto] add getLinkerOpts() 2017-02-02 23:00:49 +00:00
TargetPassConfig.h llc: Add -start-before/-stop-before options 2016-09-23 21:46:02 +00:00
TargetSchedule.h
UnreachableBlockElim.h [PM] Port UnreachableBlockElim to the new Pass Manager 2016-07-08 03:32:49 +00:00
ValueTypes.h Remove LLVM_CONSTEXPR. 2016-10-23 19:39:16 +00:00
ValueTypes.td Declare MVT::SimpleValueType as an int8_t sized enum. This removes 400 bytes from TargetLoweringBase and probably other places. 2016-04-17 17:37:33 +00:00
VirtRegMap.h
WinEHFuncInfo.h [StackProtector] Fix computation of GSCookieOffset and EHCookieOffset with SEH4 2016-06-21 15:58:55 +00:00