[llvm-commits] [hlvm] r37988 - in /hlvm/trunk/hlvm/AST: Bundle.cpp Function.cpp Function.h Node.cpp Node.h Program.cpp Program.h Type.cpp Variable.cpp

Reid Spencer reid at x10sys.com
Sat Jul 7 16:58:41 PDT 2007


Author: reid
Date: Sat Jul  7 18:58:41 2007
New Revision: 37988

URL: http://llvm.org/viewvc/llvm-project?rev=37988&view=rev
Log:
Add compile unit for concrete AST classes. Add Program.

Added:
    hlvm/trunk/hlvm/AST/Bundle.cpp
    hlvm/trunk/hlvm/AST/Function.cpp
    hlvm/trunk/hlvm/AST/Program.cpp
    hlvm/trunk/hlvm/AST/Program.h
    hlvm/trunk/hlvm/AST/Type.cpp
    hlvm/trunk/hlvm/AST/Variable.cpp
Modified:
    hlvm/trunk/hlvm/AST/Function.h
    hlvm/trunk/hlvm/AST/Node.cpp
    hlvm/trunk/hlvm/AST/Node.h

Added: hlvm/trunk/hlvm/AST/Bundle.cpp
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/Bundle.cpp?rev=37988&view=auto

==============================================================================
--- hlvm/trunk/hlvm/AST/Bundle.cpp (added)
+++ hlvm/trunk/hlvm/AST/Bundle.cpp Sat Jul  7 18:58:41 2007
@@ -0,0 +1,29 @@
+//
+// Copyright (C) 2006 HLVM Group. All Rights Reserved.
+//
+// This program is open source software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License (GPL) as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version. You should have received a copy of the GPL in a
+// file named COPYING that was included with this program; if not, you can
+// obtain a copy of the license through the Internet at http://www.fsf.org/
+//
+// This program 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 General Public License
+// for more details.
+//
+////////////////////////////////////////////////////////////////////////////////
+/// @file hlvm/AST/Bundle.cpp
+/// @author Reid Spencer <reid at hlvm.org> (original author)
+/// @date 2006/05/04
+/// @since 0.1.0
+/// @brief Implements the functions of class hlvm::AST::Bundle.
+////////////////////////////////////////////////////////////////////////////////
+
+#include <hlvm/AST/Bundle.h>
+
+namespace hlvm {
+namespace AST {
+
+}}

Added: hlvm/trunk/hlvm/AST/Function.cpp
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/Function.cpp?rev=37988&view=auto

==============================================================================
--- hlvm/trunk/hlvm/AST/Function.cpp (added)
+++ hlvm/trunk/hlvm/AST/Function.cpp Sat Jul  7 18:58:41 2007
@@ -0,0 +1,29 @@
+//
+// Copyright (C) 2006 HLVM Group. All Rights Reserved.
+//
+// This program is open source software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License (GPL) as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version. You should have received a copy of the GPL in a
+// file named COPYING that was included with this program; if not, you can
+// obtain a copy of the license through the Internet at http://www.fsf.org/
+//
+// This program 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 General Public License
+// for more details.
+//
+////////////////////////////////////////////////////////////////////////////////
+/// @file hlvm/AST/Function.cpp
+/// @author Reid Spencer <reid at hlvm.org> (original author)
+/// @date 2006/05/04
+/// @since 0.1.0
+/// @brief Implements the functions of class hlvm::AST::Function.
+////////////////////////////////////////////////////////////////////////////////
+
+#include <hlvm/AST/Function.h>
+
+namespace hlvm {
+namespace AST {
+
+}}

Modified: hlvm/trunk/hlvm/AST/Function.h
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/Function.h?rev=37988&r1=37987&r2=37988&view=diff

