diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-05-21 20:55:50 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-05-21 20:55:50 +0000 |
commit | 7f5601e55f7f16abdb88130a56241f6c3b059694 (patch) | |
tree | c0c0e9d9f4aa3773d3a558504bedf237f09d6849 /clang/tools | |
parent | 0ac904455e15edb67403e278c1e913f41f896e5c (diff) | |
download | bcm5719-llvm-7f5601e55f7f16abdb88130a56241f6c3b059694.tar.gz bcm5719-llvm-7f5601e55f7f16abdb88130a56241f6c3b059694.zip |
AST XML dump, from Olaf Krzikalla!
llvm-svn: 72224
Diffstat (limited to 'clang/tools')
-rw-r--r-- | clang/tools/clang-cc/clang-cc.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/tools/clang-cc/clang-cc.cpp b/clang/tools/clang-cc/clang-cc.cpp index 95a704b4f69..f2f05237a2a 100644 --- a/clang/tools/clang-cc/clang-cc.cpp +++ b/clang/tools/clang-cc/clang-cc.cpp @@ -194,6 +194,7 @@ enum ProgActions { EmitLLVMOnly, // Generate LLVM IR, but do not EmitHTML, // Translate input source into HTML. ASTPrint, // Parse ASTs and print them. + ASTPrintXML, // Parse ASTs and print them in XML. ASTDump, // Parse ASTs and dump them. ASTDumpFull, // Parse ASTs and dump them, including the // contents of a PCH file. @@ -236,6 +237,8 @@ ProgAction(llvm::cl::desc("Choose output type:"), llvm::cl::ZeroOrMore, "Output input source as HTML"), clEnumValN(ASTPrint, "ast-print", "Build ASTs and then pretty-print them"), + clEnumValN(ASTPrintXML, "ast-print-xml", + "Build ASTs and then print them in XML format"), clEnumValN(ASTDump, "ast-dump", "Build ASTs and then debug dump them"), clEnumValN(ASTDumpFull, "ast-dump-full", @@ -1755,6 +1758,11 @@ static void ProcessInputFile(Preprocessor &PP, PreprocessorFactory &PPF, Consumer.reset(CreateASTPrinter(OS.get())); break; + case ASTPrintXML: + OS.reset(ComputeOutFile(InFile, "xml", false, OutPath)); + Consumer.reset(CreateASTPrinterXML(OS.get())); + break; + case ASTDump: Consumer.reset(CreateASTDumper(false)); break; |