If I understand the clang code correctly (I'm still learning, so be careful), I think that the starting point for this type of add would be in Parser :: ParseObjCAtExpression inside clang / lib / Parse / ParseObjc.cpp.
It should be noted that the Parser class is implemented in several files (apparently separated by the input language), but is fully declared in clang / include / Parser.h.
The parser has many methods following the ParseObjCAt pattern, for example, ParseObjCAtExpression ParseObjCAtStatement ParseObjCAtDirectives, etc ..
In particular, the string 1779 ParseObjc.cpp looks like the parser detects the Objective-C string literal in the form @ "foo". However, it also calls ParsePostfixExpressionSuffix, which I still don't quite understand. I did not understand how it understands a string literal (e.g. @synchronize).
ExprResult Parser::ParseObjCAtExpression(SourceLocation AtLoc) { ... return ParsePostfixExpressionSuffix(ParseObjCStringLiteral(AtLoc)); ... }
If you havenβt already done so, visit the clang Getting Started page to get started with compilation.
Josh rosen
source share