From cf9a415182aca6a432105a2a12168e1049de180a Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 7 Apr 2010 05:38:05 +0000 Subject: Have the inst emitter add the !srcloc mdnode to the machine instr. Have the asmprinter use the mdnode to scavenge a source location if present. Document this nonsense in langref. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100607 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LangRef.html | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'docs') diff --git a/docs/LangRef.html b/docs/LangRef.html index b1bc1687c4..137046fb7a 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -2516,6 +2516,31 @@ call void asm alignstack "eieio", ""() documented here. Constraints on what can be done (e.g. duplication, moving, etc need to be documented). This is probably best done by reference to another document that covers inline asm from a holistic perspective.

+ + +
+Inline Asm Metadata +
+ +
+ +

The call instructions that wrap inline asm nodes may have a "!srcloc" MDNode + attached to it that contains a constant integer. If present, the code + generator will use the integer as the location cookie value when report + errors through the LLVMContext error reporting mechanisms. This allows a + front-end to corrolate backend errors that occur with inline asm back to the + source code that produced it. For example:

+ +
+
+call void asm sideeffect "something bad", ""(), !srcloc !42
+...
+!42 = !{ i32 1234567 }
+
+
+ +

It is up to the front-end to make sense of the magic numbers it places in the + IR.

-- cgit v1.2.3