[llvm-commits] [hlvm] r38378 - /hlvm/trunk/tools/hlvm-compiler/hlvm-compiler.cpp
Reid Spencer
reid at x10sys.com
Sat Jul 7 17:02:50 PDT 2007
Author: reid
Date: Sat Jul 7 19:02:49 2007
New Revision: 38378
URL: http://llvm.org/viewvc/llvm-project?rev=38378&view=rev
Log:
Allow generation of XML from the source XML. This is necessary in order to link
in the XMLWriter so we can call the debug dumper.
Modified:
hlvm/trunk/tools/hlvm-compiler/hlvm-compiler.cpp
Modified: hlvm/trunk/tools/hlvm-compiler/hlvm-compiler.cpp
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/tools/hlvm-compiler/hlvm-compiler.cpp?rev=38378&r1=38377&r2=38378&view=diff
==============================================================================
--- hlvm/trunk/tools/hlvm-compiler/hlvm-compiler.cpp (original)
+++ hlvm/trunk/tools/hlvm-compiler/hlvm-compiler.cpp Sat Jul 7 19:02:49 2007
@@ -56,6 +56,7 @@
enum GenerationOptions {
GenLLVMBytecode,
GenLLVMAssembly,
+ GenHLVMXML,
GenNativeExecutable,
GenLoadableModule
};
@@ -124,11 +125,33 @@
if (!validate(node))
exit(3);
}
- if (WhatToGenerate == GenLLVMBytecode) {
- if (!generateBytecode(node,*Out, !NoVerify))
+ switch (WhatToGenerate) {
+ case GenLLVMBytecode:
+ if (!generateBytecode(node,*Out, !NoVerify))
+ exit(4);
+ break;
+ case GenLLVMAssembly:
+ if (!generateAssembly(node,*Out, !NoVerify))
+ exit(4);
+ break;
+ case GenHLVMXML:
+ {
+ XMLWriter* wrtr = XMLWriter::create(OutputFilename.c_str());
+ wrtr->write(node);
+ delete wrtr;
+ break;
+ }
+ case GenNativeExecutable:
+ std::cerr << argv[0] <<
+ ": Generating native executables is not supported yet\n";
+ exit(4);
+ case GenLoadableModule:
+ std::cerr << argv[0] <<
+ ": Generating native executables is not supported yet\n";
exit(4);
- } else if (WhatToGenerate == GenLLVMAssembly) {
- if (!generateAssembly(node,*Out, !NoVerify))
+ default:
+ std::cerr << argv[0] <<
+ ": Unknown generation request.\n";
exit(4);
}
delete rdr;
More information about the llvm-commits
mailing list