[llvm] 062353d - [NFC][LLVM] Minor namespace fixes in PassBuilder (#141288)

via llvm-commits llvm-commits at lists.llvm.org
Tue May 27 07:26:31 PDT 2025


Author: Rahul Joshi
Date: 2025-05-27T07:26:28-07:00
New Revision: 062353d1f506f9a381030b099e4dee23b84d5501

URL: https://github.com/llvm/llvm-project/commit/062353d1f506f9a381030b099e4dee23b84d5501
DIFF: https://github.com/llvm/llvm-project/commit/062353d1f506f9a381030b099e4dee23b84d5501.diff

LOG: [NFC][LLVM] Minor namespace fixes in PassBuilder (#141288)

- No need to prefix `PointerType` with `llvm::`.
- Avoid namespace  block to define `PrintPipelinePasses`.

Added: 
    

Modified: 
    llvm/lib/Passes/PassBuilder.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index 697e25846981e..80e0527ddac17 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