[PATCH] D83296: [clang-format] Add a MacroExpander.

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 13 06:06:26 PDT 2020


MyDeveloperDay added inline comments.


================
Comment at: clang/lib/Format/MacroExpander.cpp:150
+    Tok->MacroCtx.ExpandedFrom.push_back(ID);
+    if (First) {
+      Tok->MacroCtx.StartOfExpansion = true;
----------------
elide braces?


================
Comment at: clang/unittests/Format/MacroExpanderTest.cpp:5
+
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
----------------
are you using this?


================
Comment at: clang/unittests/Format/MacroExpanderTest.cpp:55
+              .str();
+      EXPECT_TRUE(Tokens[I]->is(Attributes[I].Kind))
+          << Context << " in " << text(Tokens);
----------------
when these assertions fail you have no idea which of the various calls is actually failing how about passing in __FILE__,__LINE__ then adding that to the output


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83296/new/

https://reviews.llvm.org/D83296





More information about the cfe-commits mailing list