]> granicus.if.org Git - clang/commitdiff
Add comments to PrintActions1 and Driver::PrintActions.
authorDouglas Katzman <dougk@google.com>
Thu, 11 Jun 2015 15:05:22 +0000 (15:05 +0000)
committerDouglas Katzman <dougk@google.com>
Thu, 11 Jun 2015 15:05:22 +0000 (15:05 +0000)
Differential Revision: http://reviews.llvm.org/D10214

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239537 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Driver.cpp

index 8cca1de0fb2b337f1b72e264ebf7710e2afdcb07..ec289875a8b4e1d43bab831e0eab22a99ad5bed4 100644 (file)
@@ -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<Action*, unsigned> &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<Action*, unsigned> Ids;
   for (ActionList::const_iterator it = C.getActions().begin(),