Print AST in ObjC

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Print AST in ObjC

Renato Golin via cfe-dev
Hello,

I want to be able to print the AST of a .m file (Objective-C) i tried with

 clang -fmodules -F/System/Library/Frameworks -Xclang -ast-dump -fsyntax-only MandatoryViewController.m

This file is part of a xcode file, so it has some dependencies.

Do any of you know what i need to do? so this can work?

Thanks in advance.

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Print AST in ObjC

Renato Golin via cfe-dev
Sorry, i forgot to tell that clang show this error after run the command that i posted in the previous message:

MandatoryViewController.m:1:9: fatal error: module 'UIKit' not found
@import UIKit;

Thanks!

El mar., 1 oct. 2019 a las 9:15, Alberto Lagos (<[hidden email]>) escribió:
Hello,

I want to be able to print the AST of a .m file (Objective-C) i tried with

 clang -fmodules -F/System/Library/Frameworks -Xclang -ast-dump -fsyntax-only MandatoryViewController.m

This file is part of a xcode file, so it has some dependencies.

Do any of you know what i need to do? so this can work?

Thanks in advance.

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Print AST in ObjC

Renato Golin via cfe-dev
The framework search you are using is for macOS frameworks, if you want to dump ast for iOS related code, then you need to point it to the iOS SDK frameworks.
Try to look at xcrun command for some hints on how to get the right path.

I hope it helps.

Cheers,
Alex.

On Tue 1. Oct 2019 at 15:24, Alberto Lagos via cfe-dev <[hidden email]> wrote:
Sorry, i forgot to tell that clang show this error after run the command that i posted in the previous message:

MandatoryViewController.m:1:9: fatal error: module 'UIKit' not found
@import UIKit;

Thanks!

El mar., 1 oct. 2019 a las 9:15, Alberto Lagos (<[hidden email]>) escribió:
Hello,

I want to be able to print the AST of a .m file (Objective-C) i tried with

 clang -fmodules -F/System/Library/Frameworks -Xclang -ast-dump -fsyntax-only MandatoryViewController.m

This file is part of a xcode file, so it has some dependencies.

Do any of you know what i need to do? so this can work?

Thanks in advance.
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Print AST in ObjC

Renato Golin via cfe-dev
Thanks Alex, that was indeed the problem.



El mié., 2 oct. 2019 a las 15:40, Alex Denisov (<[hidden email]>) escribió:
The framework search you are using is for macOS frameworks, if you want to dump ast for iOS related code, then you need to point it to the iOS SDK frameworks.
Try to look at xcrun command for some hints on how to get the right path.

I hope it helps.

Cheers,
Alex.

On Tue 1. Oct 2019 at 15:24, Alberto Lagos via cfe-dev <[hidden email]> wrote:
Sorry, i forgot to tell that clang show this error after run the command that i posted in the previous message:

MandatoryViewController.m:1:9: fatal error: module 'UIKit' not found
@import UIKit;

Thanks!

El mar., 1 oct. 2019 a las 9:15, Alberto Lagos (<[hidden email]>) escribió:
Hello,

I want to be able to print the AST of a .m file (Objective-C) i tried with

 clang -fmodules -F/System/Library/Frameworks -Xclang -ast-dump -fsyntax-only MandatoryViewController.m

This file is part of a xcode file, so it has some dependencies.

Do any of you know what i need to do? so this can work?

Thanks in advance.
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev