diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -1806,7 +1806,8 @@ // and latest-occuring action. Traversal is in pre-order, visiting the // inputs to each action before printing the action itself. static unsigned PrintActions1(const Compilation &C, Action *A, - std::map &Ids) { + std::map &Ids, + unsigned Ident = 0) { if (Ids.count(A)) // A was already visited. return Ids[A]; @@ -1818,7 +1819,7 @@ os << "\"" << IA->getInputArg().getValue() << "\""; } else if (BindArchAction *BIA = dyn_cast(A)) { os << '"' << BIA->getArchName() << '"' << ", {" - << PrintActions1(C, *BIA->input_begin(), Ids) << "}"; + << PrintActions1(C, *BIA->input_begin(), Ids, Ident + 1) << "}"; } else if (OffloadAction *OA = dyn_cast(A)) { bool IsFirst = true; OA->doOnEachDependence( @@ -1841,7 +1842,7 @@ os << ":" << BoundArch; os << ")"; os << '"'; - os << " {" << PrintActions1(C, A, Ids) << "}"; + os << " {" << PrintActions1(C, A, Ids, Ident + 1) << "}"; IsFirst = false; }); } else { @@ -1850,7 +1851,7 @@ if (AL->size()) { const char *Prefix = "{"; for (Action *PreRequisite : *AL) { - os << Prefix << PrintActions1(C, PreRequisite, Ids); + os << Prefix << PrintActions1(C, PreRequisite, Ids, Ident + 1); Prefix = ", "; } os << "}"; @@ -1874,8 +1875,9 @@ unsigned Id = Ids.size(); Ids[A] = Id; - llvm::errs() << Id << ": " << os.str() << ", " - << types::getTypeName(A->getType()) << offload_os.str() << "\n"; + llvm::errs().indent(Ident) + << Id << ": " << os.str() << ", " << types::getTypeName(A->getType()) + << offload_os.str() << "\n"; return Id; }