steakhal marked an inline comment as done.
steakhal added inline comments.
Comment at: clang/lib/Analysis/MacroExpansionContext.cpp:210
+}
\ No newline at end of file
martong wrote:
> Missing newline?
I honestly don't know why was that not addressed by clang-for
martong accepted this revision.
martong added a comment.
This revision is now accepted and ready to land.
Nice work! Thanks!
Comment at: clang/lib/Analysis/MacroExpansionContext.cpp:210
+}
\ No newline at end of file
Missing newline?
Comment
steakhal updated this revision to Diff 314857.
steakhal marked 11 inline comments as done.
steakhal added a comment.
- move `MacroExpansionRangeRecorder` to `clang::detail` and mark it as a friend
class
- fix comment typo in `getExpandedMacroForLocation`
- rename `getExpandedMacroForLocation` ->
xazax.hun added inline comments.
Comment at: clang/lib/Analysis/MacroExpansionContext.cpp:22
+: PP(PP), SM(PP.getSourceManager()), LangOpts(LangOpts) {
+ class MacroExpansionRangeRecorder : public PPCallbacks {
+const Preprocessor &PP;
whisperity wrote:
whisperity added inline comments.
Comment at: clang/lib/Analysis/MacroExpansionContext.cpp:22
+: PP(PP), SM(PP.getSourceManager()), LangOpts(LangOpts) {
+ class MacroExpansionRangeRecorder : public PPCallbacks {
+const Preprocessor &PP;
xazax.hun wrote:
xazax.hun added inline comments.
Comment at: clang/lib/Analysis/MacroExpansionContext.cpp:22
+: PP(PP), SM(PP.getSourceManager()), LangOpts(LangOpts) {
+ class MacroExpansionRangeRecorder : public PPCallbacks {
+const Preprocessor &PP;
steakhal wrote:
>
steakhal marked an inline comment as done.
steakhal added a comment.
I want to highlight, that the 4th part of the stack is not yet done.
Partially because I'm not quite familiar with CTU.
AFAIK, CTU creates compiler invocations, which are going to call Parse at some
point.
I'm not sure how to co
xazax.hun added a comment.
Overall looks good to me, I have some minor nits and questions inline.
Comment at: clang/lib/Analysis/MacroExpansionContext.cpp:22
+: PP(PP), SM(PP.getSourceManager()), LangOpts(LangOpts) {
+ class MacroExpansionRangeRecorder : public PPCallbacks
martong added inline comments.
Comment at: clang/include/clang/Analysis/MacroExpansionContext.h:82
+ MacroExpansionText
+ getExpandedMacroForLocation(SourceLocation MacroExpansionLoc) const;
+
`getExpandedText` ? Since what you get back is not a macro anymore.
martong added a comment.
Nice and precise work! And special thanks for the unit tests. I've found some
minor nits.
Comment at: clang/include/clang/Analysis/MacroExpansionContext.h:77
+ /// \param MacroExpansionLoc Must be the expansion location of a macro.
+ /// \return The
10 matches
Mail list logo