[PATCH] D30854: [ASTMatchers] Add ObjC matchers for fundamental decls

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 12 06:35:41 PDT 2017


aaron.ballman added inline comments.


================
Comment at: unittests/ASTMatchers/ASTMatchersNodeTest.cpp:1501
 
-  std::string Objc1String =
+  std::string ObjCString =
+    "#pragma clang diagnostic ignored \"-Wobjc-root-class\"\n"
----------------
These changes are unrelated and should be in a separate commit.


================
Comment at: unittests/ASTMatchers/ASTMatchersNodeTest.cpp:1547
+  std::string ObjCString =
+    "#pragma clang diagnostic ignored \"-Wobjc-root-class\"\n"
+    "@protocol Proto "
----------------
Instead of using a pragma for this, I think it would make more sense to just modify `matchesObjC()` to disable the diagnostic. This is only intended to test the dynamic AST matchers, so the diagnostics are not useful in that case anyway.


================
Comment at: unittests/ASTMatchers/ASTMatchersTest.h:123
     Code, AMatcher, true,
-    "", FileContentMappings(), "input.m");
+    "-fobjc-runtime=macosx", FileContentMappings(), "input.m");
 }
----------------
Can you explain why this change is required?


https://reviews.llvm.org/D30854





More information about the cfe-commits mailing list