[clang][Interp][NFC] Simplify dump() indentation
authorTimm Bäder <tbaeder@redhat.com>
Wed, 31 May 2023 06:50:38 +0000 (08:50 +0200)
committerTimm Bäder <tbaeder@redhat.com>
Wed, 31 May 2023 07:01:57 +0000 (09:01 +0200)
Use llvm::raw_ostream::indent().

clang/lib/AST/Interp/Disasm.cpp

index 7a5da90..f4a6cb8 100644 (file)
@@ -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();) {