r239537 - Add comments to PrintActions1 and Driver::PrintActions.

Douglas Katzman dougk at google.com
Thu Jun 11 08:05:22 PDT 2015


Author: dougk
Date: Thu Jun 11 10:05:22 2015
New Revision: 239537

URL: http://llvm.org/viewvc/llvm-project?rev=239537&view=rev
Log:
Add comments to PrintActions1 and Driver::PrintActions.

Differential Revision: http://reviews.llvm.org/D10214

Modified:
    cfe/trunk/lib/Driver/Driver.cpp

Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=239537&r1=239536&r2=239537&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Thu Jun 11 10:05:22 2015
@@ -814,9 +814,12 @@ bool Driver::HandleImmediateArgs(const 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 Comp
   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(),





More information about the cfe-commits mailing list