[opengtl-commits] [659] don't create a compiler in openctl test of parsing expressions

[ Thread Index | Date Index | More lists.tuxfamily.org/opengtl-commits Archives ]


Revision: 659
Author:   cyrille
Date:     2009-03-18 21:31:03 +0100 (Wed, 18 Mar 2009)

Log Message:
-----------
don't create a compiler in openctl test of parsing expressions

Modified Paths:
--------------
    trunk/OpenGTL/OpenCTL/OpenCTL/compiler/Compiler.cpp
    trunk/OpenGTL/OpenCTL/tests/library/TestParserNG.h


Modified: trunk/OpenGTL/OpenCTL/OpenCTL/compiler/Compiler.cpp
===================================================================
--- trunk/OpenGTL/OpenCTL/OpenCTL/compiler/Compiler.cpp	2009-03-17 20:14:17 UTC (rev 658)
+++ trunk/OpenGTL/OpenCTL/OpenCTL/compiler/Compiler.cpp	2009-03-18 20:31:03 UTC (rev 659)
@@ -61,7 +61,7 @@
 using namespace OpenCTL;
 
 struct Compiler::Private {
-  Private() : module(0), lexer(0), codeGenerator(0) {}
+  Private() : module(0), moduleData(0), lexer(0), parser(0), codeGenerator(0) {}
   llvm::Module* module;
   GTLCore::ModuleData* moduleData;
   LexerNG* lexer;
@@ -287,6 +287,7 @@
 
 GTLCore::TypesManager* Compiler::typesManager()
 {
+  GTL_ASSERT(d->moduleData);
   return d->moduleData->typesManager();
 }
 

Modified: trunk/OpenGTL/OpenCTL/tests/library/TestParserNG.h
===================================================================
--- trunk/OpenGTL/OpenCTL/tests/library/TestParserNG.h	2009-03-17 20:14:17 UTC (rev 658)
+++ trunk/OpenGTL/OpenCTL/tests/library/TestParserNG.h	2009-03-18 20:31:03 UTC (rev 659)
@@ -29,7 +29,7 @@
     {
       std::istringstream iss(" const int v = 3 + 4 / 2; \n const int v2 = 3 / 4 + 2;");
       OpenCTL::LexerNG lng(&iss);
-      OpenCTL::ParserNG png( new OpenCTL::Compiler, &lng );
+      OpenCTL::ParserNG png( 0, &lng );
       AST::Tree* tree = png.parse();
       GTL_ASSERT( tree );
       GTLTEST_CHECK_EQUAL( tree->globalConstantDeclarations().size() , 2);


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/