[cfe-dev] clang unable to build example C file

Török Edvin edwintorok at gmail.com
Thu Oct 11 13:51:28 PDT 2007


On 10/11/07, Török Edvin <edwintorok at gmail.com> wrote:
>
> I get all zeros, which is not what I expected.
> Where is Len set? I could try to add some printfs there...

I also tried a short gdb debug session, and it looks like it doesn't
recognize define as a keyword.
That shouldn't happen, right? Is there some utility method to dump the
identifier table?

Please tell me if I can do anything further to help.

#4  0x000000000066c66b in clang::Lexer::LexIdentifier (this=0xaa3030,
Result=@0x7fff49d128a8, CurPtr=0xaa2547 " __STDC__ 1\n#define
__STDC_VERSION_
_ 199901L\n#define __STDC_HOSTED__ 1\ntypedef int
__builtin_va_list;\n#define __APPLE__ 1\n#define __MACH__ 1\n#define
__weak \n#define __strong \n
#define __CONSTANT_CFSTRI"...) at Lexer.cpp:449
(gdb) print Result
$22 = (clang::Token &) @0x7fff49d128a8: {Loc = {ID = 262145}, Length =
6, IdentInfo = 0x0, Kind = clang::tok::identifier, Flags = 0}
(gdb) down
...
#0  llvm::StringMap<clang::IdentifierInfo,
llvm::BumpPtrAllocator>::GetOrCreateValue (this=0x7fff49d12ea0,
KeyStart=0xaa2541 "define __STDC__ 1\n#d
efine __STDC_VERSION__ 199901L\n#define __STDC_HOSTED__ 1\ntypedef int
__builtin_va_list;\n#define __APPLE__ 1\n#define __MACH__ 1\n#define
__weak
\n#define __strong \n#define __CONSTANT_"..., KeyEnd=0xaa2547 "
__STDC__ 1\n#define __STDC_VERSION__ 199901L\n#define __STDC_HOSTED__
1\ntypedef in
t __builtin_va_list;\n#define __APPLE__ 1\n#define __MACH__ 1\n#define
__weak \n#define __strong \n#define __CONSTANT_CFSTRI"...) at
/home/edwin/ll
vm-svn/llvm/include/llvm/ADT/StringMap.h:273


(gdb) print *Result.IdentInfo
$24 = {TokenID = clang::tok::identifier, BuiltinID = 0, ObjCID =
clang::tok::objc_not_keyword, HasMacro = false, IsExtension = false,
IsPoisoned =
false, IsOtherTargetMacro = false, IsCPPOperatorKeyword = false,
IsNonPortableBuiltin = false, FETokenInfo = 0x0}

--Edwin




More information about the cfe-dev mailing list