GCC :

2017-02-18  本文已影响29人  FlyTheKite

Last login: Sat Feb 18 12:05:46 on console
dengjiangzhoudeiMac:~ dengjiangzhou$ ls

Applications        Music           paros
Desktop         Pictures        point.sil
Documents       Public          point点sil.docx
Downloads       hi          百度云同步盘
Library         iOS-Images-Extractor
Movies          module3

dengjiangzhoudeiMac:~ dengjiangzhou$ cd ~/Desktop
dengjiangzhoudeiMac:Desktop dengjiangzhou$ touch main.m
dengjiangzhoudeiMac:Desktop dengjiangzhou$ open main.m
dengjiangzhoudeiMac:Desktop dengjiangzhou$ clang -fmodules main.m -o mainDeng
dengjiangzhoudeiMac:Desktop dengjiangzhou$ clang -fmodules -fsyntax-only -Xclang -ast-dump main.m

TranslationUnitDecl 0x7ff53b8058d0 <<invalid sloc>> <invalid sloc>
|-TypedefDecl 0x7ff53b805dc8 <<invalid sloc>> <invalid sloc> implicit __int128_t '__int128'
| `-BuiltinType 0x7ff53b805b20 '__int128'
|-TypedefDecl 0x7ff53b805e28 <<invalid sloc>> <invalid sloc> implicit __uint128_t 'unsigned __int128'
| `-BuiltinType 0x7ff53b805b40 'unsigned __int128'
|-TypedefDecl 0x7ff53b805eb8 <<invalid sloc>> <invalid sloc> implicit SEL 'SEL *'
| `-PointerType 0x7ff53b805e80 'SEL *'
|   `-BuiltinType 0x7ff53b805d30 'SEL'
|-TypedefDecl 0x7ff53b805f98 <<invalid sloc>> <invalid sloc> implicit id 'id'
| `-ObjCObjectPointerType 0x7ff53b805f40 'id' imported
|   `-ObjCObjectType 0x7ff53b805f10 'id' imported
|-TypedefDecl 0x7ff53b806078 <<invalid sloc>> <invalid sloc> implicit Class 'Class'
| `-ObjCObjectPointerType 0x7ff53b806020 'Class'
|   `-ObjCObjectType 0x7ff53b805ff0 'Class'
|-ObjCInterfaceDecl 0x7ff53b8060c8 <<invalid sloc>> <invalid sloc> implicit Protocol
|-TypedefDecl 0x7ff53b806418 <<invalid sloc>> <invalid sloc> implicit __NSConstantString 'struct __NSConstantString_tag'
| `-RecordType 0x7ff53b806230 'struct __NSConstantString_tag'
|   `-Record 0x7ff53b806190 '__NSConstantString_tag'
|-TypedefDecl 0x7ff53b8064a8 <<invalid sloc>> <invalid sloc> implicit __builtin_ms_va_list 'char *'
| `-PointerType 0x7ff53b806470 'char *'
|   `-BuiltinType 0x7ff53b805960 'char'
|-TypedefDecl 0x7ff53b834d78 <<invalid sloc>> <invalid sloc> implicit __builtin_va_list 'struct __va_list_tag [1]'
| `-ConstantArrayType 0x7ff53b834d20 'struct __va_list_tag [1]' 1 
|   `-RecordType 0x7ff53b8065a0 'struct __va_list_tag'
|     `-Record 0x7ff53b8064f8 '__va_list_tag'
|-ImportDecl 0x7ff53b835ab0 <main.m:1:1> col:1 implicit Foundation
|-FunctionDecl 0x7ff53b835b38 <line:3:1, line:7:1> line:3:5 main 'int ()'
| `-CompoundStmt 0x7ff53b2e9150 <col:11, line:7:1>
|   |-CallExpr 0x7ff53b2e90d0 <line:4:5, col:25> 'void'
|   | |-ImplicitCastExpr 0x7ff53b2e90b8 <col:5> 'void (*)(id, ...)' <FunctionToPointerDecay>
|   | | `-DeclRefExpr 0x7ff53b2e8fa0 <col:5> 'void (id, ...)' Function 0x7ff53b2dbe60 'NSLog' 'void (id, ...)'
|   | `-ImplicitCastExpr 0x7ff53b2e9100 <col:11, col:12> 'id':'id' <BitCast>
|   |   `-ObjCStringLiteral 0x7ff53b2e9040 <col:11, col:12> 'NSString *'
|   |     `-StringLiteral 0x7ff53b2e9008 <col:12> 'char [12]' lvalue "Hello world"
|   `-ReturnStmt 0x7ff53b2e9138 <line:5:5, col:12>
|     `-IntegerLiteral 0x7ff53b2e9118 <col:12> 'int' 0
`-<undeserialized declarations>

dengjiangzhoudeiMac:Desktop dengjiangzhou$ clang -S main.m -o main.s
dengjiangzhoudeiMac:Desktop dengjiangzhou$ vi main.s
dengjiangzhoudeiMac:Desktop dengjiangzhou$

上一篇下一篇

猜你喜欢

热点阅读