[LLVMbugs] [Bug 7721] New: -ast-print-xml Produces Invalid XML
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Tue Jul 27 06:01:18 PDT 2010
http://llvm.org/bugs/show_bug.cgi?id=7721
Summary: -ast-print-xml Produces Invalid XML
Product: clang
Version: 2.7
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: chobbs at qnx.com
CC: llvmbugs at cs.uiuc.edu
I am using:
clang version 1.1 (branches/release_27)
Target: i386-pc-linux-gnu
Thread model: posix
clang+llvm-2.7-i686-linux
When executing the command
clang -cc1 -ast-print-xml foo.c
on a file containing the following construction:
if (paddr + n > UINTPTR_MAX) {
return -EOVERFLOW;
}
the following XML is produced. I am no XML expert but all (except one) of the
parsers I have used to read it have taken a bath on the less-than sign in
endfile="<scratch space>", reporting it to be illegal. Changing it manually to
< and the corresponding > to > makes it all OK.
I have another issue of wondering what endfile="<scratch space>" is doing there
but I think the syntax problem needs to be sorted out before the semantic one.
===========XML follows
<IfStmt file="f42" line="158" col="4" endline="160" endcol="4">
<BinaryOperator file="f42" line="158" col="7" endfile="<scratch space>"
endline="118" endcol="1" type="_18" kind="gt">
<BinaryOperator file="f42" line="158" col="7" endcol="15" type="_C"
kind="add">
<DeclRefExpr file="f42" line="158" col="7" type="_1152" ref="_1D4C"
name="paddr"/>
<ImplicitCastExpr file="f42" line="158" col="15" type="_C">
<DeclRefExpr file="f42" line="158" col="15" type="_18" ref="_1D4F"
name="n"/>
</ImplicitCastExpr>
</BinaryOperator>
<ImplicitCastExpr file="f1C" line="118" col="1" type="_C">
<IntegerLiteral file="f1C" line="118" col="1" type="_2AA" value="-1"/>
</ImplicitCastExpr>
</BinaryOperator>
<CompoundStmt file="f42" line="158" col="32" endline="160" endcol="4"
num_stmts="1">
<ReturnStmt file="f42" line="159" col="5"
endfile="/home/chobbs/sil3/stagingArea/trunk/usr/include/errno.h" endline="137"
endcol="25">
<UnaryOperator file="f42" line="159" col="12"
endfile="/home/chobbs/sil3/stagingArea/trunk/usr/include/errno.h" endline="137"
endcol="25" type="_18" kind="minus">
<IntegerLiteral file="f1F" line="137" col="25" type="_18" value="79"/>
</UnaryOperator>
</ReturnStmt>
</CompoundStmt>
<NULL/>
</IfStmt>
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list