[llvm-commits] [hlvm] r38105 - in /hlvm/trunk: hlvm/Pass/Pass.h hlvm/Pass/Validate.cpp hlvm/Pass/Validate.h tools/hlvm-xml2xml/hlvm-xml2xml.cpp
Reid Spencer
reid at x10sys.com
Sat Jul 7 16:59:52 PDT 2007
Author: reid
Date: Sat Jul 7 18:59:52 2007
New Revision: 38105
URL: http://llvm.org/viewvc/llvm-project?rev=38105&view=rev
Log:
Integrate the Validator into the xml2xml program so that validation is
run between reading and writing the XML.
Modified:
hlvm/trunk/hlvm/Pass/Pass.h
hlvm/trunk/hlvm/Pass/Validate.cpp
hlvm/trunk/hlvm/Pass/Validate.h
hlvm/trunk/tools/hlvm-xml2xml/hlvm-xml2xml.cpp
Modified: hlvm/trunk/hlvm/Pass/Pass.h
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/Pass/Pass.h?rev=38105&r1=38104&r2=38105&view=diff
==============================================================================
--- hlvm/trunk/hlvm/Pass/Pass.h (original)
+++ hlvm/trunk/hlvm/Pass/Pass.h Sat Jul 7 18:59:52 2007
@@ -101,8 +101,8 @@
{
protected:
PassManager() {}
- virtual ~PassManager();
public:
+ virtual ~PassManager();
static PassManager* create();
virtual void addPass(Pass* p) = 0;
virtual void runOn(AST* tree) = 0;
Modified: hlvm/trunk/hlvm/Pass/Validate.cpp
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/Pass/Validate.cpp?rev=38105&r1=38104&r2=38105&view=diff
==============================================================================
--- hlvm/trunk/hlvm/Pass/Validate.cpp (original)
+++ hlvm/trunk/hlvm/Pass/Validate.cpp Sat Jul 7 18:59:52 2007
@@ -315,7 +315,7 @@
{
}
-Validate* new_Validate()
+Validate* Validate::create()
{
return new ValidateImpl();
}
Modified: hlvm/trunk/hlvm/Pass/Validate.h
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/Pass/Validate.h?rev=38105&r1=38104&r2=38105&view=diff
==============================================================================
--- hlvm/trunk/hlvm/Pass/Validate.h (original)
+++ hlvm/trunk/hlvm/Pass/Validate.h Sat Jul 7 18:59:52 2007
@@ -46,7 +46,7 @@
protected:
Validate(int interest) : Pass(interest,true) {}
public:
- Validate* new_Validate();
+ static Validate* create();
virtual ~Validate();
/// @}
Modified: hlvm/trunk/tools/hlvm-xml2xml/hlvm-xml2xml.cpp
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/tools/hlvm-xml2xml/hlvm-xml2xml.cpp?rev=38105&r1=38104&r2=38105&view=diff
==============================================================================
--- hlvm/trunk/tools/hlvm-xml2xml/hlvm-xml2xml.cpp (original)
+++ hlvm/trunk/tools/hlvm-xml2xml/hlvm-xml2xml.cpp Sat Jul 7 18:59:52 2007
@@ -30,6 +30,7 @@
#include <hlvm/Base/Memory.h>
#include <hlvm/Reader/XML/XMLReader.h>
#include <hlvm/Writer/XML/XMLWriter.h>
+#include <hlvm/Pass/Validate.h>
#include <llvm/Support/CommandLine.h>
#include <llvm/System/Signals.h>
#include <fstream>
@@ -93,6 +94,12 @@
rdr->read();
AST* node = rdr->get();
if (node) {
+ PassManager* PM = PassManager::create();
+ Validate* pass = Validate::create();
+ PM->addPass( pass );
+ PM->runOn(node);
+ delete PM;
+ delete pass;
wrtr->write(node);
}
delete rdr;
More information about the llvm-commits
mailing list