[llvm-commits] [hlvm] r38194 - in /hlvm/trunk/hlvm: AST/AST.cpp AST/Bundle.cpp AST/Function.cpp AST/Function.h AST/InputOutput.h AST/LinkageItem.h AST/LinkageItems.cpp AST/LinkageItems.h AST/Program.cpp AST/Program.h AST/Variable.cpp AST/Variable.h CodeGen/LLVMGenerator.cpp Pass/Pass.cpp Pass/Validate.cpp Reader/XMLReader.cpp Writer/XMLWriter.cpp

Reid Spencer reid at x10sys.com
Sat Jul 7 17:01:00 PDT 2007


Author: reid
Date: Sat Jul  7 19:01:00 2007
New Revision: 38194

URL: http://llvm.org/viewvc/llvm-project?rev=38194&view=rev
Log:
A little more documentation and some consolidation. Merge the
Program, Function and Variable classes into a new modules named
LinkageItems which will contain all subclasses of LinkageItem

Added:
    hlvm/trunk/hlvm/AST/LinkageItems.cpp
    hlvm/trunk/hlvm/AST/LinkageItems.h
Removed:
    hlvm/trunk/hlvm/AST/Function.cpp
    hlvm/trunk/hlvm/AST/Function.h
    hlvm/trunk/hlvm/AST/Program.cpp
    hlvm/trunk/hlvm/AST/Program.h
    hlvm/trunk/hlvm/AST/Variable.cpp
    hlvm/trunk/hlvm/AST/Variable.h
Modified:
    hlvm/trunk/hlvm/AST/AST.cpp
    hlvm/trunk/hlvm/AST/Bundle.cpp
    hlvm/trunk/hlvm/AST/InputOutput.h
    hlvm/trunk/hlvm/AST/LinkageItem.h
    hlvm/trunk/hlvm/CodeGen/LLVMGenerator.cpp
    hlvm/trunk/hlvm/Pass/Pass.cpp
    hlvm/trunk/hlvm/Pass/Validate.cpp
    hlvm/trunk/hlvm/Reader/XMLReader.cpp
    hlvm/trunk/hlvm/Writer/XMLWriter.cpp

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

==============================================================================
--- hlvm/trunk/hlvm/AST/AST.cpp (original)
+++ hlvm/trunk/hlvm/AST/AST.cpp Sat Jul  7 19:01:00 2007
@@ -32,10 +32,8 @@
 #include <hlvm/AST/Bundle.h>
 #include <hlvm/AST/Documentation.h>
 #include <hlvm/AST/ContainerType.h>
-#include <hlvm/AST/Variable.h>
+#include <hlvm/AST/LinkageItems.h>
 #include <hlvm/AST/Constants.h>
-#include <hlvm/AST/Function.h>
-#include <hlvm/AST/Program.h>
 #include <hlvm/AST/Block.h>
 #include <hlvm/AST/ControlFlow.h>
 #include <hlvm/AST/MemoryOps.h>

Modified: hlvm/trunk/hlvm/AST/Bundle.cpp
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/Bundle.cpp?rev=38194&r1=38193&r2=38194&view=diff

==============================================================================
--- hlvm/trunk/hlvm/AST/Bundle.cpp (original)
+++ hlvm/trunk/hlvm/AST/Bundle.cpp Sat Jul  7 19:01:00 2007
@@ -29,8 +29,7 @@
 
 #include <hlvm/AST/Bundle.h>
 #include <hlvm/AST/Type.h>
-#include <hlvm/AST/Variable.h>
-#include <hlvm/AST/Function.h>
+#include <hlvm/AST/LinkageItems.h>
 #include <hlvm/Base/Assert.h>
 
 using namespace llvm; 

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

