summaryrefslogtreecommitdiff
path: root/src/parsers/decl
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-08-08 17:45:16 +0300
committerAndrei Karas <akaras@inbox.ru>2015-08-08 17:45:16 +0300
commit0ad1e8efbd7e4b467d93568136e7beafe1e23fb5 (patch)
treea148bb981a616eff70aeec5c162f3368f798a797 /src/parsers/decl
parent2abca5bd038805c23d8a84b73cbe1b9410442841 (diff)
downloadparanucker-0ad1e8efbd7e4b467d93568136e7beafe1e23fb5.tar.gz
paranucker-0ad1e8efbd7e4b467d93568136e7beafe1e23fb5.tar.bz2
paranucker-0ad1e8efbd7e4b467d93568136e7beafe1e23fb5.tar.xz
paranucker-0ad1e8efbd7e4b467d93568136e7beafe1e23fb5.zip
Add plugin parameters *-specialdump=filename for dump only this file AST tree.
Diffstat (limited to 'src/parsers/decl')
-rw-r--r--src/parsers/decl/function_decl.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/parsers/decl/function_decl.cpp b/src/parsers/decl/function_decl.cpp
index f8a5579..3bd774d 100644
--- a/src/parsers/decl/function_decl.cpp
+++ b/src/parsers/decl/function_decl.cpp
@@ -19,6 +19,8 @@
#include "includes/parserincludes.h"
+#include "command.h"
+
parserDefine(FunctionDecl);
#include "parsers/base/decl.h"
@@ -35,6 +37,15 @@ void parseFunctionDeclNode(FunctionDeclNode *node)
fillLocation(node);
fillDeclLabel(node);
+ bool spoofCommand(false);
+ Command oldCommand = command;
+ if (!node->parent && !dumpFile.empty() && node->file == dumpFile)
+ {
+ spoofCommand = true;
+ enableCommand(Dump);
+ Log::log("start dump\n");
+ }
+
Log::dump(node);
fillDeclAutoGenerated(node);
@@ -79,6 +90,12 @@ void parseFunctionDeclNode(FunctionDeclNode *node)
node,
DECL_FUNCTION_SPECIFIC_OPTIMIZATION(node->gccNode),
"optiomisations");
+
+ if (spoofCommand)
+ {
+ command = oldCommand;
+ Log::log("end dump\n");
+ }
}
}