[PATCH] D152727: [SampleFDO] Remove 'using namespace' (NFC)
Muhammad Asif Manzoor via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 12 19:04:06 PDT 2023
Asif updated this revision to Diff 530748.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152727/new/
https://reviews.llvm.org/D152727
Files:
llvm/include/llvm/Support/Discriminator.h
Index: llvm/include/llvm/Support/Discriminator.h
===================================================================
--- llvm/include/llvm/Support/Discriminator.h
+++ llvm/include/llvm/Support/Discriminator.h
@@ -65,8 +65,6 @@
};
} // namespace sampleprof
-using namespace sampleprof;
-
// The number of bits reserved for the base discrimininator. The base
// discriminaitor starts from bit 0.
static const unsigned BaseDiscriminatorBitWidth = 8;
@@ -82,33 +80,36 @@
// + FSDiscriminatorBitWidth * getNumFSPasses()
// needs to fit in an unsigned int type.
static inline unsigned getNumFSPasses() {
- return static_cast<unsigned>(FSDiscriminatorPass::PassLast);
+ return static_cast<unsigned>(sampleprof::FSDiscriminatorPass::PassLast);
}
// Return the ending bit for FSPass P.
-static inline unsigned getFSPassBitEnd(FSDiscriminatorPass P) {
+static inline unsigned getFSPassBitEnd(sampleprof::FSDiscriminatorPass P) {
unsigned I = static_cast<unsigned>(P);
assert(I <= getNumFSPasses() && "Invalid FS discriminator pass number.");
return BaseDiscriminatorBitWidth + I * FSDiscriminatorBitWidth - 1;
}
// Return the begining bit for FSPass P.
-static inline unsigned getFSPassBitBegin(FSDiscriminatorPass P) {
- if (P == FSDiscriminatorPass::Base)
+static inline unsigned getFSPassBitBegin(sampleprof::FSDiscriminatorPass P) {
+ if (P == sampleprof::FSDiscriminatorPass::Base)
return 0;
unsigned I = static_cast<unsigned>(P);
assert(I <= getNumFSPasses() && "Invalid FS discriminator pass number.");
- return getFSPassBitEnd(static_cast<FSDiscriminatorPass>(I - 1)) + 1;
+ return getFSPassBitEnd(static_cast<sampleprof::FSDiscriminatorPass>(I - 1)) +
+ 1;
}
// Return the beginning bit for the last FSPass.
static inline int getLastFSPassBitBegin() {
- return getFSPassBitBegin(static_cast<FSDiscriminatorPass>(getNumFSPasses()));
+ return getFSPassBitBegin(
+ static_cast<sampleprof::FSDiscriminatorPass>(getNumFSPasses()));
}
// Return the ending bit for the last FSPass.
static inline unsigned getLastFSPassBitEnd() {
- return getFSPassBitEnd(static_cast<FSDiscriminatorPass>(getNumFSPasses()));
+ return getFSPassBitEnd(
+ static_cast<sampleprof::FSDiscriminatorPass>(getNumFSPasses()));
}
// Return the beginning bit for the base (first) FSPass.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152727.530748.patch
Type: text/x-patch
Size: 2332 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230613/a856c53f/attachment.bin>
More information about the llvm-commits
mailing list