==============================================================================
--- hlvm/trunk/hlvm/AST/Function.h (original)
+++ hlvm/trunk/hlvm/AST/Function.h Sat Jul  7 18:58:41 2007
@@ -30,10 +30,11 @@
 {
 namespace AST
 {
-  class Block; // Forward declare
-  class SignatureType;  // Forward declare
+  // Forward declarations
+  class Block; 
+  class SignatureType;  
 
-  /// This class represents an Function in the HLVM Abstract Syntax Tree.  
+  /// This class represents a Function in the HLVM Abstract Syntax Tree.  
   /// A Function is a callable block of code that accepts parameters and 
   /// returns a result.  This is the basic unit of code in HLVM. A Function
   /// has a name, a set of formal arguments, a return type, and a block of
@@ -45,9 +46,11 @@
     /// @{
     public:
       Function(
-        Bundle* parent, ///< The bundle in which the function is defined
-        const std::string& name ///< The name of the function
-      ) : LinkageItem(FunctionID,parent,name) {}
+        SignatureType* sig, ///< The function signature
+        Node* parent, ///< The bundle in which the function is defined
+        const std::string& name, ///< The name of the function
+        NodeIDs id = FunctionID
+      ) : LinkageItem(id,parent,name), block_(0), signature_(sig) {}
       virtual ~Function();
 
     /// @}

Modified: hlvm/trunk/hlvm/AST/Node.cpp
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/Node.cpp?rev=37988&r1=37987&r2=37988&view=diff

==============================================================================
--- hlvm/trunk/hlvm/AST/Node.cpp (original)
+++ hlvm/trunk/hlvm/AST/Node.cpp Sat Jul  7 18:58:41 2007
@@ -23,11 +23,7 @@
 
 #include <hlvm/AST/Node.h>
 #include <hlvm/AST/Conditionable.h>
-#include <hlvm/AST/Type.h>
 #include <hlvm/AST/ContainerType.h>
-#include <hlvm/AST/Bundle.h>
-#include <hlvm/AST/Function.h>
-#include <hlvm/AST/Variable.h>
 
 namespace hlvm {
 namespace AST {

Modified: hlvm/trunk/hlvm/AST/Node.h
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/Node.h?rev=37988&r1=37987&r2=37988&view=diff

==============================================================================
--- hlvm/trunk/hlvm/AST/Node.h (original)
+++ hlvm/trunk/hlvm/AST/Node.h Sat Jul  7 18:58:41 2007
@@ -53,6 +53,7 @@
     // Containers
     BundleID,           ///< The Bundle Node
     FunctionID,         ///< The Function Node
+    ProgramID,          ///< The Program Node
 
     // Declarations
     VariableID,         ///< The Variable Node
@@ -95,6 +96,7 @@
       }
       inline bool isBundle() const { return id_ == BundleID; }
       inline bool isFunction() const { return id_ == FunctionID; }
+      inline bool isProgram() const { return id_ == ProgramID; }
       inline bool isVariable() const { return id_ == VariableID; }
       static inline bool classof(const Node*) { return true; }
 

Added: hlvm/trunk/hlvm/AST/Program.cpp
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/Program.cpp?rev=37988&view=auto

==============================================================================
--- hlvm/trunk/hlvm/AST/Program.cpp (added)
+++ hlvm/trunk/hlvm/AST/Program.cpp Sat Jul  7 18:58:41 2007
@@ -0,0 +1,33 @@
+//
+// Copyright (C) 2006 HLVM Group. All Rights Reserved.
+//
+// This program is open source software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License (GPL) as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version. You should have received a copy of the GPL in a
+// file named COPYING that was included with this program; if not, you can
+// obtain a copy of the license through the Internet at http://www.fsf.org/
+//
+// This program 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 General Public License
+// for more details.
+//
+////////////////////////////////////////////////////////////////////////////////
+/// @file hlvm/AST/Node.cpp
+/// @author Reid Spencer <reid at hlvm.org> (original author)
+/// @date 2006/05/04
+/// @since 0.1.0
+/// @brief Implements the functions of class hlvm::AST::Node.
+////////////////////////////////////////////////////////////////////////////////
+
+#include <hlvm/AST/Program.h>
+#include <hlvm/AST/ContainerType.h>
+
+namespace hlvm {
+namespace AST {
+
+SignatureType Program::SignatureTy(0,"_hlvm_ProgramSignature");
+
+
+}}

Added: hlvm/trunk/hlvm/AST/Program.h
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/Program.h?rev=37988&view=auto

==============================================================================
--- hlvm/trunk/hlvm/AST/Program.h (added)
+++ hlvm/trunk/hlvm/AST/Program.h Sat Jul  7 18:58:41 2007
@@ -0,0 +1,74 @@
+//
+// Copyright (C) 2006 HLVM Group. All Rights Reserved.
+//
+// This program is open source software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License (GPL) as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version. You should have received a copy of the GPL in a
+// file named COPYING that was included with this program; if not, you can
+// obtain a copy of the license through the Internet at http://www.fsf.org/
+//
+// This program 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 General Public License
+// for more details.
+//
+////////////////////////////////////////////////////////////////////////////////
+/// @file hlvm/AST/Function.h
+/// @author Reid Spencer <reid at hlvm.org> (original author)
+/// @date 2006/05/04
+/// @since 0.1.0
+/// @brief Declares the class hlvm::AST::Function
+////////////////////////////////////////////////////////////////////////////////
+
+#ifndef HLVM_AST_PROGRAM_H
+#define HLVM_AST_PROGRAM_H
+
+#include <hlvm/AST/Function.h>
+
+namespace hlvm {
+namespace AST {
+
+  class Block; // Forward declare
+  class SignatureType;  // Forward declare
+  class Bundle; // Forward declare
+
+  /// This class represents a Program in the HLVM Abstract Syntax Tree.  
+  /// A Program is a function with a specific set of arguments. It represents
+  /// a starting point for any execution. To be executable, a Bundle must have
+  /// at least one Program node in it. 
+  /// returns a result.  This is the basic unit of code in HLVM. A Function
+  /// has a name, a set of formal arguments, a return type, and a block of
+  /// code to execute.
+  /// @brief HLVM AST Function Node
+  class Program : public Function
+  {
+    /// @name Constructors
+    /// @{
+    public:
+      Program(
+        Node* parent, ///< The bundle in which the function is defined
+        const std::string& name ///< The name of the function
+      ) : Function(&SignatureTy,parent,name,ProgramID) {}
+      virtual ~Program();
+
+    /// @}
+    /// @name Accessors
+    /// @{
+    public:
+      static inline bool classof(const Program*) { return true; }
+      static inline bool classof(const Node* N) { return N->isProgram(); }
+
+    /// @}
+    /// @name Data
+    /// @{
+    protected:
+      Block * block_;                   ///< The code block to be executed
+      SignatureType* signature_;        ///< The function signature.
+    private:
+      static SignatureType SignatureTy; ///< The signature for programs
+    /// @}
+  };
+} // AST
+} // hlvm
+#endif

Added: hlvm/trunk/hlvm/AST/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/Type.cpp?rev=37988&view=auto

==============================================================================
--- hlvm/trunk/hlvm/AST/Type.cpp (added)
+++ hlvm/trunk/hlvm/AST/Type.cpp Sat Jul  7 18:58:41 2007
@@ -0,0 +1,29 @@
+//
+// Copyright (C) 2006 HLVM Group. All Rights Reserved.
+//
+// This program is open source software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License (GPL) as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version. You should have received a copy of the GPL in a
+// file named COPYING that was included with this program; if not, you can
+// obtain a copy of the license through the Internet at http://www.fsf.org/
+//
+// This program 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 General Public License
+// for more details.
+//
+////////////////////////////////////////////////////////////////////////////////
+/// @file hlvm/AST/Type.cpp
+/// @author Reid Spencer <reid at hlvm.org> (original author)
+/// @date 2006/05/04
+/// @since 0.1.0
+/// @brief Implements the functions of class hlvm::AST::Type.
+////////////////////////////////////////////////////////////////////////////////
+
+#include <hlvm/AST/Type.h>
+
+namespace hlvm {
+namespace AST {
+
+}}

Added: hlvm/trunk/hlvm/AST/Variable.cpp
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/Variable.cpp?rev=37988&view=auto

==============================================================================
--- hlvm/trunk/hlvm/AST/Variable.cpp (added)
+++ hlvm/trunk/hlvm/AST/Variable.cpp Sat Jul  7 18:58:41 2007
@@ -0,0 +1,29 @@
+//
+// Copyright (C) 2006 HLVM Group. All Rights Reserved.
+//
+// This program is open source software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License (GPL) as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version. You should have received a copy of the GPL in a
+// file named COPYING that was included with this program; if not, you can
+// obtain a copy of the license through the Internet at http://www.fsf.org/
+//
+// This program 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 General Public License
+// for more details.
+//
+////////////////////////////////////////////////////////////////////////////////
+/// @file hlvm/AST/Variable.cpp
+/// @author Reid Spencer <reid at hlvm.org> (original author)
+/// @date 2006/05/04
+/// @since 0.1.0
+/// @brief Implements the functions of class hlvm::AST::Variable.
+////////////////////////////////////////////////////////////////////////////////
+
+#include <hlvm/AST/Variable.h>
+
+namespace hlvm {
+namespace AST {
+
+}}





More information about the llvm-commits mailing list