[PATCH] D119479: [clang][extract-api] Add global record support

Daniel Grumberg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 16 04:03:43 PDT 2022


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

Looks mostly good now.



================
Comment at: clang/include/clang/SymbolGraph/API.h:99
+
+  GlobalRecord *addGlobal(GVKind Kind, StringRef Name, SmallString<128> &USR,
+                          PresumedLoc Loc, const AvailabilityInfo &Availability,
----------------
This is somewhat counter-intuitive but to decouple this from the small size template parameter you should pass in `SmallVectorImpl<char>`. Later when you need to construct a StringRef from it to pass it to copy you can do it by doing `StringRef(USR.data(), USR.size())`. Also probably worth making it a const reference just to indicate to clients it doesn't get modified in the process.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119479



More information about the cfe-commits mailing list