[llvm-commits] [hlvm] r38027 - in /hlvm/trunk/hlvm/AST: AST.h Bundle.cpp Makefile Node.cpp Node.h
Reid Spencer
reid at x10sys.com
Sat Jul 7 16:59:05 PDT 2007
Author: reid
Date: Sat Jul 7 18:59:05 2007
New Revision: 38027
URL: http://llvm.org/viewvc/llvm-project?rev=38027&view=rev
Log:
Add features needed for XML Reading/Writing
Modified:
hlvm/trunk/hlvm/AST/AST.h
hlvm/trunk/hlvm/AST/Bundle.cpp
hlvm/trunk/hlvm/AST/Makefile
hlvm/trunk/hlvm/AST/Node.cpp
hlvm/trunk/hlvm/AST/Node.h
Modified: hlvm/trunk/hlvm/AST/AST.h
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/AST.h?rev=38027&r1=38026&r2=38027&view=diff
==============================================================================
--- hlvm/trunk/hlvm/AST/AST.h (original)
+++ hlvm/trunk/hlvm/AST/AST.h Sat Jul 7 18:59:05 2007
@@ -30,8 +30,6 @@
#ifndef HLVM_AST_AST_H
#define HLVM_AST_AST_H
-#include <hlvm/AST/Node.h>
-
/// This namespace is for all HLVM software. It ensures that HLVM software does
/// not collide with any other software. Hopefully HLVM is not a namespace used
/// elsewhere.
@@ -41,6 +39,8 @@
/// node types of the AST are declared in this namespace.
namespace AST
{
+ class Bundle;
+
/// This class is used to hold or contain an Abstract Syntax Tree. It provides
/// those aspects of the tree that are not part of the tree itself.
/// @brief AST Container Class
@@ -55,12 +55,13 @@
/// @name Accessors
/// @{
public:
+ Bundle* getBundle() { return tree_; }
/// @}
/// @name Data
/// @{
protected:
- Node* tree_;
+ Bundle* tree_;
/// @}
};
} // AST
Modified: hlvm/trunk/hlvm/AST/Bundle.cpp
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/Bundle.cpp?rev=38027&r1=38026&r2=38027&view=diff
==============================================================================
--- hlvm/trunk/hlvm/AST/Bundle.cpp (original)
+++ hlvm/trunk/hlvm/AST/Bundle.cpp Sat Jul 7 18:59:05 2007
@@ -32,4 +32,8 @@
namespace hlvm {
namespace AST {
+Bundle::~Bundle()
+{
+}
+
}}
Modified: hlvm/trunk/hlvm/AST/Makefile
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/Makefile?rev=38027&r1=38026&r2=38027&view=diff
==============================================================================
--- hlvm/trunk/hlvm/AST/Makefile (original)
+++ hlvm/trunk/hlvm/AST/Makefile Sat Jul 7 18:59:05 2007
@@ -4,11 +4,11 @@
#
#-------------------------------------------------------------------------------
-LEVEL = ../..
-LIBRARYNAME = HLVMAST
+LEVEL := ../..
+LIBRARYNAME := HLVMAST
DONT_BUILD_RELINKED := 1
-BUILD_ARCHIVE := 1
-INSTALL_INCLUDES := Bundle.h Conditionable.h ContainerType.h Function.h \
- LinkageItem.h Node.h SymbolTable.h Type.h Variable.h
+BUILD_ARCHIVE := 1
+INSTALL_INCLUDES := Bundle.h Conditionable.h ContainerType.h Function.h \
+ LinkageItem.h Node.h SymbolTable.h Type.h Variable.h
include $(LEVEL)/Makefile.hlvm
Modified: hlvm/trunk/hlvm/AST/Node.cpp
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/Node.cpp?rev=38027&r1=38026&r2=38027&view=diff
==============================================================================
--- hlvm/trunk/hlvm/AST/Node.cpp (original)
+++ hlvm/trunk/hlvm/AST/Node.cpp Sat Jul 7 18:59:05 2007
@@ -31,8 +31,17 @@
#include <hlvm/AST/Conditionable.h>
#include <hlvm/AST/ContainerType.h>
-namespace hlvm {
-namespace AST {
+namespace hlvm { namespace AST {
+
+Node::~Node()
+{
+ removeFromTree();
+}
+
+void
+Node::removeFromTree()
+{
+}
#ifndef _NDEBUG
void
Modified: hlvm/trunk/hlvm/AST/Node.h
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/Node.h?rev=38027&r1=38026&r2=38027&view=diff
==============================================================================
--- hlvm/trunk/hlvm/AST/Node.h (original)
+++ hlvm/trunk/hlvm/AST/Node.h Sat Jul 7 18:59:05 2007
@@ -208,20 +208,41 @@
/// @name Accessors
/// @{
public:
+ /// Get the type of node
+ inline bool getID() const { return id_; }
+
+ /// Get the name of the node
+ inline const std::string& getName() { return name_; }
+
+ /// Determine if the node is a Type
inline bool isType() const {
return id_ >= FirstPrimitiveTypeID && id_ <= LastContainerTypeID;
}
+ /// Determine if the node is any of the Operators
inline bool isOperator() const {
return id_ >= FirstOperatorID && id_ <= LastOperatorID;
}
+ /// Determine if the node is a Block
inline bool isBlock() const { return id_ == BlockID; }
+ /// Determine if the node is a Bundle
inline bool isBundle() const { return id_ == BundleID; }
+ /// Determine if the node is a Function
inline bool isFunction() const { return id_ == FunctionID; }
+ /// Determine if the node is a Program
inline bool isProgram() const { return id_ == ProgramID; }
+ /// Determine if the node is a Variable
inline bool isVariable() const { return id_ == VariableID; }
+ /// Provide support for isa<X> and friends
static inline bool classof(const Node*) { return true; }
/// @}
+ /// @name Mutators
+ /// @{
+ protected:
+ void removeFromTree();
+
+
+ /// @}
/// @name Data
/// @{
protected:
More information about the llvm-commits
mailing list