[PATCH] D46614: [clang] Adding CharacteristicKind to PPCallbacks::InclusionDirective

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 10 11:22:34 PDT 2018


aaron.ballman added inline comments.


================
Comment at: unittests/Lex/PPCallbacksTest.cpp:155-160
+    std::unique_ptr<Preprocessor> PP = llvm::make_unique<Preprocessor>(
+        std::make_shared<PreprocessorOptions>(), Diags, LangOpts, SourceMgr,
+        PCMCache, HeaderInfo, ModLoader,
+        /*IILookup =*/nullptr,
+        /*OwnsHeaderSearch =*/false);
+    return InclusionDirectiveCallback(PP.get())->FilenameRange;
----------------
I'm likely just missing something, but why is the `unique_ptr` required at all? The `Preprocessor` object will be destroyed on exit from this function, so it seems like it could be an automatic variable that's passed by reference to `InclusionDirectiveCallback()`, and same below.


https://reviews.llvm.org/D46614





More information about the cfe-commits mailing list