From 9b66c4bbbe23accc8c3b3b8cbacf7f093870f68f Mon Sep 17 00:00:00 2001 From: John McCall Date: Wed, 24 Nov 2010 11:21:45 +0000 Subject: Add -cc1 -ast-dump-xml, an excessively detailed XML dump of the internals of the ASTs. Only available in assertions builds. No stability guarantee. This is intended solely as a debugging tool. I'm not sure if the goals are sufficiently aligned with the XML printer to allow a common implementation. Currently just falls back on the StmtDumper to display statements, which means it doesn't produce valid XML in those cases. llvm-svn: 120088 --- clang/lib/Frontend/CompilerInvocation.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index a0280e52c72..80643b2d4be 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -319,6 +319,7 @@ static const char *getActionName(frontend::ActionKind Kind) { llvm_unreachable("Invalid kind!"); case frontend::ASTDump: return "-ast-dump"; + case frontend::ASTDumpXML: return "-ast-dump-xml"; case frontend::ASTPrint: return "-ast-print"; case frontend::ASTPrintXML: return "-ast-print-xml"; case frontend::ASTView: return "-ast-view"; @@ -1003,6 +1004,8 @@ static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args, assert(0 && "Invalid option in group!"); case OPT_ast_dump: Opts.ProgramAction = frontend::ASTDump; break; + case OPT_ast_dump_xml: + Opts.ProgramAction = frontend::ASTDumpXML; break; case OPT_ast_print: Opts.ProgramAction = frontend::ASTPrint; break; case OPT_ast_print_xml: -- cgit v1.2.3