summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-11-17 08:20:42 +0000
committerChris Lattner <sabre@nondot.org>2010-11-17 08:20:42 +0000
commitce1b9ad539e67c6d05cc6b47ca5f6e62a6d91eff (patch)
treedebf961a7171bd33964c44e61f506dca00f678b5 /docs
parent4afa12890f679034e9741a687a6ce33f2846f129 (diff)
downloadllvm-ce1b9ad539e67c6d05cc6b47ca5f6e62a6d91eff.tar.gz
llvm-ce1b9ad539e67c6d05cc6b47ca5f6e62a6d91eff.tar.bz2
llvm-ce1b9ad539e67c6d05cc6b47ca5f6e62a6d91eff.tar.xz
With the newly simplified SourceMgr interfaces and the generalized
SrcMgrDiagHandler, we can improve clang diagnostics for inline asm: instead of reporting them on a source line of the original line, we can report it on the correct line wherever the string literal came from. For something like this: void foo() { asm("push %rax\n" ".code32\n"); } we used to get this: (note that the line in t.c isn't helpful) t.c:4:7: error: warning: ignoring directive for now asm("push %rax\n" ^ <inline asm>:2:1: note: instantiated into assembly here .code32 ^ now we get: t.c:5:8: error: warning: ignoring directive for now ".code32\n" ^ <inline asm>:2:1: note: instantiated into assembly here .code32 ^ Note that we're pointing to line 5 properly now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119488 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r--docs/LangRef.html7
1 files changed, 4 insertions, 3 deletions
diff --git a/docs/LangRef.html b/docs/LangRef.html
index f15f139aeb..1c31e45336 100644
--- a/docs/LangRef.html
+++ b/docs/LangRef.html
@@ -2625,8 +2625,8 @@ call void asm alignstack "eieio", ""()
<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
+ attached to it that contains a list of constant integers. 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 correlate backend errors that occur with inline asm back to the
source code that produced it. For example:</p>
@@ -2638,7 +2638,8 @@ call void asm sideeffect "something bad", ""()<b>, !srcloc !42</b>
</pre>
<p>It is up to the front-end to make sense of the magic numbers it places in the
- IR.</p>
+ IR. If the MDNode contains multiple constants, the code generator will use
+ the one that corresponds to the line of the asm that the error occurs on.</p>
</div>