[llvm-commits] [hlvm] r38192 - in /hlvm/trunk/hlvm: AST/AST.cpp AST/Bundle.cpp AST/Bundle.h AST/ContainerType.h AST/ControlFlow.h AST/Documentation.h AST/Function.h AST/Import.cpp AST/Import.h CodeGen/LLVMGenerator.cpp Pass/ResolveTypes.h Reader/XMLReader.cpp Writer/XMLWriter.cpp

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


Author: reid
Date: Sat Jul  7 19:00:59 2007
New Revision: 38192

URL: http://llvm.org/viewvc/llvm-project?rev=38192&view=rev
Log:
More documentation upgrades. Also, merge Import.{h,cpp} into Bundle.{h,cpp}
to reduce the number of .cpp files that must be compiled.

Removed:
    hlvm/trunk/hlvm/AST/Import.cpp
    hlvm/trunk/hlvm/AST/Import.h
Modified:
    hlvm/trunk/hlvm/AST/AST.cpp
    hlvm/trunk/hlvm/AST/Bundle.cpp
    hlvm/trunk/hlvm/AST/Bundle.h
    hlvm/trunk/hlvm/AST/ContainerType.h
    hlvm/trunk/hlvm/AST/ControlFlow.h
    hlvm/trunk/hlvm/AST/Documentation.h
    hlvm/trunk/hlvm/AST/Function.h
    hlvm/trunk/hlvm/CodeGen/LLVMGenerator.cpp
    hlvm/trunk/hlvm/Pass/ResolveTypes.h
    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=38192&r1=38191&r2=38192&view=diff

==============================================================================
--- hlvm/trunk/hlvm/AST/AST.cpp (original)
+++ hlvm/trunk/hlvm/AST/AST.cpp Sat Jul  7 19:00:59 2007
@@ -30,7 +30,6 @@
 #include <hlvm/AST/AST.h>
 #include <hlvm/AST/Locator.h>
 #include <hlvm/AST/Bundle.h>
-#include <hlvm/AST/Import.h>
 #include <hlvm/AST/Documentation.h>
 #include <hlvm/AST/ContainerType.h>
 #include <hlvm/AST/Variable.h>

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

==============================================================================
--- hlvm/trunk/hlvm/AST/Bundle.cpp (original)
+++ hlvm/trunk/hlvm/AST/Bundle.cpp Sat Jul  7 19:00:59 2007
@@ -96,4 +96,8 @@
   return llvm::cast<Variable>(vars.lookup(name));
 }
 
+Import::~Import()
+{
+}
+
 }

Modified: hlvm/trunk/hlvm/AST/Bundle.h
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/Bundle.h?rev=38192&r1=38191&r2=38192&view=diff

==============================================================================
--- hlvm/trunk/hlvm/AST/Bundle.h (original)
+++ hlvm/trunk/hlvm/AST/Bundle.h Sat Jul  7 19:00:59 2007
@@ -136,5 +136,45 @@
   friend class AST;
 };
 
+/// This class provides an Abstract Syntax Tree node that represents an Import 
+/// of one Bundle into another. An Import encapsulates two data items: the URI
+/// of the Bundle that is to be imported, and a prefix by which items in that
+/// Bundle can be referenced. For example, if Bundle "Fooness" contains a 
+/// definition named "foo" then another bundle specifying an import of "Fooness"
+/// with prefix "F" can refer to "foo" in "Fooness" with "F:foo".
+/// @see Bundle
+/// @brief AST Import Node
+class Import : public Documentable
+{
+  /// @name Constructors
+  /// @{
+  protected:
+    Import() : Documentable(ImportID) {}
+
+  public:
+    virtual ~Import();
+
+  /// @}
+  /// @name Accessors
+  /// @{
+  public:
+    static inline bool classof(const Import*) { return true; }
+    static inline bool classof(const Node* N) { return N->is(ImportID); }
+
+  /// @}
+  /// @name Mutators
+  /// @{
+  public:
+    void setPrefix(const std::string& pfx) { prefix = pfx; }
+
+  /// @}
+  /// @name Data
+  /// @{
+  protected:
+    std::string prefix;
+  /// @}
+  friend class AST;
+};
+
 } // end hlvm namespace
 #endif

