[PATCH] D51675: [Sema] Store MacroInfo in CodeCompletionResult for macro results.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 5 06:43:02 PDT 2018


sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.


================
Comment at: include/clang/Sema/CodeCompleteConsumer.h:847
 
+  /// If the result is RK_Macro, this can store the information about the macro
+  /// definition.
----------------
Let's not make this maybe/optional: `If the result is RK_Macro, information about the macro definition.`
There's only one relevant constructor, with only 3 callsites (the two you have, and one in clangd), so we can fix them all.

One of them statically appears like it could be null sometimes, but dynamically should never be null for macros triggering code complete I think (we may want to add an assert).


================
Comment at: include/clang/Sema/CodeCompleteConsumer.h:875
   CodeCompletionResult(const IdentifierInfo *Macro,
+                       const MacroInfo *MI = nullptr,
                        unsigned Priority = CCP_Macro)
----------------
(so I'd drop the default argument here)


Repository:
  rC Clang

https://reviews.llvm.org/D51675





More information about the cfe-commits mailing list