From: Douglas Katzman Date: Thu, 11 Jun 2015 15:05:22 +0000 (+0000) Subject: Add comments to PrintActions1 and Driver::PrintActions. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=459ad8c0a35fc11ef73588110827b30eb883e57c;p=clang Add comments to PrintActions1 and Driver::PrintActions. Differential Revision: http://reviews.llvm.org/D10214 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239537 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 8cca1de0fb..ec289875a8 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -814,9 +814,12 @@ bool Driver::HandleImmediateArgs(const Compilation &C) { return true; } +// Display an action graph human-readably. Action A is the "sink" node +// 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) { - if (Ids.count(A)) + if (Ids.count(A)) // A was already visited. return Ids[A]; std::string str; @@ -847,6 +850,8 @@ static unsigned PrintActions1(const Compilation &C, Action *A, return Id; } +// Print the action graphs in a compilation C. +// For example "clang -c file1.c file2.c" is composed of two subgraphs. void Driver::PrintActions(const Compilation &C) const { std::map Ids; for (ActionList::const_iterator it = C.getActions().begin(),