appleseedlab / maki

A tool for analyzing syntactic and semantic properties of C Preprocessor macros in C programs
8 stars 3 forks source link

Ignore system headers, compiler builtins, and macros at invalid locations #29

Closed PappasBrent closed 2 months ago

PappasBrent commented 3 months ago

Add command line arguments to ignore macros defined or invoked in system headers, compiler builtin macros, and macros defined or invocation at invalid source locations.

Moves the function tryGetFullSourceLoc() to its own file (SourceLocationUtils.hh) so that other parts of the Maki codebase can use it.

Closes #28.

PappasBrent commented 3 months ago

I'm a little surprised about that null pointer error - the MacroInfo * that triggered it was a member of a MacroDefinition object that Clang provided in one of its callbacks I was hooking into. I just assumed the MacroDefinition's MacroInfo * member wouldn't be null; well I learned something new today about Clang :)