[llvm] [NFC][LLVM] Minor namespace fixes in PassBuilder (PR #141288)
Rahul Joshi via llvm-commits
llvm-commits at lists.llvm.org
Fri May 23 12:50:30 PDT 2025
https://github.com/jurahul created https://github.com/llvm/llvm-project/pull/141288
- No need to prefix `PointerType` with `llvm::`.
- Avoid namespace block to define `PrintPipelinePasses`.
>From 67b31e56b3c378d84375511399ee0d37f79fc8ec Mon Sep 17 00:00:00 2001
From: Rahul Joshi <rjoshi at nvidia.com>
Date: Fri, 23 May 2025 12:47:48 -0700
Subject: [PATCH] [NFC][LLVM] Minor namespace fixes in PassBuilder
- No need to prefix `PointerType` with `llvm::`.
- Avoid namespace block to define `PrintPipelinePasses`.
---
llvm/lib/Passes/PassBuilder.cpp | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index 49b49e288baa7..d7f3ef5b80c0a 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -386,12 +386,10 @@ using namespace llvm;
static const Regex DefaultAliasRegex(
"^(default|thinlto-pre-link|thinlto|lto-pre-link|lto)<(O[0123sz])>$");
-namespace llvm {
-cl::opt<bool> PrintPipelinePasses(
+cl::opt<bool> llvm::PrintPipelinePasses(
"print-pipeline-passes",
cl::desc("Print a '-passes' compatible string describing the pipeline "
"(best-effort only)."));
-} // namespace llvm
AnalysisKey NoOpModuleAnalysis::Key;
AnalysisKey NoOpCGSCCAnalysis::Key;
@@ -429,7 +427,7 @@ class TriggerVerifierErrorPass
PreservedAnalyses run(Module &M, ModuleAnalysisManager &) {
// Intentionally break the Module by creating an alias without setting the
// aliasee.
- auto *PtrTy = llvm::PointerType::getUnqual(M.getContext());
+ auto *PtrTy = PointerType::getUnqual(M.getContext());
GlobalAlias::create(PtrTy, PtrTy->getAddressSpace(),
GlobalValue::LinkageTypes::InternalLinkage,
"__bad_alias", nullptr, &M);
More information about the llvm-commits
mailing list