summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-07 05:38:05 +0000
committerChris Lattner <sabre@nondot.org>2010-04-07 05:38:05 +0000
commitcf9a415182aca6a432105a2a12168e1049de180a (patch)
treecc2f1629b01ff1198cbe3bf2810b7bfeaf2ac9ed /docs
parentfee455ea6a7e209a3cac5fc8e601f8e85cfb3792 (diff)
downloadllvm-cf9a415182aca6a432105a2a12168e1049de180a.tar.gz
llvm-cf9a415182aca6a432105a2a12168e1049de180a.tar.bz2
llvm-cf9a415182aca6a432105a2a12168e1049de180a.tar.xz
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
Diffstat (limited to 'docs')
-rw-r--r--docs/LangRef.html25
1 files changed, 25 insertions, 0 deletions
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.</p>
+</div>
+
+<div class="doc_subsubsection">
+<a name="inlineasm_md">Inline Asm Metadata</a>
+</div>
+
+<div class="doc_text">
+
+<p>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:</p>
+
+<div class="doc_code">
+<pre>
+call void asm sideeffect "something bad", ""()<b>, !srcloc !42</b>
+...
+!42 = !{ i32 1234567 }
+</pre>
+</div>
+
+<p>It is up to the front-end to make sense of the magic numbers it places in the
+ IR.</p>
</div>