[opengtl-commits] [710] add an expression generation context that will be used to replace the basic block when generating an expression

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


Revision: 710
Author:   cyrille
Date:     2009-04-08 17:03:53 +0200 (Wed, 08 Apr 2009)

Log Message:
-----------
add an expression generation context that will be used to replace the basic block when generating an expression

Modified Paths:
--------------
    trunk/OpenGTL/OpenGTL/GTLCore/CMakeLists.txt

Added Paths:
-----------
    trunk/OpenGTL/OpenGTL/GTLCore/ExpressionGenerationContext_p.cpp
    trunk/OpenGTL/OpenGTL/GTLCore/ExpressionGenerationContext_p.h


Modified: trunk/OpenGTL/OpenGTL/GTLCore/CMakeLists.txt
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/CMakeLists.txt	2009-04-08 13:18:46 UTC (rev 709)
+++ trunk/OpenGTL/OpenGTL/GTLCore/CMakeLists.txt	2009-04-08 15:03:53 UTC (rev 710)
@@ -46,6 +46,7 @@
   CompilerBase_p.cpp
   ConvertCenter_p.cpp
   ErrorMessages_p.cpp
+  ExpressionGenerationContext_p.cpp
   ExpressionResult_p.cpp
   Function_p.cpp
   FunctionCaller_p.cpp

Added: trunk/OpenGTL/OpenGTL/GTLCore/ExpressionGenerationContext_p.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/ExpressionGenerationContext_p.cpp	                        (rev 0)
+++ trunk/OpenGTL/OpenGTL/GTLCore/ExpressionGenerationContext_p.cpp	2009-04-08 15:03:53 UTC (rev 710)
@@ -0,0 +1,42 @@
+/*
+ *  Copyright (c) 2009 Cyrille Berger <cberger@xxxxxxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * either version 2, or (at your option) any later version of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "ExpressionGenerationContext_p.h"
+
+#include "Debug.h"
+
+using namespace GTLCore;
+
+ExpressionGenerationContext::ExpressionGenerationContext(llvm::BasicBlock* _basicBlock) : m_currentBasicBlock(_basicBlock)
+{
+}
+ExpressionGenerationContext::~ExpressionGenerationContext()
+{
+}
+
+llvm::BasicBlock* ExpressionGenerationContext::currentBasicBlock()
+{
+  return m_currentBasicBlock;
+}
+
+void ExpressionGenerationContext::setCurrentBasicBlock(llvm::BasicBlock* _bb)
+{
+  GTL_ASSERT( m_currentBasicBlock == 0 );
+  m_currentBasicBlock = _bb;
+}


Property changes on: trunk/OpenGTL/OpenGTL/GTLCore/ExpressionGenerationContext_p.cpp
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: trunk/OpenGTL/OpenGTL/GTLCore/ExpressionGenerationContext_p.h
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/ExpressionGenerationContext_p.h	                        (rev 0)
+++ trunk/OpenGTL/OpenGTL/GTLCore/ExpressionGenerationContext_p.h	2009-04-08 15:03:53 UTC (rev 710)
@@ -0,0 +1,39 @@
+/*
+ *  Copyright (c) 2009 Cyrille Berger <cberger@xxxxxxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * either version 2, or (at your option) any later version of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _GTLCORE_EXPRESSION_GENERATION_CONTEXT_H_
+#define _GTLCORE_EXPRESSION_GENERATION_CONTEXT_H_
+
+namespace llvm {
+  class BasicBlock;
+}
+
+namespace GTLCore {
+  class ExpressionGenerationContext {
+    public:
+      ExpressionGenerationContext(llvm::BasicBlock* _basicBlock);
+      ~ExpressionGenerationContext();
+      llvm::BasicBlock* currentBasicBlock();
+      void setCurrentBasicBlock(llvm::BasicBlock* _bb);
+    private:
+      llvm::BasicBlock* m_currentBasicBlock;
+  };
+}
+
+#endif


Property changes on: trunk/OpenGTL/OpenGTL/GTLCore/ExpressionGenerationContext_p.h
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native


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