[LLVMbugs] [Bug 13681] New: cc1 expanding builtin macros when processing cpp output

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Aug 23 13:36:15 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=13681

             Bug #: 13681
           Summary: cc1 expanding builtin macros when processing cpp
                    output
           Product: clang
           Version: trunk
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: brooks at freebsd.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 9103
  --> http://llvm.org/bugs/attachment.cgi?id=9103
reduced reproduction case

When trying to compile clang with clang with a target of
mips64-unknown-freebsd10.0 the mips macro is incorrectly expanded when
processing AnalysisDeclContext.ii.  Since the "#undef mips" in
include/llvm/ADT/Triple.h has already been removed by the previous pass this
results in a parse error similar to the following:

$ /usr/local/bin/clang -cc1 -triple mips64-unknown-freebsd10.0 -S  -v -o foo.s
-x c++-cpp-output foo.ii
clang -cc1 version 3.2 based upon LLVM 3.2svn default target
amd64-portbld-freebsd9.0
ignoring duplicate directory "/usr/include/c++/4.2"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/4.2
 /usr/include/c++/4.2/backward
 /usr/local/lib/clang/3.2/include
 /usr/include
End of search list.
foo.ii:4:5: error: expected '}'
    mips,
    ^
<built-in>:129:14: note: expanded from macro 'mips'
#define mips 1
             ^
foo.ii:3:17: note: to match this '{'
  enum ArchType {
                ^
foo.ii:8:1: error: extraneous closing brace ('}')
}
^
2 errors generated.


Note: I have no idea why AnalysisDeclContext.cpp triggers this but dozens of
other files with dependencies on Triple.h don't.

-- 
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