[PATCH] D123926: [clang] Add a raw_ostream operator<< overload for QualType

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 19 10:50:33 PDT 2022


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

Thanks for this! LGTM with some small nits.



================
Comment at: clang/include/clang/AST/Type.h:1319
 
+llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const clang::QualType &QT);
+
----------------
Cleaning up the declaration a bit, but the important change is not making `QT` a const ref (the type is small and meant to be passed by value cheaply).


================
Comment at: clang/lib/AST/TypePrinter.cpp:2313
+                                     const clang::QualType &QT) {
+  auto S = QT.split();
+  TypePrinter(LangOptions()).print(S.Ty, S.Quals, OS, "");
----------------
Please spell out the type.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123926



More information about the cfe-commits mailing list