[llvm] [memprof] Use "using namespace ::llvm::memprof;" in a unit test (PR #119144)
Snehasish Kumar via llvm-commits
llvm-commits at lists.llvm.org
Sun Dec 8 12:35:38 PST 2024
================
@@ -30,29 +30,14 @@ using ::llvm::DILineInfo;
using ::llvm::DILineInfoSpecifier;
using ::llvm::DILocal;
using ::llvm::StringRef;
-using ::llvm::memprof::CallStackId;
-using ::llvm::memprof::CallStackMap;
-using ::llvm::memprof::Frame;
-using ::llvm::memprof::FrameId;
-using ::llvm::memprof::hashCallStack;
-using ::llvm::memprof::IndexedAllocationInfo;
-using ::llvm::memprof::IndexedMemProfData;
-using ::llvm::memprof::IndexedMemProfRecord;
-using ::llvm::memprof::MemInfoBlock;
-using ::llvm::memprof::MemProfReader;
-using ::llvm::memprof::MemProfRecord;
-using ::llvm::memprof::MemProfSchema;
-using ::llvm::memprof::Meta;
-using ::llvm::memprof::PortableMemInfoBlock;
-using ::llvm::memprof::RawMemProfReader;
-using ::llvm::memprof::SegmentEntry;
using ::llvm::object::SectionedAddress;
using ::llvm::symbolize::SymbolizableModule;
using ::testing::ElementsAre;
using ::testing::Pair;
using ::testing::Return;
using ::testing::SizeIs;
using ::testing::UnorderedElementsAre;
+using namespace ::llvm::memprof;
----------------
snehasish wrote:
Prefer adding a namespace to this test (and an inner anonymous one):
```
namespace llvm {
namespace memprof {
namespace {
...
```
Pros and cons discussed in this thread: https://groups.google.com/a/chromium.org/g/chromium-dev/c/pKY2G4GHcu0?e=48417069
Though it isn't required by the LLVM style guide so up to you if you want to keep as is.
https://github.com/llvm/llvm-project/pull/119144
More information about the llvm-commits
mailing list