[PATCH] D54758: [WebAssembly] Remove `using` statements from header files. NFC.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 26 09:52:05 PST 2018


ruiu added a comment.

In D54758#1307205 <https://reviews.llvm.org/D54758#1307205>, @kristina wrote:

> I think some redundant includes should definitely go (IWYU). Regarding more granular `using` declarations, honestly it's up to @ruiu, Clang and LLDB handle it by aliasing some of LLVM's common classes in their respective namespaces, maybe that could work for LLD too? In fact I'm guessing that's the purpose of `lld/Common/LLVM.h`, you could take a similar approach for Wasm specific stuff and limit the using statements to your namespace.


Your guess is correct; `lld/Common/LLVM.h` is to `using` some identifiers so that they can be referred without namespace specifiers. In fact, I think it is fine to add Wasm* names to that file because it is obvious that they will never conflict with other names because of `Wasm` prefix. Some names are ambiguous, such as llvm::object::Archive, and it is better to refer them using a fully qualified name, as we have other classes with confusing names (e.g. lld::*::ArchiveFile).


Repository:
  rLLD LLVM Linker

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

https://reviews.llvm.org/D54758





More information about the llvm-commits mailing list