==============================================================================
--- hlvm/trunk/hlvm/AST/Function.cpp (original)
+++ hlvm/trunk/hlvm/AST/Function.cpp (removed)
@@ -1,67 +0,0 @@
-//===-- hlvm/AST/Function.cpp - AST Function Class --------------*- C++ -*-===//
-//
-//                      High Level Virtual Machine (HLVM)
-//
-// Copyright (C) 2006 Reid Spencer. All Rights Reserved.
-//
-// This software 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.1 of the License, or (at 
-// your option) any later version.
-//
-// This software 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 in the file named LICENSE.txt; if not, write to the 
-// Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
-// MA 02110-1301 USA
-//
-//===----------------------------------------------------------------------===//
-/// @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>
-#include <hlvm/Base/Assert.h>
-
-using namespace llvm;
-
-namespace hlvm {
-
-Function::~Function() 
-{
-}
-
-void 
-Function::insertChild(Node* kid)
-{
-  if (isa<SignatureType>(kid)) {
-    if (signature)
-      signature->setParent(0);
-    signature = cast<SignatureType>(kid);
-  } else if (isa<Block>(kid)) {
-    if (block)
-      block->setParent(0);
-    block = cast<Block>(kid);
-  } else {
-    hlvmAssert(!"Can't insert one of those here");
-  }
-}
-
-void 
-Function::removeChild(Node* kid)
-{
-  if (isa<SignatureType>(kid)) {
-  } else if (isa<Block>(kid)) {
-  } else {
-    hlvmAssert(!"Can't insert one of those here");
-  }
-}
-
-}

Removed: hlvm/trunk/hlvm/AST/Function.h
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/Function.h?rev=38193&view=auto

==============================================================================
--- hlvm/trunk/hlvm/AST/Function.h (original)
+++ hlvm/trunk/hlvm/AST/Function.h (removed)
@@ -1,94 +0,0 @@
-//===-- AST Function Node Interface -----------------------------*- C++ -*-===//
-//
-//                      High Level Virtual Machine (HLVM)
-//
-// Copyright (C) 2006 Reid Spencer. All Rights Reserved.
-//
-// This software 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.1 of the License, or (at 
-// your option) any later version.
-//
-// This software 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 in the file named LICENSE.txt; if not, write to the 
-// Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
-// MA 02110-1301 USA
-//
-//===----------------------------------------------------------------------===//
-/// @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_FUNCTION_H
-#define HLVM_AST_FUNCTION_H
-
-#include <hlvm/AST/LinkageItem.h>
-#include <hlvm/AST/ContainerType.h>
-#include <hlvm/AST/Block.h>
-
-namespace hlvm 
-{
-
-/// This class provides an Abstract Syntax Tree node that represents a Function.
-/// 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, optionally, a 
-/// Block of code to execute. The name of a function is used for linking 
-/// purposes. The formal arguments and return type are encapsulated in the
-/// Function's associated SignatureType. If a Block is associated with the
-/// Function then the function is defined and the Block defines the computation
-/// the Function provides. If a Block is not associated with the Function, then
-/// the function is undefined and serves as a reference to a function in another
-/// Bundle.
-/// @see Block
-/// @see Bundle
-/// @see SignatureType
-/// @brief AST Function Node
-class Function : public LinkageItem
-{
-  /// @name Constructors
-  /// @{
-  public:
-    Function(
-      NodeIDs id = FunctionID
-    ) : LinkageItem(id), block(0), signature(0) {}
-    virtual ~Function();
-
-  /// @}
-  /// @name Accessors
-  /// @{
-  public:
-    Block* getBlock() const { return block; }
-    SignatureType* getSignature() { return signature; }
-    static inline bool classof(const Function*) { return true; }
-    static inline bool classof(const Node* N) { return N->isFunction(); }
-
-  /// @}
-  /// @name Mutators
-  /// @{
-  public:
-    virtual void insertChild(Node* kid);
-    virtual void removeChild(Node* kid);
-    void setSignature(SignatureType* sig) { signature = sig; }
-    void setBlock(Block* blk) { blk->setParent(this); }
-
-  /// @}
-  /// @name Data
-  /// @{
-  protected:
-    Block * block;                   ///< The code block to be executed
-    SignatureType* signature;        ///< The function signature.
-  /// @}
-  friend class AST;
-};
-
-} // hlvm
-#endif

Modified: hlvm/trunk/hlvm/AST/InputOutput.h
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/InputOutput.h?rev=38194&r1=38193&r2=38194&view=diff

