summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Driver.cpp
diff options
context:
space:
mode:
authorDouglas Katzman <dougk@google.com>2015-06-11 15:05:22 +0000
committerDouglas Katzman <dougk@google.com>2015-06-11 15:05:22 +0000
commitfd5286717c7be8a632f6ffc954eeda7dbc21d540 (patch)
tree665f152b6a11f868bfef1a192796c3d5ba42b480 /clang/lib/Driver/Driver.cpp
parent2987c29a1e5ae5adb9b5be7c6c327503d1a2597e (diff)
downloadbcm5719-llvm-fd5286717c7be8a632f6ffc954eeda7dbc21d540.tar.gz
bcm5719-llvm-fd5286717c7be8a632f6ffc954eeda7dbc21d540.zip
Add comments to PrintActions1 and Driver::PrintActions.
Differential Revision: http://reviews.llvm.org/D10214 llvm-svn: 239537
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r--clang/lib/Driver/Driver.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 8cca1de0fb2..ec289875a8b 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/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<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(),
OpenPOWER on IntegriCloud