I am using the Clang::Tooling library to parse some header files. I can't seem to parse properly due to clang not pre-processing header files and other pre-processor stuff. How can I tell Clang::Tooling to pre-process files before parsing. Cheers. This is my current code for invoking my tool.
/*static*/ SAST SAST::Parse( CFile& HeaderFile, const TArray<CString>& CommandLineArgs )
{
//Our Custom Formated Ast Data Struct
SAST AST;
//Parse Command-Line Args.
clang::tooling::CommandLineArguments CommandArgs;
for (auto& Item : CommandLineArgs)
CommandArgs.push_back(Item.GetRaw());
//Traverse And Collect AST
auto SourceText = HeaderFile.GetText();
auto SourceFileName = HeaderFile.GetFullName();
clang::tooling::runToolOnCodeWithArgs(new CollectASTAction(&AST), SourceText.GetRawConst(), CommandArgs);
return AST;
}