[PATCH] D54683: [WebAssembly] Delete unused using statements (NFC)

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 20 07:28:48 PST 2018


sbc100 accepted this revision.
sbc100 added a subscriber: ruiu.
sbc100 added a comment.
This revision is now accepted and ready to land.

In https://reviews.llvm.org/D54683#1303746, @dschuff wrote:

> LLVM doesn't actually have an IWYU guideline though: https://llvm.org/docs/CodingStandards.html#include-as-little-as-possible ... but also not a "dont IWYU".
>
> Also this general problem is why Chrome has a rule against `using namespace` in header files. I like that rule because you can always tell by looking in the cpp file which namespaces are in scope.
>  If we do the same, then `using` directive in a cpp file can be removed if the file still compiles after removing it because we know it's not coming from somewhere else.
>
> Also even if we adopt that convention for the wasm backend we might have to make an exception for `using namespace llvm` because it's so ubiquitous.


Yes, I seem to remember @ruiu saying that was the policy for lld too.   Lets try to remove all the using statements from the .h files.   It seems the ELF/*.h already avoids doing this.  COFF and wasm should probably follow suite.

This change to remove actually unused statements lgtm though in any case.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D54683





More information about the llvm-commits mailing list