[llvm] [NFC][LLVM][Support] Misc code cleanup in ScopedPrinter (PR #161462)
Rahul Joshi via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 1 08:50:33 PDT 2025
https://github.com/jurahul updated https://github.com/llvm/llvm-project/pull/161462
>From 46000da42cb939b4525649c2b1b7096ce3bbf837 Mon Sep 17 00:00:00 2001
From: Rahul Joshi <rjoshi at nvidia.com>
Date: Tue, 30 Sep 2025 17:12:28 -0700
Subject: [PATCH] [NFC][LLVM][Support] Misc code cleanup in ScopedPrinter
- Use character instead of a single character string.
- Add missing header to ScopedPrinter.cpp and adjust the code to
conform to LLVM coding standards.
---
llvm/lib/Support/ScopedPrinter.cpp | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/llvm/lib/Support/ScopedPrinter.cpp b/llvm/lib/Support/ScopedPrinter.cpp
index a17e397c0aa58..9eadb456ab1a4 100644
--- a/llvm/lib/Support/ScopedPrinter.cpp
+++ b/llvm/lib/Support/ScopedPrinter.cpp
@@ -1,12 +1,22 @@
-#include "llvm/Support/ScopedPrinter.h"
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// Implementation of ScopedPrinter.
+//
+//===----------------------------------------------------------------------===//
+#include "llvm/Support/ScopedPrinter.h"
#include "llvm/Support/Format.h"
+using namespace llvm;
using namespace llvm::support;
-namespace llvm {
-
-raw_ostream &operator<<(raw_ostream &OS, const HexNumber &Value) {
+raw_ostream &llvm::operator<<(raw_ostream &OS, const HexNumber &Value) {
OS << "0x" << utohexstr(Value.Value);
return OS;
}
@@ -45,5 +55,3 @@ JSONScopedPrinter::JSONScopedPrinter(
if (this->OuterScope)
this->OuterScope->setPrinter(*this);
}
-
-} // namespace llvm
More information about the llvm-commits
mailing list