Modified: hlvm/trunk/hlvm/AST/ContainerType.h
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/ContainerType.h?rev=38192&r1=38191&r2=38192&view=diff

==============================================================================
--- hlvm/trunk/hlvm/AST/ContainerType.h (original)
+++ hlvm/trunk/hlvm/AST/ContainerType.h Sat Jul  7 19:00:59 2007
@@ -40,7 +40,7 @@
 /// another type. They may have multiple elements but all elements are of the
 /// same type, hence they are uniform.  This is true of types such as AliasType
 /// (a simple renaming of another type), PointerType, ArrayType, and VectorTYpe.
-/// AST Abstract Uniform Container Type Node
+/// @brief AST Abstract Uniform Container Type Node
 class UniformContainerType : public Type
 {
   /// @name Constructors
@@ -55,7 +55,7 @@
   public:
     Type* getElementType() const { return type; }
     virtual const char* getPrimitiveName() const; // asserting override
-    // Methods to support type inquiry via isa, cast, dyn_cast
+    /// Methods to support type inquiry via isa, cast, dyn_cast
     static inline bool classof(const UniformContainerType*) { return true; }
     static inline bool classof(const Type* T) { 
       return T->isUniformContainerType(); 
@@ -96,7 +96,7 @@
   /// @name Accessors
   /// @{
   public:
-    // Methods to support type inquiry via is, cast, dyn_cast
+    /// Methods to support type inquiry via is, cast, dyn_cast
     static inline bool classof(const PointerType*) { return true; }
     static inline bool classof(const Node* T) { return T->is(PointerTypeID); }
 
@@ -131,7 +131,7 @@
     /// Get the maximum size the array can grow to.
     uint64_t getMaxSize()  const { return maxSize; }
 
-    // Methods to support type inquiry via is, cast, dyn_cast
+    /// Methods to support type inquiry via is, cast, dyn_cast
     static inline bool classof(const ArrayType*) { return true; }
     static inline bool classof(const Node* T) { return T->is(ArrayTypeID); }
     
@@ -175,7 +175,7 @@
     /// Get the maximum size the array can grow to.
     uint64_t getSize()  const { return size; }
 
-    // Methods to support type inquiry via is, cast, dyn_cast
+    /// Methods to support type inquiry via is, cast, dyn_cast
     static inline bool classof(const VectorType*) { return true; }
     static inline bool classof(const Node* T) { return T->is(VectorTypeID); }
 
@@ -221,7 +221,7 @@
   /// @{
   public:
     virtual const char* getPrimitiveName() const;
-    // Methods to support type inquiry via is, cast, dyn_cast
+    /// Methods to support type inquiry via is, cast, dyn_cast
     static inline bool classof(const AliasType*) { return true; }
     static inline bool classof(const Node* T) { return T->is(AliasTypeID); }
 
@@ -256,7 +256,7 @@
   /// @{
   public:
     virtual const char* getPrimitiveName() const;
-    // Methods to support type inquiry via is, cast, dyn_cast
+    /// Methods to support type inquiry via is, cast, dyn_cast
     static inline bool classof(const DisparateContainerType*) { return true; }
     static inline bool classof(const Node* N) { 
       return N->isDisparateContainerType(); }
@@ -312,7 +312,7 @@
   /// @name Accessors
   /// @{
   public:
-    // Methods to support type inquiry via is, cast, dyn_cast
+    /// Methods to support type inquiry via is, cast, dyn_cast
     static inline bool classof(const StructureType*) { return true; }
     static inline bool classof(const Node* T) 
       { return T->is(StructureTypeID); }
@@ -351,7 +351,7 @@
   /// @name Accessors
   /// @{
   public:
-    // Methods to support type inquiry via is, cast, dyn_cast
+    /// Methods to support type inquiry via is, cast, dyn_cast
     static inline bool classof(const ContinuationType*) { return true; }
     static inline bool classof(const Node* T) 
       { return T->is(ContinuationTypeID); }
@@ -386,7 +386,7 @@
     const Type* getResultType() const { return result; }
     bool  isVarArgs() const { return varargs; }
 
-    // Methods to support type inquiry via is, cast, dyn_cast
+    /// Methods to support type inquiry via is, cast, dyn_cast
     static inline bool classof(const SignatureType*) { return true; }
     static inline bool classof(const Node* T) 
       { return T->is(SignatureTypeID); }

Modified: hlvm/trunk/hlvm/AST/ControlFlow.h
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/ControlFlow.h?rev=38192&r1=38191&r2=38192&view=diff

==============================================================================
--- hlvm/trunk/hlvm/AST/ControlFlow.h (original)
+++ hlvm/trunk/hlvm/AST/ControlFlow.h Sat Jul  7 19:00:59 2007
@@ -35,10 +35,11 @@
 namespace hlvm 
 {
 
-/// This class represents a return operator. The return operator returns from 
-/// the inner most enclosed function. It takes one operand which is the value
-/// to return to the caller.
-/// @brief HLVM AST Return Operator Node
+/// This class provides an Abstract Syntax Tree node that represents a return 
+/// operator. The return operator returns from the function that contains it.
+/// The ReturnOp takes one operand which is the value to return to the caller
+/// of the Function.
+/// @brief AST Return Operator Node
 class ReturnOp : public UnaryOperator
 {
   /// @name Constructors

Modified: hlvm/trunk/hlvm/AST/Documentation.h
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/Documentation.h?rev=38192&r1=38191&r2=38192&view=diff

==============================================================================
--- hlvm/trunk/hlvm/AST/Documentation.h (original)
+++ hlvm/trunk/hlvm/AST/Documentation.h Sat Jul  7 19:00:59 2007
@@ -35,16 +35,24 @@
 namespace hlvm 
 {
 
-/// The HLVM AST permits documentation (not just comments) to be included into
-/// the nodes of the AST. Each such block of documentation is represented by
-/// a Documentation node, implemented by this class. The content of a 
-/// documentation node is simply a block of text. The intended use is that
-/// the text contain XHTML markup. In this way, an automated documentation
-/// facility can translate the AST into XHTML documentation with perfect
-/// precision. Since the documentation node can be associated with any kind
-/// of node, this affords a complete system for documenting HLVM programs 
-/// with XHTML markup.
-/// @brief HLVM AST Function Node
+/// This class provides an Abstract Syntax Tree node that represents program
+/// documentation. Documentation nodes may be attached to any Documentable which
+/// is an abstract base class of nearly every type of AST node. This construct
+/// permits documentation (not just comments) to be included directly into the
+/// nodes of the Abstract Syntax Tree as first class objects, not just addenda.
+/// Each Documentation node simply contains a block of text that provides the
+/// documentation for the Documentable to which the Documentation is attached.
+/// The intended use is that the text contain XHTML markup. In this way, an 
+/// automated documentation facility can translate the AST into XHTML 
+/// documentation with great accuracy in associating documentation with the
+/// nodes of the AST. Since the documentation node can be associated with 
+/// nearly any kind of node, this affords a complete system for documenting 
+/// HLVM programs with XHTML markup. There is, however, no firm requirement 
+/// that XHTML be used for the documentation. Any kind of documentation that is
+/// expressible in UTF-8 notation can be accommodated including other markup
+/// languages or simple ASCII text.
+/// @see Documentable
+/// @brief AST Documentation Node
 class Documentation : public Node
 {
   /// @name Constructors

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

==============================================================================
--- hlvm/trunk/hlvm/AST/Function.h (original)
+++ hlvm/trunk/hlvm/AST/Function.h Sat Jul  7 19:00:59 2007
@@ -1,4 +1,4 @@
-//===-- AST Function Class --------------------------------------*- C++ -*-===//
+//===-- AST Function Node Interface -----------------------------*- C++ -*-===//
 //
 //                      High Level Virtual Machine (HLVM)
 //
@@ -37,12 +37,21 @@
 namespace hlvm 
 {
 
-/// This class represents a Function in the HLVM Abstract Syntax Tree.  
+/// 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 a block of
-/// code to execute.
-/// @brief HLVM AST Function Node
+/// 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

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

==============================================================================
--- hlvm/trunk/hlvm/AST/Import.cpp (original)
+++ hlvm/trunk/hlvm/AST/Import.cpp (removed)
@@ -1,38 +0,0 @@
-//===-- hlvm/AST/Import.cpp - AST Import 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/Import.cpp
-/// @author Reid Spencer <rspencer at reidspencer.org> (original author)
-/// @date 2006/05/18
-/// @since 0.1.0
-/// @brief Implements the functions of class hlvm::AST::Import.
-//===----------------------------------------------------------------------===//
-
-#include <hlvm/AST/Import.h>
-
-namespace hlvm {
-
-Import::~Import()
-{
-}
-
-}

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

==============================================================================
--- hlvm/trunk/hlvm/AST/Import.h (original)
+++ hlvm/trunk/hlvm/AST/Import.h (removed)
@@ -1,77 +0,0 @@
-//===-- AST Import 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/Import.h
-/// @author Reid Spencer <reid at hlvm.org> (original author)
-/// @date 2006/05/18
-/// @since 0.1.0
-/// @brief Declares the class hlvm::AST::Import
-//===----------------------------------------------------------------------===//
-
-#ifndef HLVM_AST_IMPORT_H
-#define HLVM_AST_IMPORT_H
-
-#include <hlvm/AST/Node.h>
-
-namespace hlvm
-{
-
-/// This class represents a Import 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
-/// code to execute.
-/// @brief HLVM AST Function Node
-class Import : public Documentable
-{
-  /// @name Constructors
-  /// @{
-  protected:
-    Import() : Documentable(ImportID) {}
-
-  public:
-    virtual ~Import();
-
-  /// @}
-  /// @name Accessors
-  /// @{
-  public:
-    static inline bool classof(const Import*) { return true; }
-    static inline bool classof(const Node* N) { return N->is(ImportID); }
-
-  /// @}
-  /// @name Mutators
-  /// @{
-  public:
-    void setPrefix(const std::string& pfx) { prefix = pfx; }
-
-  /// @}
-  /// @name Data
-  /// @{
-  protected:
-    std::string prefix;
-  /// @}
-  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=38192&r1=38191&r2=38192&view=diff

==============================================================================
--- hlvm/trunk/hlvm/CodeGen/LLVMGenerator.cpp (original)
+++ hlvm/trunk/hlvm/CodeGen/LLVMGenerator.cpp Sat Jul  7 19:00:59 2007
@@ -30,7 +30,6 @@
 #include <hlvm/CodeGen/LLVMGenerator.h>
 #include <hlvm/AST/AST.h>
 #include <hlvm/AST/Bundle.h>
-#include <hlvm/AST/Import.h>
 #include <hlvm/AST/Documentation.h>
 #include <hlvm/AST/ContainerType.h>
 #include <hlvm/AST/Variable.h>

Modified: hlvm/trunk/hlvm/Pass/ResolveTypes.h
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/Pass/ResolveTypes.h?rev=38192&r1=38191&r2=38192&view=diff

==============================================================================
--- hlvm/trunk/hlvm/Pass/ResolveTypes.h (original)
+++ hlvm/trunk/hlvm/Pass/ResolveTypes.h Sat Jul  7 19:00:59 2007
@@ -34,8 +34,6 @@
 
 namespace hlvm {
 
-using namespace AST;
-
 /// This class provides a type resolution capability. It searches for 
 /// instances of OpaqueType and resolves all their uses to the correct actual
 /// type.

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

==============================================================================
--- hlvm/trunk/hlvm/Reader/XMLReader.cpp (original)
+++ hlvm/trunk/hlvm/Reader/XMLReader.cpp Sat Jul  7 19:00:59 2007
@@ -36,7 +36,6 @@
 #include <hlvm/AST/ContainerType.h>
 #include <hlvm/AST/Documentation.h>
 #include <hlvm/AST/Function.h>
-#include <hlvm/AST/Import.h>
 #include <hlvm/AST/Variable.h>
 #include <hlvm/AST/Program.h>
 #include <hlvm/AST/Constants.h>

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

==============================================================================
--- hlvm/trunk/hlvm/Writer/XMLWriter.cpp (original)
+++ hlvm/trunk/hlvm/Writer/XMLWriter.cpp Sat Jul  7 19:00:59 2007
@@ -30,7 +30,6 @@
 #include <hlvm/Writer/XMLWriter.h>
 #include <hlvm/AST/AST.h>
 #include <hlvm/AST/Bundle.h>
-#include <hlvm/AST/Import.h>
 #include <hlvm/AST/Documentation.h>
 #include <hlvm/AST/ContainerType.h>
 #include <hlvm/AST/Variable.h>





More information about the llvm-commits mailing list