Quantcast

ast-dump option in clang-cc not working?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

ast-dump option in clang-cc not working?

Rahul Garg-2
Hi.
I am trying to understand clang and was trying to do clang-cc hello.c -ast-dump. clang and llvm was built from LLVM 2.6 release and am on Ubuntu 9.04 64-bit. Any ideas what may be the problem?
I get the follwing output indicating error:

typedef __int128_t __int128_t;
typedef __uint128_t __uint128_t;
struct __va_list_tag {
    unsigned int gp_offset;
    unsigned int fp_offset;
    void *overflow_arg_area;
    void *reg_save_area;
};
typedef struct __va_list_tag __va_list_tag;
typedef __va_list_tag __builtin_va_list[1];
0   clang-cc        0x0000000000efa8ff
1   clang-cc        0x0000000000efc611
2   libpthread.so.0 0x00007f58094a1080
3   clang-cc        0x000000000079a6e0
4   clang-cc        0x00000000007a8fc4
5   clang-cc        0x00000000007a50db
6   clang-cc        0x0000000000763f96
7   clang-cc        0x000000000076510c
8   clang-cc        0x0000000000763e98
9   clang-cc        0x0000000000764b6b
10  clang-cc        0x000000000043891d
11  clang-cc        0x00000000006402fb
12  clang-cc        0x0000000000427ff9
13  clang-cc        0x0000000000430f1a main + 4906
14  libc.so.6       0x00007f58087905a6 __libc_start_main + 230
15  clang-cc        0x0000000000425b09
Stack dump:
0.    Program arguments: clang-cc -ast-dump hello.c
1.    <eof> parser at end of file
Segmentation fault
typedef __int128_t __int128_t;
typedef __uint128_t __uint128_t;
struct __va_list_tag {
    unsigned int gp_offset;
    unsigned int fp_offset;
    void *overflow_arg_area;
    void *reg_save_area;
};
typedef struct __va_list_tag __va_list_tag;
typedef __va_list_tag __builtin_va_list[1];
0   clang-cc        0x0000000000efa8ff
1   clang-cc        0x0000000000efc611
2   libpthread.so.0 0x00007f58094a1080
3   clang-cc        0x000000000079a6e0
4   clang-cc        0x00000000007a8fc4
5   clang-cc        0x00000000007a50db
6   clang-cc        0x0000000000763f96
7   clang-cc        0x000000000076510c
8   clang-cc        0x0000000000763e98
9   clang-cc        0x0000000000764b6b
10  clang-cc        0x000000000043891d
11  clang-cc        0x00000000006402fb
12  clang-cc        0x0000000000427ff9
13  clang-cc        0x0000000000430f1a main + 4906
14  libc.so.6       0x00007f58087905a6 __libc_start_main + 230
15  clang-cc        0x0000000000425b09
Stack dump:
0.    Program arguments: clang-cc -ast-dump hello.c
1.    <eof> parser at end of file
Segmentation fault



_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ast-dump option in clang-cc not working?

jahanian
We generally have not kept up-to-date with -ast-dump.
But a simple hello.c seems to work for me:

% cat hello.c
#include <stdio.h>

int main() {
        printf("HELLO");
}

$clang -cc1 -ast-dump hello.c


typedef __int128_t __int128_t;
typedef __uint128_t __uint128_t;
struct __va_list_tag {
     unsigned int gp_offset;
     unsigned int fp_offset;
     void *overflow_arg_area;
     void *reg_save_area;
};
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;

...


- Fariborz





On Dec 21, 2009, at 2:41 PM, Rahul Garg wrote:

> Hi.
> I am trying to understand clang and was trying to do clang-cc  
> hello.c -ast-dump. clang and llvm was built from LLVM 2.6 release  
> and am on Ubuntu 9.04 64-bit. Any ideas what may be the problem?
> I get the follwing output indicating error:
>
> typedef __int128_t __int128_t;
> typedef __uint128_t __uint128_t;
> struct __va_list_tag {
>     unsigned int gp_offset;
>     unsigned int fp_offset;
>     void *overflow_arg_area;
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Loading...