[clang] 39f4bd2 - [clang][Interp][NFC] Simplify dump() indentation

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Wed May 31 00:02:53 PDT 2023


Author: Timm Bäder
Date: 2023-05-31T09:01:57+02:00
New Revision: 39f4bd214f1be248283fb7e35bc2610c19169252

URL: https://github.com/llvm/llvm-project/commit/39f4bd214f1be248283fb7e35bc2610c19169252
DIFF: https://github.com/llvm/llvm-project/commit/39f4bd214f1be248283fb7e35bc2610c19169252.diff

LOG: [clang][Interp][NFC] Simplify dump() indentation

Use llvm::raw_ostream::indent().

Added: 
    

Modified: 
    clang/lib/AST/Interp/Disasm.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/Disasm.cpp b/clang/lib/AST/Interp/Disasm.cpp
index 7a5da90cd9002..f4a6cb85470fb 100644
--- a/clang/lib/AST/Interp/Disasm.cpp
+++ b/clang/lib/AST/Interp/Disasm.cpp
@@ -42,9 +42,7 @@ LLVM_DUMP_METHOD void Function::dump(llvm::raw_ostream &OS) const {
 
   auto PrintName = [&OS](const char *Name) {
     OS << Name;
-    for (long I = 0, N = strlen(Name); I < 30 - N; ++I) {
-      OS << ' ';
-    }
+    OS.indent(std::max(30l - strlen(Name), 0ul));
   };
 
   for (CodePtr Start = getCodeBegin(), PC = Start; PC != getCodeEnd();) {


        


More information about the cfe-commits mailing list