[cfe-dev] ast-dump issue...

Fariborz Jahanian fjahanian at apple.com
Mon Oct 5 14:44:44 PDT 2009


We haven't kept up with -ast-dump (or -ast-print).
Patches are welcome; or go ahead and file a bug report.

- Fariborz

On Oct 5, 2009, at 2:38 PM, Fons Rademakers wrote:

> Hi,
>
> using clang from the trunk of today, I get when doing:
>
> clang-cc ll.cxx -ast-dump
>
> an assertion failure in DeclPrinter.cpp:
>
> typedef __int128_t __int128_t;
> typedef __uint128_t __uint128_t;
> struct __va_list_tag {
> public:
>    struct __va_list_tag;
>    unsigned int gp_offset;
>    unsigned int fp_offset;
>    void *overflow_arg_area;
>    void *reg_save_area;
>    inline __va_list_tag();
>    inline __va_list_tag(struct __va_list_tag const &);
>    inline struct __va_list_tag &operator=(struct __va_list_tag const  
> &);
>    inline ~__va_list_tag();
> };
> typedef struct __va_list_tag __va_list_tag;
> typedef __va_list_tag __builtin_va_list[1];
> typedef signed char __int8_t;
> typedef unsigned char __uint8_t;
> typedef short __int16_t;
> typedef unsigned short __uint16_t;
> typedef int __int32_t;
> typedef unsigned int __uint32_t;
> typedef long long __int64_t;
> typedef unsigned long long __uint64_t;
> typedef long __darwin_intptr_t;
> typedef unsigned int __darwin_natural_t;
> typedef int __darwin_ct_rune_t;
> Assertion failed: (0 && "Unknown declarator!"), function  
> GetBaseType, file /Users/rdm/llvm/src/tools/clang/lib/AST/ 
> DeclPrinter.cpp, line 105.
> 0   clang-cc          0x0000000100ccfee7 PrintStackTrace(void*) + 38
> 1   clang-cc          0x0000000100cd0475 SignalHandler(int) + 336
> 2   libSystem.B.dylib 0x00007fff882480aa _sigtramp + 26
> 3   libSystem.B.dylib 0x00007fff881ecb2a tiny_malloc_from_free_list  
> + 1196
> 4   libSystem.B.dylib 0x00007fff882c40b4 __pthread_markcancel + 0
> 5   clang-cc          0x00000001003f888f  
> GetBaseType(clang::QualType) + 240
> 6   clang-cc          0x00000001003f8d08 (anonymous  
> namespace)::DeclPrinter::VisitDeclContext(clang::DeclContext*, bool)  
> + 580
> 7   clang-cc          0x00000001003f9cdd (anonymous  
> namespace 
> )::DeclPrinter 
> ::VisitTranslationUnitDecl(clang::TranslationUnitDecl*) + 63
> 8   clang-cc          0x00000001003f9e24  
> clang::DeclVisitor<(anonymous namespace)::DeclPrinter,  
> void>::Visit(clang::Decl*) + 324
> 9   clang-cc          0x00000001003f88f9  
> clang::Decl::print(llvm::raw_ostream&, clang::PrintingPolicy const&,  
> unsigned int) const + 71
> 10  clang-cc          0x0000000100039b6e (anonymous  
> namespace)::ASTPrinter::HandleTranslationUnit(clang::ASTContext&) +  
> 118
> 11  clang-cc          0x00000001002847e0  
> clang::ParseAST(clang::Preprocessor&, clang::ASTConsumer*,  
> clang::ASTContext&, bool, bool, clang::CodeCompleteConsumer* (*) 
> (clang::Sema&, void*), void*) + 760
> 12  clang-cc          0x000000010002ba21  
> ProcessInputFile(clang::Preprocessor&, clang::PreprocessorFactory&,  
> std::string const&, ProgActions, llvm::StringMap<bool,  
> llvm::MallocAllocator> const&, llvm::LLVMContext&) + 3664
> 13  clang-cc          0x000000010002d137 main + 3269
> 14  clang-cc          0x00000001000270dc start + 52
> Stack dump:
> 0.      Program arguments: /Users/rdm/llvm/inst/libexec/clang-cc  
> ll.cxx -ast-dump
> 1.      <eof> parser at end of file
> Abort trap
>
> Do I miss some specific additional command line options or is this a  
> real issue?
>
> The ll.cxx file is attached.
>
> Cheers, Fons.
>
>
> -- 
> Org:    CERN, European Laboratory for Particle Physics.
> Mail:   1211 Geneve 23, Switzerland
> E-Mail: Fons.Rademakers at cern.ch              Phone: +41 22 7679248
> WWW:    http://fons.rademakers.org           Fax:   +41 22 7669640
> #include <stdio.h>
>
> int main()
> {
>   int err = 0;
>   long l;
>   long long i, j, k;
>
>   k = 7294967295LL;
>   i = 9223372036854775807LL;
>   j = i;
>
>   printf("sizeof(int) = %lu\n", sizeof(err));
>
>   return 0;
> }
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list