From rspencer at reidspencer.com Mon Jul 24 00:09:56 2006 From: rspencer at reidspencer.com (rspencer at reidspencer.com) Date: Mon, 24 Jul 2006 00:09:56 -0700 Subject: [hlvm-commits] r425 - docs Message-ID: <200607240709.k6O79unU027814@server1.hlvm.org> Author: reid Date: 2006-07-24 00:09:56 -0700 (Mon, 24 Jul 2006) New Revision: 425 Log: Make the notice about disk space more prominent. Modified: docs/DevelopersGuide.html Modified: docs/DevelopersGuide.html =================================================================== --- docs/DevelopersGuide.html 2006-07-21 05:48:15 UTC (rev 424) +++ docs/DevelopersGuide.html 2006-07-24 07:09:56 UTC (rev 425) @@ -376,9 +376,11 @@ of these things or it will wreak havoc on your system. So, we suggest that you start with a fresh directory. In the discussion that follows, we'll call it /proj (that's what Reid uses). But, it could be anything you want, - as long as its new. ~/hlvm would work just as well. Choosing the - disk location for this should not be taken lightly. You will need upwards of - 40GB of storage to build all this software.
+ as long as its new. ~/hlvm would work just as well. +IMPORTANT: Choosing the disk location for these + builds should not be taken lightly. You will need upwards of 40GB of storage + on a 32-bit machine to build all this software. Don't assume your home + directory has enough space!
Once you've found a suitable location for HLVM, create the following directory structure:
cd /proj From rspencer at reidspencer.com Mon Jul 24 23:05:19 2006 From: rspencer at reidspencer.com (rspencer at reidspencer.com) Date: Mon, 24 Jul 2006 23:05:19 -0700 Subject: [hlvm-commits] r426 - in hlvm: AST CodeGen Pass Reader Writer Message-ID: <200607250605.k6P65Jbi001107@server1.hlvm.org> Author: reid Date: 2006-07-24 23:05:19 -0700 (Mon, 24 Jul 2006) New Revision: 426 Log: Differentiate the index operator into getfield and getindex, the former for structures and the latter for arrays and vectors. Also make this a binary operator instead of a multi-operator. These changes remove complexity from the index operator and make the operations more atomic. Modified: hlvm/AST/AST.cpp hlvm/AST/ContainerType.h hlvm/AST/MemoryOps.cpp hlvm/AST/MemoryOps.h hlvm/AST/Node.h hlvm/CodeGen/LLVMGenerator.cpp hlvm/Pass/Validate.cpp hlvm/Reader/HLVM.rng hlvm/Reader/XMLReader.cpp hlvm/Writer/XMLWriter.cpp Modified: hlvm/AST/AST.cpp =================================================================== --- hlvm/AST/AST.cpp 2006-07-24 07:09:56 UTC (rev 425) +++ hlvm/AST/AST.cpp 2006-07-25 06:05:19 UTC (rev 426) @@ -1205,6 +1205,16 @@ template LoadOp* AST::new_UnaryOp+(Operator*op1,Bundle* B, const Locator*loc); +template GetFieldOp* +AST::new_BinaryOp (const Type*, Operator*op1,Operator*op2,const Locator*loc); +template GetFieldOp* +AST::new_BinaryOp (Operator*op1,Operator*op2,Bundle* B, const Locator*loc); + +template GetIndexOp* +AST::new_BinaryOp (const Type*, Operator*op1,Operator*op2,const Locator*loc); +template GetIndexOp* +AST::new_BinaryOp (Operator*op1,Operator*op2,Bundle* B, const Locator*loc); + // Input/Output Operators template OpenOp* AST::new_UnaryOp (const Type* Ty, Operator*op1,const Locator*loc); Modified: hlvm/AST/ContainerType.h =================================================================== --- hlvm/AST/ContainerType.h 2006-07-24 07:09:56 UTC (rev 425) +++ hlvm/AST/ContainerType.h 2006-07-25 06:05:19 UTC (rev 426) @@ -267,6 +267,7 @@ /// @{ public: virtual const char* getPrimitiveName() const; + const NamedType* getField(unsigned index) const { return contents[index]; } /// 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) { Modified: hlvm/AST/MemoryOps.cpp =================================================================== --- hlvm/AST/MemoryOps.cpp 2006-07-24 07:09:56 UTC (rev 425) +++ hlvm/AST/MemoryOps.cpp 2006-07-25 06:05:19 UTC (rev 426) @@ -35,6 +35,7 @@ StoreOp::~StoreOp() {} AutoVarOp::~AutoVarOp() {} ReferenceOp::~ReferenceOp() {} -IndexOp::~IndexOp() {} +GetIndexOp::~GetIndexOp() {} +GetFieldOp::~GetFieldOp() {} } Modified: hlvm/AST/MemoryOps.h =================================================================== --- hlvm/AST/MemoryOps.h 2006-07-24 07:09:56 UTC (rev 425) +++ hlvm/AST/MemoryOps.h 2006-07-25 06:05:19 UTC (rev 426) @@ -253,32 +253,29 @@ }; /// This class provides an Abstract Syntax Tree node that represents an operator -/// for indexing into a ContainerType. The Index operator can have many -/// operands but in all cases requires at least two. The first operand must -/// resolve to the address of a memory location, such as returned by the -/// ReferenceOp. The second and subsequent operands must all be of integer type. -/// They specify which elements of the memory object should be indexed. This -/// operator is the means by which the elements of memory objects of type -/// PointerType, ArrayType, VectorType, StructureType, and ContinuationType can -/// be accessed. The resulting value of the operator is the address of the -/// corresponding memory location. In the case of StructureType and -/// ContinuationType elements, the corresponding index indicates the field, in -/// declaration order, that is accessed. Field numbering begins at zero. -/// @brief AST Index Operator -class IndexOp : public MultiOperator +/// for getting the address of a field of a StructureType value. The GetFieldOp +/// takes two operands, a pointer to a memory location that must be of +/// StructureType type and a string that names the field of the structure. The +/// second operand does not have to be a constant value, but if it is not, a +/// performance penalty is incurred to look up the field. The GetFieldOp can +/// be used against a value of any StructureType subclass. The resulting value +/// of the operator is the address of the memory location corresponding to the +/// named field of the structure value. +/// @brief AST GetFieldOp Operator +class GetFieldOp : public MultiOperator { /// @name Constructors /// @{ protected: - IndexOp() : MultiOperator(IndexOpID) {} - virtual ~IndexOp(); + GetFieldOp() : MultiOperator(GetFieldOpID) {} + virtual ~GetFieldOp(); /// @} /// @name Accessors /// @{ public: - static inline bool classof(const IndexOp*) { return true; } - static inline bool classof(const Node* N) { return N->is(IndexOpID); } + static inline bool classof(const GetFieldOp*) { return true; } + static inline bool classof(const Node* N) { return N->is(GetFieldOpID); } /// @} /// @name Mutators @@ -292,6 +289,41 @@ /// @} friend class AST; }; + +/// This class provides an Abstract Syntax Tree node that represents an operator +/// for getting the address of a field of an ArrayType or VectorType value. +/// The GetIndexOp takes two operands, a pointer to a memory location that +/// must be of ArrayType or VectorType and an integer value that indexes into +/// the array or vector. The resulting value of the operator is the address of +/// the indexed memory location. +/// @brief AST GetIndexOp Operator +class GetIndexOp : public BinaryOperator +{ + /// @name Constructors + /// @{ + protected: + GetIndexOp() : BinaryOperator(GetIndexOpID) {} + virtual ~GetIndexOp(); + + /// @} + /// @name Accessors + /// @{ + public: + static inline bool classof(const GetIndexOp*) { return true; } + static inline bool classof(const Node* N) { return N->is(GetIndexOpID); } + + /// @} + /// @name Mutators + /// @{ + public: + + /// @} + /// @name Data + /// @{ + protected: + /// @} + friend class AST; +}; } // hlvm #endif Modified: hlvm/AST/Node.h =================================================================== --- hlvm/AST/Node.h 2006-07-24 07:09:56 UTC (rev 425) +++ hlvm/AST/Node.h 2006-07-25 06:05:19 UTC (rev 426) @@ -229,6 +229,8 @@ // Memory Binary Operators ReallocateOpID, ///< The Reallocate Memory Operator StoreOpID, ///< The Store Operator (store a value to a location) + GetIndexOpID, ///< The GetIndex Operator for indexing an array + GetFieldOpID, ///< The GetField Operator for indexing an structure // Binary Control Flow Operators WhileOpID, ///< While expression is true loop @@ -258,7 +260,6 @@ InvokeOpID, ///< The Invoke Operator (n operands) DispatchOpID, ///< The Object Method Dispatch Operator (n operands) CallWithContOpID, ///< The Call with Continuation Operator (n operands) - IndexOpID, ///< The Index Operator for indexing an array SwitchOpID, ///< The Switch Operator (n operands) LastMultiOperatorID = SwitchOpID, LastOperatorID = SwitchOpID, @@ -534,6 +535,8 @@ public: // Get the type of the value virtual const Type* getType() const { return type; } + template + bool typeis() const { return llvm::isa (type); } const Type* getConcreteType() const; static inline bool classof(const Value*) { return true; } Modified: hlvm/CodeGen/LLVMGenerator.cpp =================================================================== --- hlvm/CodeGen/LLVMGenerator.cpp 2006-07-24 07:09:56 UTC (rev 425) +++ hlvm/CodeGen/LLVMGenerator.cpp 2006-07-25 06:05:19 UTC (rev 426) @@ -1421,11 +1421,20 @@ } template<> void -LLVMGeneratorPass::gen(IndexOp* r) +LLVMGeneratorPass::gen(GetFieldOp* i) { + llvm::Value* location = popOperand(i->getOperand(0)); + llvm::Value* fld = popOperand(i->getOperand(1)); } template<> void +LLVMGeneratorPass::gen(GetIndexOp* i) +{ + llvm::Value* location = popOperand(i->getOperand(0)); + llvm::Value* index = popOperand(i->getOperand(1)); +} + +template<> void LLVMGeneratorPass::gen(OpenOp* o) { llvm::Value* strm = popOperand(o->getOperand(0)); @@ -1723,6 +1732,8 @@ case CloseOpID: gen(llvm::cast (n)); break; case WriteOpID: gen(llvm::cast (n)); break; case ReadOpID: gen(llvm::cast (n)); break; + case GetIndexOpID: gen(llvm::cast (n)); break; + case GetFieldOpID: gen(llvm::cast (n)); break; case BundleID: genProgramLinkage(); Modified: hlvm/Pass/Validate.cpp =================================================================== --- hlvm/Pass/Validate.cpp 2006-07-24 07:09:56 UTC (rev 425) +++ hlvm/Pass/Validate.cpp 2006-07-25 06:05:19 UTC (rev 426) @@ -296,7 +296,7 @@ ValidateImpl::checkBooleanExpression(const Operator* op) { if (checkExpression(op)) - if (!isa (op->getType())) { + if (!op->typeis ()) { error(op,std::string("Expecting boolean expression but type '") + op->getType()->getName() + "' was found"); return false; @@ -963,7 +963,7 @@ error(n,"AllocateOp's pointer type has no element type!"); } else error(n,"AllocateOp's type must be a pointer type"); - if (!llvm::isa (n->getType())) + if (!n->typeis ()) error(n,"AllocateOp's operand must be of integer type"); } } @@ -1006,13 +1006,32 @@ error(n,"Can't store to constant variable"); else if (isa (R) && cast (R)->isConstant()) error(n,"Can't store to constant automatic variable"); - } else if (const IndexOp* ref = dyn_cast (n)) { + } else if (const GetIndexOp* ref = dyn_cast (n)) { /// FIXME: Implement this + } else if (const GetFieldOp* ref = dyn_cast (n)) { + /// FIXME: Implement this } } } template<> inline void +ValidateImpl::validate(GetIndexOp* n) +{ + if (checkOperator(n,GetIndexOpID,2)) { + // FIXME: Implement check for reference on first operand + // FIXME: Implement check for integer type on second operand + } +} +template<> inline void +ValidateImpl::validate(GetFieldOp* n) +{ + if (checkOperator(n,GetFieldOpID,2)) { + // FIXME: Implement check for reference on first operand + // FIXME: Implement check for string type on second operand + } +} + +template<> inline void ValidateImpl::validate(AutoVarOp* n) { if (checkOperator(n,AutoVarOpID,0,false)) { @@ -1632,6 +1651,8 @@ case SwitchOpID: validate(cast (n)); break; case LoadOpID: validate(cast (n)); break; case StoreOpID: validate(cast (n)); break; + case GetIndexOpID: validate(cast (n)); break; + case GetFieldOpID: validate(cast (n)); break; case AllocateOpID: validate(cast (n)); break; case DeallocateOpID: validate(cast (n)); break; case ReallocateOpID: /*validate(cast (n));*/ break; Modified: hlvm/Reader/HLVM.rng =================================================================== --- hlvm/Reader/HLVM.rng 2006-07-24 07:09:56 UTC (rev 425) +++ hlvm/Reader/HLVM.rng 2006-07-25 06:05:19 UTC (rev 426) @@ -711,7 +711,8 @@ - - + + @@ -760,7 +761,8 @@ @@ -816,7 +818,8 @@ - + + - + + @@ -845,16 +848,22 @@ - + + ++ - - - + ++ + + + +Modified: hlvm/Reader/XMLReader.cpp =================================================================== --- hlvm/Reader/XMLReader.cpp 2006-07-24 07:09:56 UTC (rev 425) +++ hlvm/Reader/XMLReader.cpp 2006-07-25 06:05:19 UTC (rev 426) @@ -1294,6 +1294,8 @@ case TKN_call: op = parseMultiOp (cur); break; case TKN_store: op = parseBinaryOp (cur); break; case TKN_load: op = parseUnaryOp (cur); break; + case TKN_getidx: op = parseBinaryOp (cur); break; + case TKN_getfld: op = parseBinaryOp (cur); break; case TKN_open: op = parseUnaryOp (cur); break; case TKN_write: op = parseBinaryOp (cur); break; case TKN_close: op = parseUnaryOp (cur); break; Modified: hlvm/Writer/XMLWriter.cpp =================================================================== --- hlvm/Writer/XMLWriter.cpp 2006-07-24 07:09:56 UTC (rev 425) +++ hlvm/Writer/XMLWriter.cpp 2006-07-25 06:05:19 UTC (rev 426) @@ -979,6 +979,20 @@ } template<> void +XMLWriterImpl::WriterPass::put(const GetFieldOp* r) +{ + startElement("getfld"); + putDoc(r); +} + +template<> void +XMLWriterImpl::WriterPass::put(const GetIndexOp* r) +{ + startElement("getidx"); + putDoc(r); +} + +template<> void XMLWriterImpl::WriterPass::put(const LoadOp* r) { startElement("load"); @@ -1118,6 +1132,8 @@ case ResultOpID: put(cast (n)); break; case CallOpID: put(cast (n)); break; case StoreOpID: put(cast (n)); break; + case GetFieldOpID: put(cast (n)); break; + case GetIndexOpID: put(cast (n)); break; case LoadOpID: put(cast (n)); break; case ReferenceOpID: put(cast (n)); break; case OpenOpID: put(cast (n)); break; From rspencer at reidspencer.com Tue Jul 25 10:22:24 2006 From: rspencer at reidspencer.com (rspencer at reidspencer.com) Date: Tue, 25 Jul 2006 10:22:24 -0700 Subject: [hlvm-commits] r427 - docs Message-ID: <200607251722.k6PHMOIb005958@server1.hlvm.org> Author: reid Date: 2006-07-25 10:22:24 -0700 (Tue, 25 Jul 2006) New Revision: 427 Log: Put in a note about the --disable-threads option being needed. Modified: docs/DevelopersGuide.html Modified: docs/DevelopersGuide.html =================================================================== --- docs/DevelopersGuide.html 2006-07-25 06:05:19 UTC (rev 426) +++ docs/DevelopersGuide.html 2006-07-25 17:22:24 UTC (rev 427) @@ -496,9 +496,13 @@ mkdir build install cd build ../cfe/configure --prefix=/proj/llvm-gcc4/cfe/install \ - --enable-llvm=/proj/llvm/build --enable-languages=c,c++ + --enable-llvm=/proj/llvm/build --enable-languages=c,c++ --disable-threads make make install
Note that the --disable-threads option is a temporary workaround + until LLVM's PR822 (supporting weak-external linkage) is implemented. This + should be fixed by September, 2006 at which time --disable-threads won't be + needed any more.
IMPORTANT: You MUST install llvm-gcc4 into its own installation area. Do NOT be tempted to install it into /proj/install. If you do, it will overwrite your gcc 3.4.6 From rspencer at reidspencer.com Tue Jul 25 13:35:32 2006 From: rspencer at reidspencer.com (rspencer at reidspencer.com) Date: Tue, 25 Jul 2006 13:35:32 -0700 Subject: [hlvm-commits] r428 - docs Message-ID: <200607252035.k6PKZW2P006703@server1.hlvm.org> Author: reid Date: 2006-07-25 13:35:32 -0700 (Tue, 25 Jul 2006) New Revision: 428 Log: Correct the instructions for building HLVM. You need to specify the "debug" target the first time around as well as overriding the MYLLVMGCC variable (new). This works around the problems with finding llvm-gcc and llvm-gxx. Modified: docs/DevelopersGuide.html Modified: docs/DevelopersGuide.html =================================================================== --- docs/DevelopersGuide.html 2006-07-25 17:22:24 UTC (rev 427) +++ docs/DevelopersGuide.html 2006-07-25 20:35:32 UTC (rev 428) @@ -496,7 +496,8 @@ mkdir build install cd build ../cfe/configure --prefix=/proj/llvm-gcc4/cfe/install \ - --enable-llvm=/proj/llvm/build --enable-languages=c,c++ --disable-threads + --enable-llvm=/proj/llvm/build --enable-languages=c,c++ --disable-threads \ + --program-prefix=llvm- make make install
Note that the --disable-threads option is a temporary workaround @@ -532,8 +533,8 @@ cd /proj/hlvm svn co svn://hlvm.org/hlvm hlvm cd hlvm - make MYMODE=Debug MYPATH=/proj/llvm/cfe/install:/proj/install \ - MYPREFIX=/proj/install + make debug MYMODE=Debug MYPREFIX=/proj/install MYPATH=/proj/install \ + MYLLVMGCC=/proj/llvm/cfe/install/bin
You can probably use any version after 2.7. We know it works with 2.7.2 and + 3.0.1.
This package provides all XML services for HLVM. It is part of GNome and many other packages and quite stable. It should build quickly and easily for From rspencer at reidspencer.com Fri Jul 28 17:34:58 2006 From: rspencer at reidspencer.com (rspencer at reidspencer.com) Date: Fri, 28 Jul 2006 17:34:58 -0700 Subject: [hlvm-commits] r432 - docs Message-ID: <200607290034.k6T0YwGd003746@server1.hlvm.org> Author: reid Date: 2006-07-28 17:34:57 -0700 (Fri, 28 Jul 2006) New Revision: 432 Log: Plan to do the unified object model in release 0.3 Modified: docs/ReleasePlans.html Modified: docs/ReleasePlans.html =================================================================== --- docs/ReleasePlans.html 2006-07-28 05:57:45 UTC (rev 431) +++ docs/ReleasePlans.html 2006-07-29 00:34:57 UTC (rev 432) @@ -68,7 +68,7 @@