[PATCH] D92788: [clangd] NFC: Use SmallVector<T> where possible

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 16 18:44:26 PST 2020


arphaman added inline comments.


================
Comment at: clang-tools-extra/clangd/Headers.h:139
   // Maps a file's index to that of the files it includes.
-  llvm::DenseMap<unsigned, SmallVector<unsigned, 8>> IncludeChildren;
+  llvm::DenseMap<unsigned, SmallVector<unsigned>> IncludeChildren;
 };
----------------
sammccall wrote:
> kbobyrev wrote:
> > arphaman wrote:
> > > It looks like the change on this line is failing to compile on Ubuntu 16.04 with the System GCC. (https://ci.swift.org/job/oss-swift-incremental-RA-linux-ubuntu-16_04-next/23655/console).
> > > 
> > > Can I reinstate the `llvm::DenseMap<unsigned, SmallVector<unsigned, 8>>` for now until we drop support for Ubuntu 16.04?
> > Uh, didn't see that one, I'm sorry to hear that. Yes, sure, feel free to change it to make your setup work!
> From the error message, it looks like the declarations of clang::SmallVector in LLVM.h are missing the default template arguments (not sure why this is different in the swift CI).
> 
> Does changing to qualifying as llvm::SmallVector work here, rather than adding the explicit size? (We usually do this anyway as a matter of style)
It looks like the GCC there might have a bug and is picking up the `template<typename T, unsigned N> class SmallVector;` in `clang/include/clang/Basic/LLVM.h` without taking the declaration from the LLVM headers into account. I'm not quite sure why it does that, but it seems to be fixed in GCC included in Ubuntu 18.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92788



More information about the cfe-commits mailing list