==============================================================================
--- hlvm/trunk/hlvm/AST/InputOutput.h (original)
+++ hlvm/trunk/hlvm/AST/InputOutput.h Sat Jul  7 19:01:00 2007
@@ -1,4 +1,4 @@
-//===-- AST Input/Output Operators ------------------------------*- C++ -*-===//
+//===-- AST Input/Output Operators Interface --------------------*- C++ -*-===//
 //
 //                      High Level Virtual Machine (HLVM)
 //
@@ -35,11 +35,15 @@
 namespace hlvm 
 {
 
-/// This node type represents a stream open operation. Streams can be files,
-/// sockets, or any other kind of sequential or random access media. The URL
-/// provided to the operator as its first operand determines what will get 
-/// opened and how.
-/// @brief HLVM AST Open Stream Operator
+/// This class provides an Abstract Syntax Tree node that represents a stream 
+/// open operation. Streams can be files, sockets, or any other kind of 
+/// sequential media. This operator takes one operand which is a URI indicating
+/// what should be opened. The URI specifies the resource and any parameters to
+/// indicate how the resource should be opened. The operator returns a value of
+/// type StreamType which is a built-in runtime defined opaque type.
+/// @see CloseOp
+/// @see StreamType
+/// @brief AST Open Stream Operator
 class OpenOp : public UnaryOperator
 {
   /// @name Constructors
@@ -59,10 +63,17 @@
   friend class AST;
 };
 
-/// This node type represents a stream close operation. The operand must be a
-/// value returned by the stream open operation. The associated stream is 
-/// flushed of data and closed permanently.
-/// @brief HLVM AST Close Stream Operator
+/// This class provides an Abstract Syntax Tree node that represents a stream 
+/// close operation. This operator takes one operand which must be the stream
+/// to be closed. The operand's type is StreamType which must have been 
+/// previously returned by the OpenOp operator. The operator causes all 
+/// buffers written to the stream to be flushed. After the operator completes, 
+/// the stream will no longer be available for input/output operations. This 
+/// operator returns a value of type VoidType.
+/// @see OpenOp
+/// @see StreamType
+/// @see VoidType
+/// @brief AST Close Stream Operator
 class CloseOp : public UnaryOperator
 {
   /// @name Constructors
@@ -82,10 +93,19 @@
   friend class AST;
 };
 
-/// This node type represents a stream write operation. There are three 
-/// operands: [1] the stream to write, [2] the data buffer to write, [3] the
-/// length of the data buffer.
-/// @brief HLVM AST Write Stream Operator
+/// This class provides an Abstract Syntax Tree node that represents a stream 
+/// read operation. There are two operands: [1] the stream from which data will
+/// be read and [2] the BufferType or TextType into which the data should be
+/// placed. The first operand must be of type StreamType and previously opened
+/// with the OpenOp operator. The second operand may be of BufferType or 
+/// TextType. The value of the second operand will be replaced with the data
+/// read. The previous value of the second operand, if any, is consequently
+/// discarded by this operation.
+/// @see OpenOp
+/// @see StreamType
+/// @see BufferType
+/// @see TextType
+/// @brief AST Stream Write Operator
 class ReadOp : public BinaryOperator
 {
   /// @name Constructors
@@ -105,10 +125,16 @@
   friend class AST;
 };
 
-/// This node type represents a stream write operation. There are three 
-/// operands: [1] the stream to write, [2] the data buffer to write, [3] the
-/// length of the data buffer.
-/// @brief HLVM AST Write Stream Operator
+/// This class provides an Asbstract Syntax Tree node that represents a stream 
+/// write operation. There are two operands: [1] the stream to write, and [2]
+/// the data buffer or text to write. The second operands can be either a
+/// BufferType object or a TextType object. The entire buffer or text value is
+/// written to the stream. The result of this operator is an integer value of
+/// type u64 which indicates the number of bytes actually written to the stream.
+/// @see StreamType
+/// @see BufferType
+/// @see TextType
+/// @brief AST Stream Write Operator
 class WriteOp : public BinaryOperator
 {
   /// @name Constructors

Modified: hlvm/trunk/hlvm/AST/LinkageItem.h
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/LinkageItem.h?rev=38194&r1=38193&r2=38194&view=diff

==============================================================================
--- hlvm/trunk/hlvm/AST/LinkageItem.h (original)
+++ hlvm/trunk/hlvm/AST/LinkageItem.h Sat Jul  7 19:01:00 2007
@@ -37,6 +37,7 @@
 
 /// This enumeration is used to specify the kinds of linkage that are
 /// permitted for a LinkageItem.
+/// @brief Enumeration of ways to link bundles
 enum LinkageKinds {
   ExternalLinkage,    ///< Externally visible item
   LinkOnceLinkage,    ///< Keep one copy of item when linking (inline)
@@ -45,11 +46,19 @@
   InternalLinkage     ///< Rename collisions when linking (static funcs)
 };
 
-/// This class represents an LinkageItem in the HLVM Abstract Syntax Tree. 
-/// A LinkageItem is any construct that can be linked; that is, referred to
-/// elsewhere and linked into another bundle to resolve the reference. The
-/// LinkageItem declares what kind of linkage is to be performed.
-/// @brief HLVM AST Bundle Node
+/// This class provides an Abstract Syntax Tree node that represents an item
+/// which can be linked with other Bundles. LinkageItem is an abstract base 
+/// class and cannot be instantiated. All LinkageItem's are Constant values
+/// because they represents a runtime value that is a constant address. The
+/// value pointed to by the LinkageItem may be mutable or immutable depending
+/// on its type and options.  As the name suggests, LinkageItems participate
+/// in linkage. A Bundle referring to a name in another Bundle will only link
+/// with a LinkageItem and nothing else. There are several ways in which 
+/// LinkageItems can be linked together, specified by the LinkageKinds value.
+/// @see LinkageKinds
+/// @see Bundle
+/// @see Constant
+/// @brief AST Bundle Node
 class LinkageItem : public Constant
 {
   /// @name Constructors

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

==============================================================================
--- hlvm/trunk/hlvm/AST/LinkageItems.cpp (added)
+++ hlvm/trunk/hlvm/AST/LinkageItems.cpp Sat Jul  7 19:01:00 2007
@@ -0,0 +1,77 @@
+//===-- AST Linkage Items Implementation ------------------------*- C++ -*-===//
+//
+//                      High Level Virtual Machine (HLVM)
+//
+// Copyright (C) 2006 Reid Spencer. All Rights Reserved.
+//
+// This software 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.1 of the License, or (at 
+// your option) any later version.
+//
+// This software 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 in the file named LICENSE.txt; if not, write to the 
+// Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+// MA 02110-1301 USA
+//
+//===----------------------------------------------------------------------===//
+/// @file hlvm/AST/LinkageItems.cpp
+/// @author Reid Spencer <rspencer at reidspencer.com> (original author)
+/// @date 2006/05/04
+/// @since 0.1.0
+/// @brief Implements the subclasses of LinkageItem
+//===----------------------------------------------------------------------===//
+
+#include <hlvm/AST/LinkageItems.h>
+#include <hlvm/AST/Block.h>
+#include <hlvm/Base/Assert.h>
+#include <llvm/Support/Casting.h>
+
+using namespace llvm;
+
+namespace hlvm {
+
+Variable::~Variable()
+{
+}
+
+Function::~Function() 
+{
+}
+
+void 
+Function::insertChild(Node* kid)
+{
+  if (isa<SignatureType>(kid)) {
+    if (signature)
+      signature->setParent(0);
+    signature = cast<SignatureType>(kid);
+  } else if (isa<Block>(kid)) {
+    if (block)
+      block->setParent(0);
+    block = cast<Block>(kid);
+  } else {
+    hlvmAssert(!"Can't insert one of those here");
+  }
+}
+
+void 
+Function::removeChild(Node* kid)
+{
+  if (isa<SignatureType>(kid)) {
+  } else if (isa<Block>(kid)) {
+  } else {
+    hlvmAssert(!"Can't insert one of those here");
+  }
+}
+
+Program::~Program()
+{
+}
+
+}

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

==============================================================================
--- hlvm/trunk/hlvm/AST/LinkageItems.h (added)
+++ hlvm/trunk/hlvm/AST/LinkageItems.h Sat Jul  7 19:01:00 2007
@@ -0,0 +1,181 @@
+//===-- AST Linkage Items Interface -----------------------------*- C++ -*-===//
+//
+//                      High Level Virtual Machine (HLVM)
+//
+// Copyright (C) 2006 Reid Spencer. All Rights Reserved.
+//
+// This software 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.1 of the License, or (at 
+// your option) any later version.
+//
+// This software 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 in the file named LICENSE.txt; if not, write to the 
+// Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+// MA 02110-1301 USA
+//
+//===----------------------------------------------------------------------===//
+/// @file hlvm/AST/LinkageItems.h
+/// @author Reid Spencer <rspencer at reidspencer.com> (original author)
+/// @date 2006/06/10
+/// @since 0.1.0
+/// @brief Declares the interface to all subclasses of LinkageItem
+//===----------------------------------------------------------------------===//
+
+#ifndef HLVM_AST_LINKAGEITEMS_H
+#define HLVM_AST_LINKAGEITEMS_H
+
+#include <hlvm/AST/LinkageItem.h>
+#include <hlvm/AST/ContainerType.h>
+#include <hlvm/AST/Block.h>
+
+namespace hlvm 
+{
+
+class Type; // Forward declare
+class Constant;
+
+/// This class provides an Abstract Syntax Tree node that represents a 
+/// global Variable.  A Variable can only be declared as a component of a 
+/// Bundle. It is visible throughout the Bundle that declares it and may 
+/// be a candidate for linkage with other Bundles. A Variable is a storage 
+/// location, with an address, of a specific type. Global variables may have
+/// a constant value in which case HLVM will ensure that the value of the
+/// global variable is immutable. Variables can be of any type except VoidType.
+/// @see LinkageItem
+/// @see Bundle
+/// @brief AST Variable Node
+class Variable : public LinkageItem
+{
+  /// @name Constructors
+  /// @{
+  protected:
+    Variable() : LinkageItem(VariableID) {}
+  public:
+    virtual ~Variable();
+
+  /// @}
+  /// @name Accessors
+  /// @{
+  public:
+    bool isConstant() const { return isConst; }
+    Constant* getInitializer() { return init; }
+    static inline bool classof(const Variable*) { return true; }
+    static inline bool classof(const Node* N) { return N->is(VariableID); }
+
+  /// @}
+  /// @name Mutators
+  /// @{
+  public:
+    void setIsConstant(bool v) { isConst = v; }
+    void setInitializer(Constant* C) { init = C; }
+
+  /// @}
+  /// @name Data
+  /// @{
+  protected:
+    Constant* init;
+    bool isConst;
+  /// @}
+  friend class AST;
+};
+
+/// This class provides an Abstract Syntax Tree node that represents a Function.
+/// 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, optionally, a 
+/// Block of code to execute. The name of a function is used for linking 
+/// purposes. The formal arguments and return type are encapsulated in the
+/// Function's associated SignatureType. If a Block is associated with the
+/// Function then the function is defined and the Block defines the computation
+/// the Function provides. If a Block is not associated with the Function, then
+/// the function is undefined and serves as a reference to a function in another
+/// Bundle.
+/// @see Block
+/// @see Bundle
+/// @see SignatureType
+/// @brief AST Function Node
+class Function : public LinkageItem
+{
+  /// @name Constructors
+  /// @{
+  public:
+    Function(
+      NodeIDs id = FunctionID
+    ) : LinkageItem(id), block(0), signature(0) {}
+    virtual ~Function();
+
+  /// @}
+  /// @name Accessors
+  /// @{
+  public:
+    Block* getBlock() const { return block; }
+    SignatureType* getSignature() { return signature; }
+    static inline bool classof(const Function*) { return true; }
+    static inline bool classof(const Node* N) { return N->isFunction(); }
+
+  /// @}
+  /// @name Mutators
+  /// @{
+  public:
+    virtual void insertChild(Node* kid);
+    virtual void removeChild(Node* kid);
+    void setSignature(SignatureType* sig) { signature = sig; }
+    void setBlock(Block* blk) { blk->setParent(this); }
+
+  /// @}
+  /// @name Data
+  /// @{
+  protected:
+    Block * block;                   ///< The code block to be executed
+    SignatureType* signature;        ///< The function signature.
+  /// @}
+  friend class AST;
+};
+
+class Block; // Forward declare
+class SignatureType;  // Forward declare
+
+/// This class provides an Abstract Syntax Tree node that represents a Program 
+/// in HLVM. A Program is an entry point for running HLVM programs. It is 
+/// simply a Function with a specific signature. It represents the first
+/// function to be executed by the runtime after option processing.  To be
+/// executable, a Bundle must have at least one Program node in it. 
+/// The Program node exists to simply ensure that the signature of the function
+/// is correct and to serve as a way to identify Program's quickly.
+/// @see Function
+/// @see Bundle
+/// @see SignatureType
+/// @brief AST Program Node
+class Program : public Function
+{
+  /// @name Constructors
+  /// @{
+  protected:
+    Program() : Function(ProgramID) {}
+      
+    virtual ~Program();
+
+  /// @}
+  /// @name Accessors
+  /// @{
+  public:
+    static inline bool classof(const Program*) { return true; }
+    static inline bool classof(const Node* N) { return N->is(ProgramID); }
+
+  /// @}
+  /// @name Data
+  /// @{
+  private:
+    LinkageItem::setLinkageKind;
+  /// @}
+  friend class AST;
+};
+
+} // end hlvm namespace
+#endif

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

==============================================================================
--- hlvm/trunk/hlvm/AST/Program.cpp (original)
+++ hlvm/trunk/hlvm/AST/Program.cpp (removed)
@@ -1,37 +0,0 @@
-//===-- AST Program Class ---------------------------------------*- C++ -*-===//
-//
-//                      High Level Virtual Machine (HLVM)
-//
-// Copyright (C) 2006 Reid Spencer. All Rights Reserved.
-//
-// This software 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.1 of the License, or (at 
-// your option) any later version.
-//
-// This software 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 in the file named LICENSE.txt; if not, write to the 
-// Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
-// MA 02110-1301 USA
-//
-//===----------------------------------------------------------------------===//
-/// @file hlvm/AST/Program.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>
-
-using namespace hlvm;
-
-Program::~Program()
-{
-}

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

==============================================================================
--- hlvm/trunk/hlvm/AST/Program.h (original)
+++ hlvm/trunk/hlvm/AST/Program.h (removed)
@@ -1,74 +0,0 @@
-//===-- AST Program Class ---------------------------------------*- C++ -*-===//
-//
-//                      High Level Virtual Machine (HLVM)
-//
-// Copyright (C) 2006 Reid Spencer. All Rights Reserved.
-//
-// This software 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.1 of the License, or (at 
-// your option) any later version.
-//
-// This software 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 in the file named LICENSE.txt; if not, write to the 
-// Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
-// MA 02110-1301 USA
-//
-//===----------------------------------------------------------------------===//
-/// @file hlvm/AST/Program.h
-/// @author Reid Spencer <reid at hlvm.org> (original author)
-/// @date 2006/05/04
-/// @since 0.1.0
-/// @brief Declares the class hlvm::AST::Program
-//===----------------------------------------------------------------------===//
-
-#ifndef HLVM_AST_PROGRAM_H
-#define HLVM_AST_PROGRAM_H
-
-#include <hlvm/AST/Function.h>
-
-namespace hlvm 
-{
-
-class Block; // Forward declare
-class SignatureType;  // 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. The Program node is simply introduced
-/// to ensure the signature of the function is correct and to serve as a way
-/// to identify Program's quickly.
-/// @brief HLVM AST Function Node
-class Program : public Function
-{
-  /// @name Constructors
-  /// @{
-  protected:
-    Program() : Function(ProgramID) {}
-      
-    virtual ~Program();
-
-  /// @}
-  /// @name Accessors
-  /// @{
-  public:
-    static inline bool classof(const Program*) { return true; }
-    static inline bool classof(const Node* N) { return N->is(ProgramID); }
-
-  /// @}
-  /// @name Data
-  /// @{
-  private:
-    LinkageItem::setLinkageKind;
-  /// @}
-  friend class AST;
-};
-
-} // hlvm
-#endif

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

==============================================================================
--- hlvm/trunk/hlvm/AST/Variable.cpp (original)
+++ hlvm/trunk/hlvm/AST/Variable.cpp (removed)
@@ -1,40 +0,0 @@
-//===-- AST Variable Class --------------------------------------*- C++ -*-===//
-//
-//                      High Level Virtual Machine (HLVM)
-//
-// Copyright (C) 2006 Reid Spencer. All Rights Reserved.
-//
-// This software 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.1 of the License, or (at 
-// your option) any later version.
-//
-// This software 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 in the file named LICENSE.txt; if not, write to the 
-// Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
-// MA 02110-1301 USA
-//
-//===----------------------------------------------------------------------===//
-/// @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>
-#include <hlvm/AST/Block.h>
-#include <llvm/Support/Casting.h>
-
-namespace hlvm {
-
-Variable::~Variable()
-{
-}
-
-}

Removed: hlvm/trunk/hlvm/AST/Variable.h
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/Variable.h?rev=38193&view=auto

==============================================================================
--- hlvm/trunk/hlvm/AST/Variable.h (original)
+++ hlvm/trunk/hlvm/AST/Variable.h (removed)
@@ -1,83 +0,0 @@
-//===-- AST Variable Class --------------------------------------*- C++ -*-===//
-//
-//                      High Level Virtual Machine (HLVM)
-//
-// Copyright (C) 2006 Reid Spencer. All Rights Reserved.
-//
-// This software 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.1 of the License, or (at 
-// your option) any later version.
-//
-// This software 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 in the file named LICENSE.txt; if not, write to the 
-// Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
-// MA 02110-1301 USA
-//
-//===----------------------------------------------------------------------===//
-/// @file hlvm/AST/Variable.h
-/// @author Reid Spencer <reid at hlvm.org> (original author)
-/// @date 2006/05/04
-/// @since 0.1.0
-/// @brief Declares the class hlvm::AST::Variable
-//===----------------------------------------------------------------------===//
-
-#ifndef HLVM_AST_VARIABLE_H
-#define HLVM_AST_VARIABLE_H
-
-#include <hlvm/AST/LinkageItem.h>
-
-namespace hlvm 
-{
-
-class Type; // Forward declare
-class Constant;
-
-/// This class represents an Variable in the HLVM Abstract Syntax Tree.  
-/// A Variable is a storage location of a specific type. It can either be
-/// global or local, depending on its parent. Global variables are always
-/// contained in a Bundle. Local variables are always contained in a
-/// Function.
-/// @brief HLVM AST Variable Node
-class Variable : public LinkageItem
-{
-  /// @name Constructors
-  /// @{
-  protected:
-    Variable() : LinkageItem(VariableID) {}
-  public:
-    virtual ~Variable();
-
-  /// @}
-  /// @name Accessors
-  /// @{
-  public:
-    bool isConstant() const { return isConst; }
-    Constant* getInitializer() { return init; }
-    static inline bool classof(const Variable*) { return true; }
-    static inline bool classof(const Node* N) { return N->is(VariableID); }
-
-  /// @}
-  /// @name Mutators
-  /// @{
-  public:
-    void setIsConstant(bool v) { isConst = v; }
-    void setInitializer(Constant* C) { init = C; }
-
-  /// @}
-  /// @name Data
-  /// @{
-  protected:
-    Constant* init;
-    bool isConst;
-  /// @}
-  friend class AST;
-};
-
-} // hlvm 
-#endif

Modified: hlvm/trunk/hlvm/CodeGen/LLVMGenerator.cpp
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/CodeGen/LLVMGenerator.cpp?rev=38194&r1=38193&r2=38194&view=diff

==============================================================================
--- hlvm/trunk/hlvm/CodeGen/LLVMGenerator.cpp (original)
+++ hlvm/trunk/hlvm/CodeGen/LLVMGenerator.cpp Sat Jul  7 19:01:00 2007
@@ -32,9 +32,7 @@
 #include <hlvm/AST/Bundle.h>
 #include <hlvm/AST/Documentation.h>
 #include <hlvm/AST/ContainerType.h>
-#include <hlvm/AST/Variable.h>
-#include <hlvm/AST/Program.h>
-#include <hlvm/AST/Block.h>
+#include <hlvm/AST/LinkageItems.h>
 #include <hlvm/AST/ControlFlow.h>
 #include <hlvm/AST/MemoryOps.h>
 #include <hlvm/AST/InputOutput.h>

Modified: hlvm/trunk/hlvm/Pass/Pass.cpp
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/Pass/Pass.cpp?rev=38194&r1=38193&r2=38194&view=diff

==============================================================================
--- hlvm/trunk/hlvm/Pass/Pass.cpp (original)
+++ hlvm/trunk/hlvm/Pass/Pass.cpp Sat Jul  7 19:01:00 2007
@@ -31,8 +31,7 @@
 #include <hlvm/AST/AST.h>
 #include <hlvm/AST/Bundle.h>
 #include <hlvm/AST/ContainerType.h>
-#include <hlvm/AST/Program.h>
-#include <hlvm/AST/Variable.h>
+#include <hlvm/AST/LinkageItems.h>
 #include <hlvm/Base/Assert.h>
 
 using namespace hlvm;

Modified: hlvm/trunk/hlvm/Pass/Validate.cpp
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/Pass/Validate.cpp?rev=38194&r1=38193&r2=38194&view=diff

==============================================================================
--- hlvm/trunk/hlvm/Pass/Validate.cpp (original)
+++ hlvm/trunk/hlvm/Pass/Validate.cpp Sat Jul  7 19:01:00 2007
@@ -31,8 +31,7 @@
 #include <hlvm/Base/Assert.h>
 #include <hlvm/AST/ContainerType.h>
 #include <hlvm/AST/Bundle.h>
-#include <hlvm/AST/Variable.h>
-#include <hlvm/AST/Program.h>
+#include <hlvm/AST/LinkageItems.h>
 #include <llvm/Support/Casting.h>
 #include <iostream>
 

Modified: hlvm/trunk/hlvm/Reader/XMLReader.cpp
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/Reader/XMLReader.cpp?rev=38194&r1=38193&r2=38194&view=diff

==============================================================================
--- hlvm/trunk/hlvm/Reader/XMLReader.cpp (original)
+++ hlvm/trunk/hlvm/Reader/XMLReader.cpp Sat Jul  7 19:01:00 2007
@@ -35,9 +35,7 @@
 #include <hlvm/AST/Bundle.h>
 #include <hlvm/AST/ContainerType.h>
 #include <hlvm/AST/Documentation.h>
-#include <hlvm/AST/Function.h>
-#include <hlvm/AST/Variable.h>
-#include <hlvm/AST/Program.h>
+#include <hlvm/AST/LinkageItems.h>
 #include <hlvm/AST/Constants.h>
 #include <hlvm/AST/ControlFlow.h>
 #include <hlvm/AST/MemoryOps.h>

Modified: hlvm/trunk/hlvm/Writer/XMLWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/Writer/XMLWriter.cpp?rev=38194&r1=38193&r2=38194&view=diff

==============================================================================
--- hlvm/trunk/hlvm/Writer/XMLWriter.cpp (original)
+++ hlvm/trunk/hlvm/Writer/XMLWriter.cpp Sat Jul  7 19:01:00 2007
@@ -32,9 +32,8 @@
 #include <hlvm/AST/Bundle.h>
 #include <hlvm/AST/Documentation.h>
 #include <hlvm/AST/ContainerType.h>
-#include <hlvm/AST/Variable.h>
+#include <hlvm/AST/LinkageItems.h>
 #include <hlvm/AST/Constants.h>
-#include <hlvm/AST/Program.h>
 #include <hlvm/AST/Block.h>
 #include <hlvm/AST/ControlFlow.h>
 #include <hlvm/AST/MemoryOps.h>





More information about the llvm-commits mailing list