[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


           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


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"
   <DeclRefExpr file="f42" line="158" col="7" type="_1152" ref="_1D4C"
    <ImplicitCastExpr file="f42" line="158" col="15" type="_C">
     <DeclRefExpr file="f42" line="158" col="15" type="_18" ref="_1D4F"
  <ImplicitCastExpr file="f1C" line="118" col="1" type="_C">
   <IntegerLiteral file="f1C" line="118" col="1" type="_2AA" value="-1"/>
 <CompoundStmt file="f42" line="158" col="32" endline="160" endcol="4"
  <ReturnStmt file="f42" line="159" col="5"
endfile="/home/chobbs/sil3/stagingArea/trunk/usr/include/errno.h" endline="137"
  <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"/>

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