From rspencer at reidspencer.com Mon Jun 19 00:26:36 2006 From: rspencer at reidspencer.com (rspencer at reidspencer.com) Date: Mon, 19 Jun 2006 01:26:36 -0400 Subject: [hlvm-commits] r300 - in docs: . status Message-ID: <200606190526.k5J5QaEi009042@sneezy.swagora.com> Author: reid Date: 2006-06-19 01:26:34 -0400 (Mon, 19 Jun 2006) New Revision: 300 Log: Fix title lines to not duplicate "HLVM" and convert all the titles to use the heading elements not div with class. Modified: docs/Credits.html docs/DevelopersGuide.html docs/FAQ.html docs/GettingStarted.html docs/OpenProjects.html docs/ReleaseNotes.html docs/ReleasePlans.html docs/index.html docs/status/2006-05-25.html docs/status/index.html Modified: docs/Credits.html =================================================================== --- docs/Credits.html 2006-06-19 04:52:49 UTC (rev 299) +++ docs/Credits.html 2006-06-19 05:26:34 UTC (rev 300) @@ -1,4 +1,4 @@ - +

HLVM Credits

This document is a partial list of the people who have given their time, Modified: docs/DevelopersGuide.html =================================================================== --- docs/DevelopersGuide.html 2006-06-19 04:52:49 UTC (rev 299) +++ docs/DevelopersGuide.html 2006-06-19 05:26:34 UTC (rev 300) @@ -1,4 +1,4 @@ - +

HLVM Developer's Guide

CAUTION: This document is a work in progress.
@@ -27,29 +27,24 @@
-

Author:Reid Spencer.

+

Author: Reid Spencer.

- -
Introduction
- +

Introduction

This document is a manual for developers who wish to contribute to the HLVM project. It covers topics such as copyright assignment, license, coding style, the build system and project rules.

- -
Contributions
- +

Contributions

Contributions to the HLVM source base are very much appreciated. If you are able to contribute source code, this section provides details about how your contributions will be handled.

- -
Copyright
+

Copyright

The founders of the HLVM project intend for a formal non-profit legal entity to be incorporated that will hold the copyright of all HLVM software. @@ -70,8 +65,7 @@

- -
License
+

License

It is the intention of the HLVM project to release the HLVM software for distribution under the terms of the Lesser General Public License (LGPL). This @@ -93,8 +87,7 @@

See below for the complete text of the LGPL license

- -
Patches
+

Patches

The HLVM group welcomes your patches. If you find something wrong with the HLVM software or you wish to make a contribution to extend HLVM, you may send @@ -118,14 +111,12 @@

- -
Build System
+

Build System

This section describes the HLVM build system.

- -
About SCONS
+

About SCONS

The HLVM project uses the scons software construction tool to orchestrate its builds. This gives us superior @@ -137,10 +128,9 @@ section.

- -
Configuring
+

Configuring

-

Configuration On Every Build

+

Configuration On Every Build

Unlike some other build systems (e.g. autoconf/automake), the configuration and construction phases of building are not separated with scons. The configuration parameters are checked every time you build. While @@ -149,7 +139,7 @@ stable. If something changes in your environment, only those pieces affected will get re-configured. This saves a lot of time and hassle by telling you of any configuration errors on the very next build.

-

The Options Cache

+

The Options Cache

Configuration parameters are specified on the scons command line. The values of these parameters are stored in the options cache which is simply a file named .options_cache in the root source directory. If the file @@ -157,7 +147,7 @@ runs, the values are loaded from this cache and used unless new values are given on the command line. In this way, you only need to specify your options once and then they "stick" from that point forward.

-

Configuration Options

+

Configuration Options

HLVM has a variety of options to assist with configuring HLVM for your environment and build choices. Each option has a default that will work in many environments but might need adjusting for your environment. The default @@ -276,7 +266,7 @@ /usr/local/bin/xsltproc -

Configuration Prompts

+

Configuration Prompts

When you first run scons against HLVM, if you did not specify the confpath option or the configuration code cannot otherwise find a package it needs, you will be prompted to enter the applicable path names @@ -288,18 +278,18 @@

-
Build Rules
+

Build Rules

This subsection describes the various build rules and extensions to SCons that HLVM uses.

-

The build python module

+

The build python module

For convenience, and to unclutter the SConscript files, the top level build directory contains a python module that provides the build facilities for HLVM. This module manipulates an SCons environment to set the variables and define the builder rules for HLVM. The public interface to this library is in the hlvm.py module. No other module should be imported into the SConscript files.

-

HLVM Builder Rules

+

HLVM Builder Rules

HLVM requires some specialized build rules beyond what SCons provides. While general construction of static libraries, shared libraries, and executables use the standard SCons builders, several more are defined in the @@ -376,8 +366,7 @@

- -
Coding Style
+

Coding Style

Contributions to HLVM must meet the following Coding Style requirements:

@@ -396,12 +385,10 @@
- -
Appendices
- +

Appendices

 
-
Lesser General Public License
+

Lesser General Public License

 		  GNU LESSER GENERAL PUBLIC LICENSE
 		       Version 2.1, February 1999

Modified: docs/FAQ.html
===================================================================
--- docs/FAQ.html	2006-06-19 04:52:49 UTC (rev 299)
+++ docs/FAQ.html	2006-06-19 05:26:34 UTC (rev 300)
@@ -1,4 +1,4 @@
-
+
 
 

HLVM Frequently Asked Questions

Here's the list of questions we get frequently. Unlike many FAQ's, this is @@ -8,12 +8,12 @@

Question Index

- -
+ +
Modified: docs/GettingStarted.html =================================================================== --- docs/GettingStarted.html 2006-06-19 04:52:49 UTC (rev 299) +++ docs/GettingStarted.html 2006-06-19 05:26:34 UTC (rev 300) @@ -1,6 +1,6 @@ - + -

Getting Started with the HLVM System

+

Getting Started with HLVM

  1. Quick Start (For The Impatient)
  2. Overview @@ -41,12 +41,7 @@

    Author: Reid Spencer.

    - - - - +

    Quick Start (For The Impatient)

    Here's the quick start for getting up and running quickly with HLVM. Note that this is for experts and the impatient only.

    @@ -67,9 +62,7 @@
- -
Overview
- +

Overview

Welcome to HLVM! This document shows you how to get started with the High Level Virtual Machine. Before you do that, lets get some questions answered up @@ -118,12 +111,8 @@

- -
Requirements
- - +

Requirements

-

Before you attempt to build HLVM, you need to understand its requirements. HLVM is non-trivial and depends on a number of other software packages. These packages will be required before you can build HLVM. Taking @@ -133,11 +122,11 @@ obtain and build these packages yourself if they are not already present on your system. HLVM won't compile or run without them.

-

Hardware

+

Hardware

HLVM supports whatever hardware LLVM supports. For details, please see LLVM's documentation

-

Software

+

Software

Compiling HLVM requires that you have several software packages installed. The table below lists those required packages. The Package column is the usual name for the software package that HLVM depends on. The Version column @@ -272,17 +261,17 @@

-
Building Other Packages
+

Building Other Packages

-

Single Separate Install Area

+

Single Separate Install Area

It is suggested that you keep a separate installation area for building the things upon which HLVM depends. This is the location in your file system where you will install the built packages. It is the parameter to the --prefix options to the configure programs of those packages. By using a separate install area, you ensure that the HLVM version of required packages doesn't interfere with any of your system installed packages.

-

libxml2

+

libxml2

-

apr

+

apr

-

apr-util

+

apr-util

-

llvm

+

llvm

-

llvm-gcc4

+

llvm-gcc4

-

gperf

+

gperf

-

deja-gnu/

+

deja-gnu/

- -
Building HLVM With SCons
- +

Building HLVM With SCons

-

Quick Start

+

Quick Start

If you took our advice and built all dependent packages (except llvm-gcc4) into a separate install area, then you can build HLVM quickly by using this command:

@@ -436,7 +423,7 @@
   be the Single Separate Install Area where you installed 
   all the other packages such as llvm, apr, apr-util, etc.

-

About SCons And HLVM

+

About SCons And HLVM

HLVM uses the SCons tool for software construction. While make and the various auto* tools were originally used, the full programming language support of SCons (Python) was attractive because of the @@ -469,7 +456,7 @@

  • Configuration options are saved in cache files so you don't have to keep repeating them on each invocation of scons
  • -

    SCons Options Supported

    +

    SCons Options Supported

    The important options that may be given on the scons command line are:

    -

    Build Targets

    +

    Build Targets

    The default build target will simply build all the libraries and tools. There are additional pseudo-targets (aliases in SCons lingo) that you can build:

    @@ -571,7 +558,7 @@

    Once you've made these adjustments you can use the various targets in the Makefile to build HLVM. Note that these targets just convert the target into the appropriate invocation of the scons command.

    -

    Targets Supported

    +

    Targets Supported

    You can use the following targets to build HLVM in various ways:

    all
    @@ -614,7 +601,7 @@ in the hlvm directory and instead descends into the tools and builds the executable tools there.
    -

    Tips And Tricks

    +

    Tips And Tricks

    -

    Current Status (Release 0.2)

    +

    Current Status (Release 0.2)

    The table below shows the status of the current release. Click the feature name to get a complete description of the feature.

    _______________________________________________ hlvm-commits mailing list hlvm-commits at hlvm.org http://hlvm.org/mailman/listinfo/hlvm-commits From rspencer at reidspencer.com Mon Jun 19 00:49:25 2006 From: rspencer at reidspencer.com (rspencer at reidspencer.com) Date: Mon, 19 Jun 2006 01:49:25 -0400 Subject: [hlvm-commits] r302 - docs Message-ID: <200606190549.k5J5nPD7009108@sneezy.swagora.com> Author: reid Date: 2006-06-19 01:49:25 -0400 (Mon, 19 Jun 2006) New Revision: 302 Log: One more shot at XHTML compliance. Modified: docs/ReleasePlans.html Modified: docs/ReleasePlans.html =================================================================== --- docs/ReleasePlans.html 2006-06-19 05:47:06 UTC (rev 301) +++ docs/ReleasePlans.html 2006-06-19 05:49:25 UTC (rev 302) @@ -7,16 +7,17 @@
    1. Introduction
    2. Release Index -
        -
      1. Upcoming Releases
      2. -
      3. Completed Releases
      4. -
    3. +
        +
      1. Upcoming Releases
      2. +
      3. Completed Releases
      4. +
      +
    4. Release Status -
        -
      1. Current Release
      2. -
      3. Previous Releases
      4. - -
    5. +
        +
      1. Current Release
      2. +
      3. Previous Releases
      4. +
      +
    6. Feature Definitions
    _______________________________________________ hlvm-commits mailing list hlvm-commits at hlvm.org http://hlvm.org/mailman/listinfo/hlvm-commits From rspencer at reidspencer.com Mon Jun 19 01:42:09 2006 From: rspencer at reidspencer.com (rspencer at reidspencer.com) Date: Mon, 19 Jun 2006 02:42:09 -0400 Subject: [hlvm-commits] r303 - docs Message-ID: <200606190642.k5J6g907012850@sneezy.swagora.com> Author: reid Date: 2006-06-19 02:42:08 -0400 (Mon, 19 Jun 2006) New Revision: 303 Log: Fix some XHTML problems. Modified: docs/GettingStarted.html Modified: docs/GettingStarted.html =================================================================== --- docs/GettingStarted.html 2006-06-19 05:49:25 UTC (rev 302) +++ docs/GettingStarted.html 2006-06-19 06:42:08 UTC (rev 303) @@ -2,8 +2,8 @@

    Getting Started with HLVM

      -
    1. Quick Start (For The Impatient) -
    2. Overview +
    3. Quick Start (For The Impatient)
    4. +
    5. Overview
    6. Requirements
      1. Hardware @@ -117,7 +117,7 @@ HLVM is non-trivial and depends on a number of other software packages. These packages will be required before you can build HLVM. Taking a moment to familiarize yourself with HLVM's requirements may save you some - time in the long run.

        + time in the long run.

        The table below shows the software that HLVM depends on. You must obtain and build these packages yourself if they are not already present on your system. HLVM won't compile or run without them.

        @@ -206,7 +206,7 @@ dejagnu 1.4.2 Test suite automation package. You only need this if you want to - run the automated test suite. + run the automated test suite. expect @@ -240,12 +240,12 @@

        Notes:

          -
        1. Certain LLVM tools are being modified to accommodate HLVM - as it progresses. Until this situation stabilizes you will be required +
        2. Certain LLVM tools are being modified to accommodate + HLVM as it progresses. Until this situation stabilizes you will be required to have a very fresh (recent) version of LLVM from the CVS sources. At some point in the future, an LLVM release will contain all the features that HLVM needs and this notice will be removed. Until then, you should - obtain and build LLVM from CVS and keep it up to date regularly.
        3. + obtain and build LLVM from CVS and keep it up to date regularly.
        _______________________________________________ hlvm-commits mailing list hlvm-commits at hlvm.org http://hlvm.org/mailman/listinfo/hlvm-commits From rspencer at reidspencer.com Mon Jun 19 01:45:31 2006 From: rspencer at reidspencer.com (rspencer at reidspencer.com) Date: Mon, 19 Jun 2006 02:45:31 -0400 Subject: [hlvm-commits] r304 - docs Message-ID: <200606190645.k5J6jVv7012868@sneezy.swagora.com> Author: reid Date: 2006-06-19 02:45:30 -0400 (Mon, 19 Jun 2006) New Revision: 304 Log: More XHTML fixes. Modified: docs/GettingStarted.html Modified: docs/GettingStarted.html =================================================================== --- docs/GettingStarted.html 2006-06-19 06:42:08 UTC (rev 303) +++ docs/GettingStarted.html 2006-06-19 06:45:30 UTC (rev 304) @@ -6,8 +6,8 @@
      2. Overview
      3. Requirements
          -
        1. Hardware -
        2. Software +
        3. Hardware
        4. +
        5. Software
      4. Building Other Packages @@ -271,7 +271,7 @@ --prefix options to the configure programs of those packages. By using a separate install area, you ensure that the HLVM version of required packages doesn't interfere with any of your system installed packages.

        -

        libxml2

        +

        libxml2

        • If your system doesn't already have a modern version of libxml2, you can generally build this quite painlessly as it doesn't depend on much @@ -345,6 +345,7 @@ runtime libraries depend on llvm-gcc3 but llvm-gcc3 depends on the LLVM tools being built. Use of llvm-gcc4 completely gets around this problem and so it is only necessary to build the LLVM tools and not the runtime library. +

        llvm-gcc4

          @@ -414,9 +415,8 @@

          Quick Start

          If you took our advice and built all dependent packages (except llvm-gcc4) into a separate install area, then you can build HLVM quickly by using this - command:

          +  command:

             scons -Q mode=debug confpath=/path/to/llvm-gcc4/install:/path/to/install
          -

          The confpath option indicates to the HLVM build system some additional places to search for software. The first path should be the location in which the llmv-gcc4 software was installed. The second path should @@ -559,7 +559,7 @@ Makefile to build HLVM. Note that these targets just convert the target into the appropriate invocation of the scons command.

          Targets Supported

          -

          You can use the following targets to build HLVM in various ways: +

          You can use the following targets to build HLVM in various ways:

          all
          Builds HLVM in the default mode, as specified by MYMODE. _______________________________________________ hlvm-commits mailing list hlvm-commits at hlvm.org http://hlvm.org/mailman/listinfo/hlvm-commits From rspencer at reidspencer.com Mon Jun 19 02:20:09 2006 From: rspencer at reidspencer.com (rspencer at reidspencer.com) Date: Mon, 19 Jun 2006 03:20:09 -0400 Subject: [hlvm-commits] r305 - docs/status Message-ID: <200606190720.k5J7K9Nt014809@sneezy.swagora.com> Author: reid Date: 2006-06-19 03:20:08 -0400 (Mon, 19 Jun 2006) New Revision: 305 Log: XHTML compliance Modified: docs/status/2006-05-25.html Modified: docs/status/2006-05-25.html =================================================================== --- docs/status/2006-05-25.html 2006-06-19 06:45:30 UTC (rev 304) +++ docs/status/2006-05-25.html 2006-06-19 07:20:08 UTC (rev 305) @@ -1,7 +1,8 @@

          Status As Of May 25, 2006

          -

          HLVM is moving along nicely. We have accomplished much in our first month: +

          HLVM is moving along nicely. We have accomplished much in our first +month:

          • A few new people became interested in HLVM (Hi laurence and Slant).
          • Everyone participated in making some design documentation in the wiki _______________________________________________ hlvm-commits mailing list hlvm-commits at hlvm.org http://hlvm.org/mailman/listinfo/hlvm-commits From rspencer at reidspencer.com Mon Jun 19 11:10:20 2006 From: rspencer at reidspencer.com (rspencer at reidspencer.com) Date: Mon, 19 Jun 2006 12:10:20 -0400 Subject: [hlvm-commits] r306 - docs hlvm/AST hlvm/Pass hlvm/Reader Message-ID: <200606191610.k5JGAK2D005242@sneezy.swagora.com> Author: reid Date: 2006-06-19 12:10:18 -0400 (Mon, 19 Jun 2006) New Revision: 306 Log: Implement more validation of AST and provide better AST construction asserts. Modified: docs/FAQ.html hlvm/AST/AST.cpp hlvm/AST/Block.cpp hlvm/AST/Bundle.cpp hlvm/AST/ContainerType.cpp hlvm/AST/Operator.cpp hlvm/Pass/Validate.cpp hlvm/Reader/XMLReader.cpp Modified: docs/FAQ.html =================================================================== --- docs/FAQ.html 2006-06-19 07:20:08 UTC (rev 305) +++ docs/FAQ.html 2006-06-19 16:10:18 UTC (rev 306) @@ -40,6 +40,7 @@ TBD TBD TBD + Optimization Offers a wide range of optimization levels from "none" to "life long". Most of this is provided by LLVM and works today. LLVM is "state of the Modified: hlvm/AST/AST.cpp =================================================================== --- hlvm/AST/AST.cpp 2006-06-19 07:20:08 UTC (rev 305) +++ hlvm/AST/AST.cpp 2006-06-19 16:10:18 UTC (rev 306) @@ -124,6 +124,10 @@ ASTImpl::insertChild(Node* child) { hlvmAssert(llvm::isa(child) && "Can't insert that here"); +#ifdef HLVM_ASSERT + for (const_iterator I = begin(), E = end(); I != E; ++I) + hlvmAssert((*I) != child && "Attempt to duplicate insertion of child"); +#endif bundles.push_back(llvm::cast(child)); } @@ -131,6 +135,7 @@ ASTImpl::removeChild(Node* child) { hlvmAssert(llvm::isa(child) && "Can't remove that here"); + //FIXME: bundles.erase(llvm::cast(child)); } Type* @@ -269,6 +274,7 @@ Bundle* result = new Bundle(); result->setLocator(loc); result->setName(id); + result->setParent(this); return result; } Modified: hlvm/AST/Block.cpp =================================================================== --- hlvm/AST/Block.cpp 2006-06-19 07:20:08 UTC (rev 305) +++ hlvm/AST/Block.cpp 2006-06-19 16:10:18 UTC (rev 306) @@ -42,11 +42,11 @@ Block::insertChild(Node* child) { hlvmAssert(llvm::isa(child)); + MultiOperator::insertChild(child); if (llvm::isa(child)) { AutoVarOp* av = llvm::cast(child); autovars[av->getName()] = av; } - MultiOperator::insertChild(child); type = getResultType(); // update type to match type of thing just added } Modified: hlvm/AST/Bundle.cpp =================================================================== --- hlvm/AST/Bundle.cpp 2006-06-19 07:20:08 UTC (rev 305) +++ hlvm/AST/Bundle.cpp 2006-06-19 16:10:18 UTC (rev 306) @@ -41,6 +41,7 @@ void Bundle::insertChild(Node* kid) { + hlvmAssert(kid && "Null child!"); if (kid->isType()) types.insert(cast(kid)->getName(), kid); else if (kid->is(VariableID)) Modified: hlvm/AST/ContainerType.cpp =================================================================== --- hlvm/AST/ContainerType.cpp 2006-06-19 07:20:08 UTC (rev 305) +++ hlvm/AST/ContainerType.cpp 2006-06-19 16:10:18 UTC (rev 306) @@ -101,6 +101,10 @@ DisparateContainerType::insertChild(Node* n) { hlvmAssert(isa(n) && "Can't insert those here"); +#ifdef HLVM_ASSERT + for (const_iterator I = begin(), E = end(); I != E; ++I) + hlvmAssert((*I) != n); +#endif contents.push_back(cast(n)); } Modified: hlvm/AST/Operator.cpp =================================================================== --- hlvm/AST/Operator.cpp 2006-06-19 07:20:08 UTC (rev 305) +++ hlvm/AST/Operator.cpp 2006-06-19 16:10:18 UTC (rev 306) @@ -102,6 +102,7 @@ UnaryOperator::insertChild(Node* child) { hlvmAssert(isa(child)); + hlvmAssert(child != op1 && "Re-insertion of child"); if (!op1) op1 = cast(child); else @@ -146,6 +147,7 @@ BinaryOperator::insertChild(Node* child) { hlvmAssert(isa(child)); + hlvmAssert(child != ops[0] && child != ops[1] && "Re-insertion of child"); if (!ops[0]) ops[0] = cast(child); else if (!ops[1]) @@ -194,6 +196,8 @@ TernaryOperator::insertChild(Node* child) { hlvmAssert(isa(child)); + hlvmAssert(child != ops[0] && child != ops[1] && child != ops[2] && + "Re-insertion of child"); if (!ops[0]) ops[0] = cast(child); else if (!ops[1]) @@ -257,6 +261,10 @@ MultiOperator::insertChild(Node* child) { hlvmAssert(isa(child)); +#ifdef HLVM_ASSERT + for (const_iterator I = begin(), E = end(); I != E; ++I) + hlvmAssert((*I) != child && "Re-insertion of child"); +#endif ops.push_back(cast(child)); } Modified: hlvm/Pass/Validate.cpp =================================================================== --- hlvm/Pass/Validate.cpp 2006-06-19 07:20:08 UTC (rev 305) +++ hlvm/Pass/Validate.cpp 2006-06-19 16:10:18 UTC (rev 306) @@ -156,7 +156,12 @@ bool ValidateImpl::checkConstant(Constant* C,NodeIDs id) { - return checkValue(C,id); + if (checkValue(C,id)) { + if (C->getName().empty()) + error(C,"Constants must not have empty name"); + return false; + } + return true; } bool @@ -283,6 +288,12 @@ } template<> inline void +ValidateImpl::validate(OpaqueType* n) +{ + checkType(n,OpaqueTypeID); +} + +template<> inline void ValidateImpl::validate(RangeType* n) { if (checkType(n,RangeTypeID)) @@ -313,9 +324,9 @@ } template<> inline void -ValidateImpl::validate(OpaqueType* n) +ValidateImpl::validate(StringType* n) { - checkType(n,OpaqueTypeID); + checkType(n,StringTypeID); } template<> inline void @@ -379,9 +390,55 @@ } template<> inline void +ValidateImpl::validate(ConstantBoolean* n) +{ + checkConstant(n,ConstantBooleanID); +} + +template<> inline void +ValidateImpl::validate(ConstantInteger* n) +{ + checkConstant(n,ConstantIntegerID); + // FIXME: validate that the constant value is in the right numeric base + // FIXME: validate that the constant value is in range for the type +} + +template<> inline void +ValidateImpl::validate(ConstantReal* n) +{ + checkConstant(n,ConstantRealID); + // FIXME: validate that the constant value is in range for the type +} + +template<> inline void +ValidateImpl::validate(ConstantString* n) +{ + if (checkConstant(n,ConstantStringID)) + if (std::string::npos != n->getValue().find('\0')) + error(n,"String constants may not contain a null byte"); +} + +template<> inline void +ValidateImpl::validate(ConstantAggregate* n) +{ + checkConstant(n,ConstantAggregateID); + // FIXME: validate fields vs. type +} + +template<> inline void +ValidateImpl::validate(ConstantExpression* n) +{ + checkConstant(n,ConstantExpressionID); + // FIXME: validate opcodes and operands +} + +template<> inline void ValidateImpl::validate(Variable* n) { - checkLinkageItem(n, VariableID); + if (checkLinkageItem(n, VariableID)) + if (n->hasInitializer()) + if (n->getType() != n->getInitializer()->getType()) + error(n,"Variable and its initializer do not agree in type"); } template<> inline void @@ -537,8 +594,18 @@ const Type* Ty2 = n->getOperand(1)->getType(); if (!isa(Ty1)) error(n,"StoreOp expects first operand to be pointer type"); - else if (cast(Ty1)->getElementType() != Ty2) + else if (cast(Ty1)->getElementType() != Ty2) { error(n,"StoreOp operands do not agree in type"); + } else if (const ReferenceOp* ref = + dyn_cast(n->getOperand(0))) { + const Value* R = ref->getReferent(); + if (isa(R) && cast(R)->isConstant()) + 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)) { + /// FIXME: Implement this + } } } @@ -555,6 +622,20 @@ } template<> inline void +ValidateImpl::validate(ReferenceOp* op) +{ + checkOperator(op,ReferenceOpID,0,true); + /// FIXME: check referent out +} + +template<> inline void +ValidateImpl::validate(ConstantReferenceOp* op) +{ + checkOperator(op,ConstantReferenceOpID,0,true); + /// FIXME: check referent out +} + +template<> inline void ValidateImpl::validate(NegateOp* n) { if (checkOperator(n,NegateOpID,1)) { @@ -836,123 +917,177 @@ template<> inline void ValidateImpl::validate(IsPInfOp* n) { - if (checkOperator(n,IsPInfOpID,1)) - ; + if (checkOperator(n,IsPInfOpID,1)) { + const Type* Ty1 = n->getOperand(0)->getType(); + if (!Ty1->isRealType()) + error(n,"IsPInfoOp requires real number operand"); + } } template<> inline void ValidateImpl::validate(IsNInfOp* n) { - if (checkOperator(n,IsNInfOpID,1)) - ; + if (checkOperator(n,IsNInfOpID,1)) { + const Type* Ty1 = n->getOperand(0)->getType(); + if (!Ty1->isRealType()) + error(n,"IsPInfoOp requires real number operand"); + } } template<> inline void ValidateImpl::validate(IsNanOp* n) { - if (checkOperator(n,IsNanOpID,1)) - ; + if (checkOperator(n,IsNanOpID,1)) { + const Type* Ty1 = n->getOperand(0)->getType(); + if (!Ty1->isRealType()) + error(n,"IsNanOp requires real number operand"); + } } template<> inline void ValidateImpl::validate(TruncOp* n) { - if (checkOperator(n,TruncOpID,1)) - ; + if (checkOperator(n,TruncOpID,1)) { + const Type* Ty1 = n->getOperand(0)->getType(); + if (!Ty1->isRealType()) + error(n,"TruncOp requires real number operand"); + } } template<> inline void ValidateImpl::validate(RoundOp* n) { - if (checkOperator(n,RoundOpID,1)) - ; + if (checkOperator(n,RoundOpID,1)) { + const Type* Ty1 = n->getOperand(0)->getType(); + if (!Ty1->isRealType()) + error(n,"RoundOp requires real number operand"); + } } template<> inline void ValidateImpl::validate(FloorOp* n) { - if (checkOperator(n,FloorOpID,1)) - ; + if (checkOperator(n,FloorOpID,1)) { + const Type* Ty1 = n->getOperand(0)->getType(); + if (!Ty1->isRealType()) + error(n,"FloorOp requires real number operand"); + } } template<> inline void ValidateImpl::validate(CeilingOp* n) { - if (checkOperator(n,CeilingOpID,1)) - ; + if (checkOperator(n,CeilingOpID,1)) { + const Type* Ty1 = n->getOperand(0)->getType(); + if (!Ty1->isRealType()) + error(n,"CeilingOp requires real number operand"); + } } template<> inline void ValidateImpl::validate(LogEOp* n) { - if (checkOperator(n,LogEOpID,1)) - ; + if (checkOperator(n,LogEOpID,1)) { + const Type* Ty1 = n->getOperand(0)->getType(); + if (!Ty1->isRealType()) + error(n,"LogEOpID requires real number operand"); + } } template<> inline void ValidateImpl::validate(Log2Op* n) { - if (checkOperator(n,Log2OpID,1)) - ; + if (checkOperator(n,Log2OpID,1)) { + const Type* Ty1 = n->getOperand(0)->getType(); + if (!Ty1->isRealType()) + error(n,"Log2OpID requires real number operand"); + } } template<> inline void ValidateImpl::validate(Log10Op* n) { - if (checkOperator(n,Log10OpID,1)) - ; + if (checkOperator(n,Log10OpID,1)) { + const Type* Ty1 = n->getOperand(0)->getType(); + if (!Ty1->isRealType()) + error(n,"Log10OpID requires real number operand"); + } } template<> inline void ValidateImpl::validate(SquareRootOp* n) { - if (checkOperator(n,SquareRootOpID,1)) - ; + if (checkOperator(n,SquareRootOpID,1)) { + const Type* Ty1 = n->getOperand(0)->getType(); + if (!Ty1->isRealType()) + error(n,"SquareRootOp requires real number operand"); + } } template<> inline void ValidateImpl::validate(CubeRootOp* n) { - if (checkOperator(n,CubeRootOpID,1)) - ; + if (checkOperator(n,CubeRootOpID,1)) { + const Type* Ty1 = n->getOperand(0)->getType(); + if (!Ty1->isRealType()) + error(n,"CubeRootOpID requires real number operand"); + } } template<> inline void ValidateImpl::validate(FactorialOp* n) { - if (checkOperator(n,FactorialOpID,1)) - ; + if (checkOperator(n,FactorialOpID,1)) { + const Type* Ty1 = n->getOperand(0)->getType(); + if (!Ty1->isRealType()) + error(n,"FactorialOp requires real number operand"); + } } template<> inline void ValidateImpl::validate(PowerOp* n) { - if (checkOperator(n,PowerOpID,2)) - ; + if (checkOperator(n,PowerOpID,2)) { + const Type* Ty1 = n->getOperand(0)->getType(); + const Type* Ty2 = n->getOperand(1)->getType(); + if (!Ty1->isRealType() || !Ty2->isRealType()) + error(n,"LogEOpID requires two real number operands"); + } } template<> inline void ValidateImpl::validate(RootOp* n) { - if (checkOperator(n,RootOpID,2)) - ; + if (checkOperator(n,RootOpID,2)) { + const Type* Ty1 = n->getOperand(0)->getType(); + const Type* Ty2 = n->getOperand(1)->getType(); + if (!Ty1->isRealType() || !Ty2->isRealType()) + error(n,"RootOp requires two real number operands"); + } } template<> inline void ValidateImpl::validate(GCDOp* n) { - if (checkOperator(n,GCDOpID,2)) - ; + if (checkOperator(n,GCDOpID,2)) { + const Type* Ty1 = n->getOperand(0)->getType(); + const Type* Ty2 = n->getOperand(1)->getType(); + if (!Ty1->isRealType() || !Ty2->isRealType()) + error(n,"GCDOp requires two real number operands"); + } } template<> inline void ValidateImpl::validate(LCMOp* n) { - if (checkOperator(n,LCMOpID,2)) - ; + if (checkOperator(n,LCMOpID,2)) { + const Type* Ty1 = n->getOperand(0)->getType(); + const Type* Ty2 = n->getOperand(1)->getType(); + if (!Ty1->isRealType() || !Ty2->isRealType()) + error(n,"LCMOp requires two real number operands"); + } } - template<> inline void ValidateImpl::validate(OpenOp* n) { @@ -1007,43 +1142,15 @@ } template<> inline void -ValidateImpl::validate(ConstantBoolean* n) -{ -} - -template<> inline void -ValidateImpl::validate(ConstantInteger* n) -{ -} - -template<> inline void -ValidateImpl::validate(ConstantReal* n) -{ -} - -template<> inline void -ValidateImpl::validate(ConstantString* n) -{ -} - -template<> inline void -ValidateImpl::validate(ConstantAggregate* n) -{ -} - -template<> inline void -ValidateImpl::validate(ConstantExpression* n) -{ -} - -template<> inline void ValidateImpl::validate(Bundle* n) { + // FIXME: checkNode(n); } template<> inline void ValidateImpl::validate(Import* n) { + // FIXME: checkNode(n); } void @@ -1103,8 +1210,8 @@ case AllocateOpID: validate(cast(n)); break; case DeallocateOpID: validate(cast(n)); break; case ReallocateOpID: /*validate(cast(n));*/ break; - case ReferenceOpID: /*validate(cast(n));*/ break; - case ConstantReferenceOpID: /*validate(cast(n));*/ + case ReferenceOpID: validate(cast(n)); break; + case ConstantReferenceOpID: validate(cast(n)); break; case AutoVarOpID: validate(cast(n)); break; case NegateOpID: validate(cast(n)); break; @@ -1156,9 +1263,9 @@ case ReadOpID: validate(cast(n)); break; case WriteOpID: validate(cast(n)); break; case PositionOpID: /*validate(cast(n));*/ break; - case PInfOpID: /*validate(cast(n));*/ break; - case NInfOpID: /*validate(cast(n));*/ break; - case NaNOpID: /*validate(cast(n));*/ break; + case PInfOpID: /*validate(cast(n)); */ break; + case NInfOpID: /*validate(cast(n)); */ break; + case NaNOpID: /*validate(cast(n)); */ break; case ConstantBooleanID: validate(cast(n)); break; case ConstantIntegerID: validate(cast(n)); break; case ConstantRealID: validate(cast(n)); break; Modified: hlvm/Reader/XMLReader.cpp =================================================================== --- hlvm/Reader/XMLReader.cpp 2006-06-19 07:20:08 UTC (rev 305) +++ hlvm/Reader/XMLReader.cpp 2006-06-19 16:10:18 UTC (rev 306) @@ -1110,7 +1110,6 @@ cur = cur->children; if (skipBlanks(cur)) { Bundle* b = parse(cur); - ast->addBundle(b); } } _______________________________________________ hlvm-commits mailing list hlvm-commits at hlvm.org http://hlvm.org/mailman/listinfo/hlvm-commits From rspencer at reidspencer.com Mon Jun 19 21:14:23 2006 From: rspencer at reidspencer.com (rspencer at reidspencer.com) Date: Mon, 19 Jun 2006 22:14:23 -0400 Subject: [hlvm-commits] r307 - in test: . error lib Message-ID: <200606200214.k5K2ENFK018587@sneezy.swagora.com> Author: reid Date: 2006-06-19 22:14:22 -0400 (Mon, 19 Jun 2006) New Revision: 307 Log: Implement error tests where an error result is expected. Initial tests in this class consist of numeric literal constant validity and range checks. Added: test/error/ test/error/badbin.hlx test/error/baddec.hlx test/error/badhex.hlx test/error/badoct.hlx test/error/dg.exp test/error/range16.hlx test/error/range32.hlx test/error/range64.hlx test/error/range8.hlx test/lib/error.exp Modified: test/SConscript Modified: test/SConscript =================================================================== --- test/SConscript 2006-06-19 16:10:18 UTC (rev 306) +++ test/SConscript 2006-06-20 02:14:22 UTC (rev 307) @@ -24,4 +24,4 @@ Import('env') if 'check' in COMMAND_LINE_TARGETS: from build import check - check.Check(env,['xml2xml','return0']) + check.Check(env,['xml2xml','error','return0']) Added: test/error/badbin.hlx =================================================================== --- test/error/badbin.hlx 2006-06-19 16:10:18 UTC (rev 306) +++ test/error/badbin.hlx 2006-06-20 02:14:22 UTC (rev 307) @@ -0,0 +1,6 @@ + + + + 12345 + + Added: test/error/baddec.hlx =================================================================== --- test/error/baddec.hlx 2006-06-19 16:10:18 UTC (rev 306) +++ test/error/baddec.hlx 2006-06-20 02:14:22 UTC (rev 307) @@ -0,0 +1,6 @@ + + + + 1234abc + + Added: test/error/badhex.hlx =================================================================== --- test/error/badhex.hlx 2006-06-19 16:10:18 UTC (rev 306) +++ test/error/badhex.hlx 2006-06-20 02:14:22 UTC (rev 307) @@ -0,0 +1,6 @@ + + + + $!%^@$ + + Added: test/error/badoct.hlx =================================================================== --- test/error/badoct.hlx 2006-06-19 16:10:18 UTC (rev 306) +++ test/error/badoct.hlx 2006-06-20 02:14:22 UTC (rev 307) @@ -0,0 +1,6 @@ + + + + 29 + + Added: test/error/dg.exp =================================================================== --- test/error/dg.exp 2006-06-19 16:10:18 UTC (rev 306) +++ test/error/dg.exp 2006-06-20 02:14:22 UTC (rev 307) @@ -0,0 +1,3 @@ +load_lib error.exp + +hlvm-error-tests hlvm-xml2xml "*.hlx" Added: test/error/range16.hlx =================================================================== --- test/error/range16.hlx 2006-06-19 16:10:18 UTC (rev 306) +++ test/error/range16.hlx 2006-06-20 02:14:22 UTC (rev 307) @@ -0,0 +1,9 @@ + + + + 32768 + -32769 + 65536 + -1 + + Added: test/error/range32.hlx =================================================================== --- test/error/range32.hlx 2006-06-19 16:10:18 UTC (rev 306) +++ test/error/range32.hlx 2006-06-20 02:14:22 UTC (rev 307) @@ -0,0 +1,9 @@ + + + + 2147483648 + -2147483649 + 4294967296 + -1 + + Added: test/error/range64.hlx =================================================================== --- test/error/range64.hlx 2006-06-19 16:10:18 UTC (rev 306) +++ test/error/range64.hlx 2006-06-20 02:14:22 UTC (rev 307) @@ -0,0 +1,9 @@ + + + + 9223372036854775808 + -9223372036854775809 + ffffffffffffffff + -1 + + Added: test/error/range8.hlx =================================================================== --- test/error/range8.hlx 2006-06-19 16:10:18 UTC (rev 306) +++ test/error/range8.hlx 2006-06-20 02:14:22 UTC (rev 307) @@ -0,0 +1,9 @@ + + + + 128 + -129 + 256 + -1 + + Added: test/lib/error.exp =================================================================== --- test/lib/error.exp 2006-06-19 16:10:18 UTC (rev 306) +++ test/lib/error.exp 2006-06-20 02:14:22 UTC (rev 307) @@ -0,0 +1,55 @@ +#===-test/lib/error.exp - Script for error check tests ---------------------===# +# +# 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 +# +#===------------------------------------------------------------------------===# +proc hlvm-error-tests { prog pat } { + global srcdir subdir objdir tmpdir objrootdir + set outdir [file join $objdir $subdir] + set tool [file join $objrootdir tools $prog $prog ] + set source [file join $srcdir $subdir ] + set files [lsort [ + glob -nocomplain -tails -types {f r} -directory $source $pat]] + set dirs [lsort [ + glob -nocomplain -tails -types {d r} -directory $source *]] + + if { [file isdirectory $outdir] } { + cd $outdir + } else { + if { [file exists $outdir] } { + fail "identity: $outdir exists and is not a directory. Remove it" + exit(2) + } else { + file mkdir $outdir + } + } + + foreach test $files { + set output [file join $outdir ${test}.out] + set testsrc [file join $source $test] + set execout "" + set retval [ catch { exec -keepnewline $tool $testsrc -o $output } msg ] + if { $retval != 0 } { + pass "$test" + } else { + fail "$test: $tool return $retval\n$msg" + } + } +} _______________________________________________ hlvm-commits mailing list hlvm-commits at hlvm.org http://hlvm.org/mailman/listinfo/hlvm-commits From rspencer at reidspencer.com Mon Jun 19 23:43:13 2006 From: rspencer at reidspencer.com (rspencer at reidspencer.com) Date: Tue, 20 Jun 2006 00:43:13 -0400 Subject: [hlvm-commits] r308 - hlvm/AST hlvm/Pass test/error Message-ID: <200606200443.k5K4hDa7021198@sneezy.swagora.com> Author: reid Date: 2006-06-20 00:43:12 -0400 (Tue, 20 Jun 2006) New Revision: 308 Log: Get integer literal constant validation working correctly. Added: test/error/range_real.hlx Modified: hlvm/AST/AST.cpp hlvm/Pass/Validate.cpp Modified: hlvm/AST/AST.cpp =================================================================== --- hlvm/AST/AST.cpp 2006-06-20 02:14:22 UTC (rev 307) +++ hlvm/AST/AST.cpp 2006-06-20 04:43:12 UTC (rev 308) @@ -528,6 +528,7 @@ ConstantInteger* result = new ConstantInteger(base); result->setLocator(loc); result->setValue(v); + result->setBase(base); result->setType(Ty); return result; } Modified: hlvm/Pass/Validate.cpp =================================================================== --- hlvm/Pass/Validate.cpp 2006-06-20 02:14:22 UTC (rev 307) +++ hlvm/Pass/Validate.cpp 2006-06-20 04:43:12 UTC (rev 308) @@ -40,6 +40,8 @@ #include #include #include +#include +#include #include using namespace hlvm; @@ -53,8 +55,8 @@ ValidateImpl() : Pass(0,Pass::PostOrderTraversal), ast(0) {} virtual void handleInitialize(AST* tree) { ast = tree; } virtual void handle(Node* b,Pass::TraversalKinds k); - inline void error(Node*n, const char* msg); - inline void warning(Node*n, const char* msg); + inline void error(Node*n, const std::string& msg); + inline void warning(Node*n, const std::string& msg); inline bool checkNode(Node*); inline bool checkType(Type*,NodeIDs id); inline bool checkValue(Value*,NodeIDs id); @@ -71,7 +73,7 @@ }; void -ValidateImpl::warning(Node* n, const char* msg) +ValidateImpl::warning(Node* n, const std::string& msg) { if (n) { const Locator* loc = n->getLocator(); @@ -86,7 +88,7 @@ } void -ValidateImpl::error(Node* n, const char* msg) +ValidateImpl::error(Node* n, const std::string& msg) { if (n) { const Locator* loc = n->getLocator(); @@ -105,16 +107,15 @@ bool ValidateImpl::checkNode(Node* n) { - bool result = true; if (n->getParent() == 0) { error(n,"Node has no parent"); - result = false; + return false; } if (n->getID() < FirstNodeID || n->getID() > LastNodeID) { error(n,"Node ID out of range"); - result = false; + return false; } - return result;; + return true; } bool @@ -157,9 +158,10 @@ ValidateImpl::checkConstant(Constant* C,NodeIDs id) { if (checkValue(C,id)) { - if (C->getName().empty()) + if (C->getName().empty()) { error(C,"Constants must not have empty name"); return false; + } } return true; } @@ -396,18 +398,44 @@ } template<> inline void -ValidateImpl::validate(ConstantInteger* n) +ValidateImpl::validate(ConstantInteger* CI) { - checkConstant(n,ConstantIntegerID); - // FIXME: validate that the constant value is in the right numeric base - // FIXME: validate that the constant value is in range for the type + if (checkConstant(CI,ConstantIntegerID)) { + const IntegerType* Ty = cast(CI->getType()); + // Check that it can be converted to binary + const char* startp = CI->getValue().c_str(); + char* endp = 0; + int64_t val = strtoll(startp,&endp,CI->getBase()); + if (!endp || startp == endp || *endp != '\0') + error(CI,"Invalid integer constant. Conversion failed."); + else if (val < 0 && !Ty->isSigned()) { + error(CI,"Invalid integer constant. " + "Signed value not accepted by unsigned type"); + } else { + // It converted to binary okay, check that it is in range + uint64_t uval = (val < 0) ? -val : val; + unsigned leading_zeros = llvm::CountLeadingZeros_64(uval); + unsigned bits_required = (sizeof(uint64_t)*8 - leading_zeros) + + unsigned(Ty->isSigned()); + unsigned bits_allowed = Ty->getBits(); + if (bits_required > bits_allowed) + error(CI, "Invalid integer constant. Value requires " + + utostr(bits_required) + " bits, but type only holds " + + utostr(bits_allowed) + " bits."); + } + } } template<> inline void -ValidateImpl::validate(ConstantReal* n) +ValidateImpl::validate(ConstantReal* CR) { - checkConstant(n,ConstantRealID); - // FIXME: validate that the constant value is in range for the type + if (checkConstant(CR,ConstantRealID)) { + const char* startp = CR->getValue().c_str(); + char* endp = 0; + double val = strtod(startp,&endp); + if (!endp || startp == endp || *endp != '\0') + error(CR,"Invalid real constant. Conversion failed."); + } } template<> inline void Added: test/error/range_real.hlx =================================================================== --- test/error/range_real.hlx 2006-06-20 02:14:22 UTC (rev 307) +++ test/error/range_real.hlx 2006-06-20 04:43:12 UTC (rev 308) @@ -0,0 +1,11 @@ + + + + 1.0E+39 + 1.0E-39 + -1.0E+39 + 1.0E+309 + 1.0E-309 + -1.0E+309 + + _______________________________________________ hlvm-commits mailing list hlvm-commits at hlvm.org http://hlvm.org/mailman/listinfo/hlvm-commits From rspencer at reidspencer.com Tue Jun 20 00:26:39 2006 From: rspencer at reidspencer.com (rspencer at reidspencer.com) Date: Tue, 20 Jun 2006 01:26:39 -0400 Subject: [hlvm-commits] r309 - docs Message-ID: <200606200526.k5K5QdRb023580@sneezy.swagora.com> Author: reid Date: 2006-06-20 01:26:38 -0400 (Tue, 20 Jun 2006) New Revision: 309 Log: Add some instructions for getting a sane build environment. Modified: docs/DevelopersGuide.html Modified: docs/DevelopersGuide.html =================================================================== --- docs/DevelopersGuide.html 2006-06-20 04:43:12 UTC (rev 308) +++ docs/DevelopersGuide.html 2006-06-20 05:26:38 UTC (rev 309) @@ -16,6 +16,7 @@
          • About SCONS
          • Configuring
          • Build Rules
          • +
          • Sane Build Environment
    7. Coding Style
    8. @@ -277,7 +278,6 @@

    -

    Build Rules

    This subsection describes the various build rules and extensions to SCons @@ -366,6 +366,145 @@

    +

    A Sane Build Environment

    +
    +

    Building HLVM is no small feat. It depends on a lot of software that is + quite version dependent. To bring a little sanity to the process, here is a + step-by-step procedure we know to work.

    +

    Build Separation

    +

    In building HLVM, you'll be installing compilers and library that may + already exist on your system. You don't want to overwrite your system versions + 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.

    +

    Once you've found a suitable location for HLVM, create the following + directory structure:

    +  cd /proj
    +  mkdir gcc llvm llvm-gcc4 libxml2 apr apru hlvm gperf scons install
    +  
    +

    In the following sections you will build each of these packages and install + them into /proj/install which will keep it separate from anything + else in your system.

    +

    Build GCC 3.4.6

    +

    First, start with obtaining GCC 3.4.6. This will be the compiler that you + use for all the remaining compilations. Use the following commands to obtain, + build and install GCC 3.4.6:

    +  cd /proj/gcc
    +  mkdir build
    +  svn svn://gcc.gnu.org/svn/gcc/tags/gcc_3_4_6_release src
    +  cd ../build
    +  ../src/configure  --prefix=/proj/install
    +  make 
    +  make install
    +  
    +

    Set Environment

    +

    Now that you have gcc installed in a separate location, you will need to + change your environment to ensure that that version of gcc is the one used in + subsequent builds. Details vary from platform to platform, but on Linux, the + following should work:

    +  export PATH=/proj/install/bin:$PATH
    +  export LD_LIBRARY_PATH=/proj/install/lib:$LD_LIBRARY_PATH
    +  
    +

    The essential point is to change your environment so that programs and + libraries installed into /proj/install will be found first. You should do this + in any shell environment in which you'll be building HLVM related software. +

    +

    Build gperf

    +

    This package is used for generating perfect hash functions. It is used by + HLVM for fast recognition of XML element and attribute names. Its easy and + fast to build:

    +  cd /proj/gperf
    +  wget http://mirrors.kernel.org/gnu/gperf/gperf-2.7.2.tar.gz
    +  tar zxf gperf-2.7.2.tar.gz
    +  mkdir build
    +  cd build
    +  ../gperf-2.7.2/configure --prefix=/proj/install
    +  make
    +  make install
    +  
    +

    Build libxml2

    +

    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 + you. Use these commands:

    +  cd /proj/libxml2
    +  wget ftp://xmlsoft.org/libxml2/libxml2-2.6.24.tar.gz
    +  tar zxf libxml2-2.6.24.tar.gz
    +  mkdir build
    +  cd build
    +  ../libxml2-2.6.24/configure --prefix=/proj/install
    +  make
    +  make install
    +  
    +

    Build apr

    +
    +  cd /proj/apr
    +  wget http://mirror.olnevhost.net/pub/apache/apr/apr-1.2.7.tar.gz
    +  tar zxf apr-1.2.7.tar.gz
    +  mkdir build
    +  cd apr-1.2.7
    +  ./buildconf
    +  cd ../build
    +  ../apr-1.2.7/configure --prefix=/proj/install --enable-debug \
    +    --enable-threads --enable-other-child
    +  make
    +  make install
    +  
    +

    Build apr-util

    +
    +  cd /proj/apru
    +  wget http://mirror.olnevhost.net/pub/apache/apr/apr-util-1.2.7.tar.gz
    +  tar zxf apr-1.2.7.tar.gz
    +  mkdir build
    +  cd apr-util-1.2.7
    +  ./buildconf
    +  cd ../build
    +  ../apr-util-1.2.7/configure --prefix=/proj/install --enable-debug \
    +    --enable-threads --enable-other-child
    +  make
    +  make install
    +  
    +

    Build LLVM

    +
    +  cd /proj/llvm
    +  cvs -d :pserver:anon at llvm-cvs.cs.uiuc.edu:/var/cvs/llvm login
    +  <return>
    +  cvs -z3 -d :pserver:anon at llvm-cvs.cs.uiuc.edu:/var/cvs/llvm co llvm
    +  mkdir build
    +  cd build
    +  ../llvm/configure --prefix=/proj/install
    +  make tools-only
    +  make install
    +  make ENABLE_OPTIMIZED=1 OPTIMIZE_OPTION=-O2 tools-only
    +  
    +

    Build llvm-gcc4

    +
    +  cd /proj/llvm-gcc4
    +  svn co svn://anonsvn.opensource.apple.com/svn/llvm cfe
    +  mkdir build install
    +  cd build
    +  ../cfe/configure --prefix=/proj/llvm-gcc4/cfe/install \
    +    --enable-llvm=/proj/llvm/build --enable-languages=c,c++
    +  make
    +  make install
    +  
    +

    Build HLVM

    +

    Note in the following that if you've actually used /proj as your + build area then you don't need to provide any arguments to make as + these paths are the default. Also note that the arguments are only needed the + first time you build HLVM. Subsequently, these options will be remembered. See + the description of SCons above.

    +
    +  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/bin
    +  
    +
    +

    Coding Style

    Contributions to HLVM must meet the following Coding Style @@ -382,12 +521,13 @@ build related.

  • Files must not exceed 80 columns in width
  • Indentation is 2 spaces (no tabs).
  • +
  • Doxygen documentation must be provided in header files.
  • Appendices

     
    - +

    Lesser General Public License

     		  GNU LESSER GENERAL PUBLIC LICENSE
    
    _______________________________________________
    hlvm-commits mailing list
    hlvm-commits at hlvm.org
    http://hlvm.org/mailman/listinfo/hlvm-commits
    
    
    From rspencer at reidspencer.com  Tue Jun 20 00:38:09 2006
    From: rspencer at reidspencer.com (rspencer at reidspencer.com)
    Date: Tue, 20 Jun 2006 01:38:09 -0400
    Subject: [hlvm-commits] r310 - docs
    Message-ID: <200606200538.k5K5c9sg023605@sneezy.swagora.com>
    
    Author: reid
    Date: 2006-06-20 01:38:08 -0400 (Tue, 20 Jun 2006)
    New Revision: 310
    Log:
    XHTML corrections and some additonal verbage.
    
    
    Modified:
       docs/DevelopersGuide.html
    
    Modified: docs/DevelopersGuide.html
    ===================================================================
    --- docs/DevelopersGuide.html	2006-06-20 05:26:38 UTC (rev 309)
    +++ docs/DevelopersGuide.html	2006-06-20 05:38:08 UTC (rev 310)
    @@ -3,7 +3,7 @@
     

    HLVM Developer's Guide

    CAUTION: This document is a work in progress.
      -
    1. Introduction +
    2. Introduction
    3. Contributions
      1. Copyright
      2. @@ -11,7 +11,7 @@
      3. Patches
    4. -
    5. Build System
    6. +
    7. Build System
      1. About SCONS
      2. Configuring
      3. @@ -77,7 +77,6 @@ from being incorporated into commercial and proprietary products. The founders wish to encourage HLVM's use both in open source and proprietary projects. -
      4. The LGPL protects the contributors by ensuring that distributions of HLVM retain copyright and the LGPL license for any modifications to HLVM.
      5. @@ -383,8 +382,7 @@

        Once you've found a suitable location for HLVM, create the following directory structure:

           cd /proj
        -  mkdir gcc llvm llvm-gcc4 libxml2 apr apru hlvm gperf scons install
        -  
        + mkdir gcc llvm llvm-gcc4 libxml2 apr apru hlvm gperf scons install

    In the following sections you will build each of these packages and install them into /proj/install which will keep it separate from anything else in your system.

    @@ -398,16 +396,14 @@ cd ../build ../src/configure --prefix=/proj/install make - make install - + make install

    Set Environment

    Now that you have gcc installed in a separate location, you will need to change your environment to ensure that that version of gcc is the one used in subsequent builds. Details vary from platform to platform, but on Linux, the following should work:

       export PATH=/proj/install/bin:$PATH
    -  export LD_LIBRARY_PATH=/proj/install/lib:$LD_LIBRARY_PATH
    -  
    + export LD_LIBRARY_PATH=/proj/install/lib:$LD_LIBRARY_PATH

    The essential point is to change your environment so that programs and libraries installed into /proj/install will be found first. You should do this in any shell environment in which you'll be building HLVM related software. @@ -423,8 +419,7 @@ cd build ../gperf-2.7.2/configure --prefix=/proj/install make - make install - + make install

    Build libxml2

    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 @@ -436,9 +431,12 @@ cd build ../libxml2-2.6.24/configure --prefix=/proj/install make - make install - + make install

    Build apr

    +

    The Apache Portable Runtime is a portability layer used within the Apache + HTTP Server. Although it is still undergoing active development, stable + releases are available. HLVM uses APR for portability in the runtime. Build + APR with the following commands:

       cd /proj/apr
       wget http://mirror.olnevhost.net/pub/apache/apr/apr-1.2.7.tar.gz
    @@ -450,9 +448,10 @@
       ../apr-1.2.7/configure --prefix=/proj/install --enable-debug \
         --enable-threads --enable-other-child
       make
    -  make install
    -  
    + make install

    Build apr-util

    +

    The apr-util package is some additional utilities that go with APR. Build + apr-util with the following commands:

       cd /proj/apru
       wget http://mirror.olnevhost.net/pub/apache/apr/apr-util-1.2.7.tar.gz
    @@ -464,9 +463,15 @@
       ../apr-util-1.2.7/configure --prefix=/proj/install --enable-debug \
         --enable-threads --enable-other-child
       make
    -  make install
    -  
    + make install

    Build LLVM

    +

    For now, you must build LLVM from the CVS repository. Although LLVM is + actively being developed, it is generally stable and this is safe. If you get + tempted to use a release tarball, it will fail. HLVM depends on post-1.7 + features of LLVM. When you build LLVM, use the "tools-only" target. This will + avoid building the "runtime" portion of LLVM which was necessary for an older + version of llvm-gcc (v3). Since we'll be using llvm-gcc4, this is unnecessary + and will eliminate some chicken-and-egg type problems.

       cd /proj/llvm
       cvs -d :pserver:anon at llvm-cvs.cs.uiuc.edu:/var/cvs/llvm login
    @@ -477,9 +482,12 @@
       ../llvm/configure --prefix=/proj/install
       make tools-only
       make install
    -  make ENABLE_OPTIMIZED=1 OPTIMIZE_OPTION=-O2 tools-only
    -  
    + make ENABLE_OPTIMIZED=1 OPTIMIZE_OPTION=-O2 tools-only

    Build llvm-gcc4

    +

    Apple provides a Subversion repository for llvm-gcc4. You need this latest + version because HLVM depends on some of the features. You might find this one + a bit tricky. See the README.LLVM file in the top source directory for + additional help and late breaking news.

       cd /proj/llvm-gcc4
       svn co svn://anonsvn.opensource.apple.com/svn/llvm cfe
    @@ -1033,5 +1041,4 @@
     
     That's all there is to it!
     
    - _______________________________________________ hlvm-commits mailing list hlvm-commits at hlvm.org http://hlvm.org/mailman/listinfo/hlvm-commits From saem at hlvm.org Tue Jun 20 01:49:37 2006 From: saem at hlvm.org (saem at hlvm.org) Date: Tue, 20 Jun 2006 02:49:37 -0400 Subject: [hlvm-commits] r311 - docs Message-ID: <200606200649.k5K6nb3F025962@sneezy.swagora.com> Author: saem Date: 2006-06-20 02:49:36 -0400 (Tue, 20 Jun 2006) New Revision: 311 Log: missing the "co" command for the gcc svn checkout instruction Modified: docs/DevelopersGuide.html Modified: docs/DevelopersGuide.html =================================================================== --- docs/DevelopersGuide.html 2006-06-20 05:38:08 UTC (rev 310) +++ docs/DevelopersGuide.html 2006-06-20 06:49:36 UTC (rev 311) @@ -1,6 +1,71 @@ +<<<<<<< .mine + + + + + + HLVM: Developer's Guide + + + + + + + + + + + + +
    + +

    HLVM Developer's Guide

    +=======

    HLVM Developer's Guide

    +>>>>>>> .r310
    CAUTION: This document is a work in progress.
    1. Introduction
    2. @@ -367,6 +432,7 @@

      A Sane Build Environment

      +<<<<<<< .mine

      Building HLVM is no small feat. It depends on a lot of software that is quite version dependent. To bring a little sanity to the process, here is a step-by-step procedure we know to work.

      @@ -392,6 +458,155 @@ build and install GCC 3.4.6:

         cd /proj/gcc
         mkdir build
      +  svn co svn://gcc.gnu.org/svn/gcc/tags/gcc_3_4_6_release src
      +  cd ../build
      +  ../src/configure  --prefix=/proj/install
      +  make 
      +  make install
      +

      Set Environment

      +

      Now that you have gcc installed in a separate location, you will need to + change your environment to ensure that that version of gcc is the one used in + subsequent builds. Details vary from platform to platform, but on Linux, the + following should work:

      +  export PATH=/proj/install/bin:$PATH
      +  export LD_LIBRARY_PATH=/proj/install/lib:$LD_LIBRARY_PATH
      +

      The essential point is to change your environment so that programs and + libraries installed into /proj/install will be found first. You should do this + in any shell environment in which you'll be building HLVM related software. +

      +

      Build gperf

      +

      This package is used for generating perfect hash functions. It is used by + HLVM for fast recognition of XML element and attribute names. Its easy and + fast to build:

      +  cd /proj/gperf
      +  wget http://mirrors.kernel.org/gnu/gperf/gperf-2.7.2.tar.gz
      +  tar zxf gperf-2.7.2.tar.gz
      +  mkdir build
      +  cd build
      +  ../gperf-2.7.2/configure --prefix=/proj/install
      +  make
      +  make install
      +

      Build libxml2

      +

      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 + you. Use these commands:

      +  cd /proj/libxml2
      +  wget ftp://xmlsoft.org/libxml2/libxml2-2.6.24.tar.gz
      +  tar zxf libxml2-2.6.24.tar.gz
      +  mkdir build
      +  cd build
      +  ../libxml2-2.6.24/configure --prefix=/proj/install
      +  make
      +  make install
      +

      Build apr

      +

      The Apache Portable Runtime is a portability layer used within the Apache + HTTP Server. Although it is still undergoing active development, stable + releases are available. HLVM uses APR for portability in the runtime. Build + APR with the following commands:

      +
      +  cd /proj/apr
      +  wget http://mirror.olnevhost.net/pub/apache/apr/apr-1.2.7.tar.gz
      +  tar zxf apr-1.2.7.tar.gz
      +  mkdir build
      +  cd apr-1.2.7
      +  ./buildconf
      +  cd ../build
      +  ../apr-1.2.7/configure --prefix=/proj/install --enable-debug \
      +    --enable-threads --enable-other-child
      +  make
      +  make install
      +

      Build apr-util

      +

      The apr-util package is some additional utilities that go with APR. Build + apr-util with the following commands:

      +
      +  cd /proj/apru
      +  wget http://mirror.olnevhost.net/pub/apache/apr/apr-util-1.2.7.tar.gz
      +  tar zxf apr-1.2.7.tar.gz
      +  mkdir build
      +  cd apr-util-1.2.7
      +  ./buildconf
      +  cd ../build
      +  ../apr-util-1.2.7/configure --prefix=/proj/install --enable-debug \
      +    --enable-threads --enable-other-child
      +  make
      +  make install
      +

      Build LLVM

      +

      For now, you must build LLVM from the CVS repository. Although LLVM is + actively being developed, it is generally stable and this is safe. If you get + tempted to use a release tarball, it will fail. HLVM depends on post-1.7 + features of LLVM. When you build LLVM, use the "tools-only" target. This will + avoid building the "runtime" portion of LLVM which was necessary for an older + version of llvm-gcc (v3). Since we'll be using llvm-gcc4, this is unnecessary + and will eliminate some chicken-and-egg type problems.

      +
      +  cd /proj/llvm
      +  cvs -d :pserver:anon at llvm-cvs.cs.uiuc.edu:/var/cvs/llvm login
      +  <return>
      +  cvs -z3 -d :pserver:anon at llvm-cvs.cs.uiuc.edu:/var/cvs/llvm co llvm
      +  mkdir build
      +  cd build
      +  ../llvm/configure --prefix=/proj/install
      +  make tools-only
      +  make install
      +  make ENABLE_OPTIMIZED=1 OPTIMIZE_OPTION=-O2 tools-only
      +

      Build llvm-gcc4

      +

      Apple provides a Subversion repository for llvm-gcc4. You need this latest + version because HLVM depends on some of the features. You might find this one + a bit tricky. See the README.LLVM file in the top source directory for + additional help and late breaking news.

      +
      +  cd /proj/llvm-gcc4
      +  svn co svn://anonsvn.opensource.apple.com/svn/llvm cfe
      +  mkdir build install
      +  cd build
      +  ../cfe/configure --prefix=/proj/llvm-gcc4/cfe/install \
      +    --enable-llvm=/proj/llvm/build --enable-languages=c,c++
      +  make
      +  make install
      +  
      +

      Build HLVM

      +

      Note in the following that if you've actually used /proj as your + build area then you don't need to provide any arguments to make as + these paths are the default. Also note that the arguments are only needed the + first time you build HLVM. Subsequently, these options will be remembered. See + the description of SCons above.

      +
      +  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/bin
      +  
      +
      + +

      Coding Style

      +
      +======= +

      Building HLVM is no small feat. It depends on a lot of software that is + quite version dependent. To bring a little sanity to the process, here is a + step-by-step procedure we know to work.

      +

      Build Separation

      +

      In building HLVM, you'll be installing compilers and library that may + already exist on your system. You don't want to overwrite your system versions + 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.

      +

      Once you've found a suitable location for HLVM, create the following + directory structure:

      +  cd /proj
      +  mkdir gcc llvm llvm-gcc4 libxml2 apr apru hlvm gperf scons install
      +

      In the following sections you will build each of these packages and install + them into /proj/install which will keep it separate from anything + else in your system.

      +

      Build GCC 3.4.6

      +

      First, start with obtaining GCC 3.4.6. This will be the compiler that you + use for all the remaining compilations. Use the following commands to obtain, + build and install GCC 3.4.6:

      +  cd /proj/gcc
      +  mkdir build
         svn svn://gcc.gnu.org/svn/gcc/tags/gcc_3_4_6_release src
         cd ../build
         ../src/configure  --prefix=/proj/install
      @@ -515,6 +730,7 @@
       
       

      Coding Style

      +>>>>>>> .r310

      Contributions to HLVM must meet the following Coding Style requirements:

        @@ -1041,4 +1257,69 @@ That's all there is to it!
      +<<<<<<< .mine +
    + + + + +======= +>>>>>>> .r310 _______________________________________________ hlvm-commits mailing list hlvm-commits at hlvm.org http://hlvm.org/mailman/listinfo/hlvm-commits From rspencer at reidspencer.com Tue Jun 20 02:19:57 2006 From: rspencer at reidspencer.com (rspencer at reidspencer.com) Date: Tue, 20 Jun 2006 03:19:57 -0400 Subject: [hlvm-commits] r312 - docs Message-ID: <200606200719.k5K7JvJa026028@sneezy.swagora.com> Author: reid Date: 2006-06-20 03:19:56 -0400 (Tue, 20 Jun 2006) New Revision: 312 Log: Revert Saem's patch that broke this page and apply the correct patch. Modified: docs/DevelopersGuide.html Modified: docs/DevelopersGuide.html =================================================================== --- docs/DevelopersGuide.html 2006-06-20 06:49:36 UTC (rev 311) +++ docs/DevelopersGuide.html 2006-06-20 07:19:56 UTC (rev 312) @@ -1,71 +1,6 @@ -<<<<<<< .mine - - - - - - HLVM: Developer's Guide - - - - - - - - - - - - -
    - -

    HLVM Developer's Guide

    -=======

    HLVM Developer's Guide

    ->>>>>>> .r310
    CAUTION: This document is a work in progress.
    1. Introduction
    2. @@ -432,7 +367,6 @@

      A Sane Build Environment

      -<<<<<<< .mine

      Building HLVM is no small feat. It depends on a lot of software that is quite version dependent. To bring a little sanity to the process, here is a step-by-step procedure we know to work.

      @@ -581,156 +515,6 @@

      Coding Style

      -======= -

      Building HLVM is no small feat. It depends on a lot of software that is - quite version dependent. To bring a little sanity to the process, here is a - step-by-step procedure we know to work.

      -

      Build Separation

      -

      In building HLVM, you'll be installing compilers and library that may - already exist on your system. You don't want to overwrite your system versions - 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.

      -

      Once you've found a suitable location for HLVM, create the following - directory structure:

      -  cd /proj
      -  mkdir gcc llvm llvm-gcc4 libxml2 apr apru hlvm gperf scons install
      -

      In the following sections you will build each of these packages and install - them into /proj/install which will keep it separate from anything - else in your system.

      -

      Build GCC 3.4.6

      -

      First, start with obtaining GCC 3.4.6. This will be the compiler that you - use for all the remaining compilations. Use the following commands to obtain, - build and install GCC 3.4.6:

      -  cd /proj/gcc
      -  mkdir build
      -  svn svn://gcc.gnu.org/svn/gcc/tags/gcc_3_4_6_release src
      -  cd ../build
      -  ../src/configure  --prefix=/proj/install
      -  make 
      -  make install
      -

      Set Environment

      -

      Now that you have gcc installed in a separate location, you will need to - change your environment to ensure that that version of gcc is the one used in - subsequent builds. Details vary from platform to platform, but on Linux, the - following should work:

      -  export PATH=/proj/install/bin:$PATH
      -  export LD_LIBRARY_PATH=/proj/install/lib:$LD_LIBRARY_PATH
      -

      The essential point is to change your environment so that programs and - libraries installed into /proj/install will be found first. You should do this - in any shell environment in which you'll be building HLVM related software. -

      -

      Build gperf

      -

      This package is used for generating perfect hash functions. It is used by - HLVM for fast recognition of XML element and attribute names. Its easy and - fast to build:

      -  cd /proj/gperf
      -  wget http://mirrors.kernel.org/gnu/gperf/gperf-2.7.2.tar.gz
      -  tar zxf gperf-2.7.2.tar.gz
      -  mkdir build
      -  cd build
      -  ../gperf-2.7.2/configure --prefix=/proj/install
      -  make
      -  make install
      -

      Build libxml2

      -

      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 - you. Use these commands:

      -  cd /proj/libxml2
      -  wget ftp://xmlsoft.org/libxml2/libxml2-2.6.24.tar.gz
      -  tar zxf libxml2-2.6.24.tar.gz
      -  mkdir build
      -  cd build
      -  ../libxml2-2.6.24/configure --prefix=/proj/install
      -  make
      -  make install
      -

      Build apr

      -

      The Apache Portable Runtime is a portability layer used within the Apache - HTTP Server. Although it is still undergoing active development, stable - releases are available. HLVM uses APR for portability in the runtime. Build - APR with the following commands:

      -
      -  cd /proj/apr
      -  wget http://mirror.olnevhost.net/pub/apache/apr/apr-1.2.7.tar.gz
      -  tar zxf apr-1.2.7.tar.gz
      -  mkdir build
      -  cd apr-1.2.7
      -  ./buildconf
      -  cd ../build
      -  ../apr-1.2.7/configure --prefix=/proj/install --enable-debug \
      -    --enable-threads --enable-other-child
      -  make
      -  make install
      -

      Build apr-util

      -

      The apr-util package is some additional utilities that go with APR. Build - apr-util with the following commands:

      -
      -  cd /proj/apru
      -  wget http://mirror.olnevhost.net/pub/apache/apr/apr-util-1.2.7.tar.gz
      -  tar zxf apr-1.2.7.tar.gz
      -  mkdir build
      -  cd apr-util-1.2.7
      -  ./buildconf
      -  cd ../build
      -  ../apr-util-1.2.7/configure --prefix=/proj/install --enable-debug \
      -    --enable-threads --enable-other-child
      -  make
      -  make install
      -

      Build LLVM

      -

      For now, you must build LLVM from the CVS repository. Although LLVM is - actively being developed, it is generally stable and this is safe. If you get - tempted to use a release tarball, it will fail. HLVM depends on post-1.7 - features of LLVM. When you build LLVM, use the "tools-only" target. This will - avoid building the "runtime" portion of LLVM which was necessary for an older - version of llvm-gcc (v3). Since we'll be using llvm-gcc4, this is unnecessary - and will eliminate some chicken-and-egg type problems.

      -
      -  cd /proj/llvm
      -  cvs -d :pserver:anon at llvm-cvs.cs.uiuc.edu:/var/cvs/llvm login
      -  <return>
      -  cvs -z3 -d :pserver:anon at llvm-cvs.cs.uiuc.edu:/var/cvs/llvm co llvm
      -  mkdir build
      -  cd build
      -  ../llvm/configure --prefix=/proj/install
      -  make tools-only
      -  make install
      -  make ENABLE_OPTIMIZED=1 OPTIMIZE_OPTION=-O2 tools-only
      -

      Build llvm-gcc4

      -

      Apple provides a Subversion repository for llvm-gcc4. You need this latest - version because HLVM depends on some of the features. You might find this one - a bit tricky. See the README.LLVM file in the top source directory for - additional help and late breaking news.

      -
      -  cd /proj/llvm-gcc4
      -  svn co svn://anonsvn.opensource.apple.com/svn/llvm cfe
      -  mkdir build install
      -  cd build
      -  ../cfe/configure --prefix=/proj/llvm-gcc4/cfe/install \
      -    --enable-llvm=/proj/llvm/build --enable-languages=c,c++
      -  make
      -  make install
      -  
      -

      Build HLVM

      -

      Note in the following that if you've actually used /proj as your - build area then you don't need to provide any arguments to make as - these paths are the default. Also note that the arguments are only needed the - first time you build HLVM. Subsequently, these options will be remembered. See - the description of SCons above.

      -
      -  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/bin
      -  
      -
      - -

      Coding Style

      -
      ->>>>>>> .r310

      Contributions to HLVM must meet the following Coding Style requirements:

        @@ -1257,69 +1041,4 @@ That's all there is to it! -<<<<<<< .mine -
    - - - - -======= ->>>>>>> .r310 _______________________________________________ hlvm-commits mailing list hlvm-commits at hlvm.org http://hlvm.org/mailman/listinfo/hlvm-commits From rspencer at reidspencer.com Tue Jun 20 03:12:10 2006 From: rspencer at reidspencer.com (rspencer at reidspencer.com) Date: Tue, 20 Jun 2006 04:12:10 -0400 Subject: [hlvm-commits] r313 - hlvm/Pass Message-ID: <200606200812.k5K8CAdO028871@sneezy.swagora.com> Author: reid Date: 2006-06-20 04:12:09 -0400 (Tue, 20 Jun 2006) New Revision: 313 Log: Validate the ReturnOp and the SelectOp a bit more carefully. Modified: hlvm/Pass/Validate.cpp Modified: hlvm/Pass/Validate.cpp =================================================================== --- hlvm/Pass/Validate.cpp 2006-06-20 07:19:56 UTC (rev 312) +++ hlvm/Pass/Validate.cpp 2006-06-20 08:12:09 UTC (rev 313) @@ -519,7 +519,13 @@ ValidateImpl::validate(ReturnOp* n) { if (checkOperator(n,ReturnOpID,1)) - checkTerminator(n); + if (checkTerminator(n)) { + Operator* res = n->getOperand(0); + const Function* F = n->getContainingFunction(); + const SignatureType* SigTy = F->getSignature(); + if (res->getType() != SigTy->getResultType()) + error(n,"ReturnOp operand does not agree in type with Function result"); + } } template<> inline void @@ -540,9 +546,19 @@ ValidateImpl::validate(SelectOp* n) { if (checkOperator(n,SelectOpID,3)) { - const Type* Ty = n->getOperand(0)->getType(); - if (!isa(Ty)) + Operator* Op1 = n->getOperand(0); + Operator* Op2 = n->getOperand(1); + Operator* Op3 = n->getOperand(2); + const Type* Ty1 = Op1->getType(); + const Type* Ty2 = Op2->getType(); + const Type* Ty3 = Op3->getType(); + if (!isa(Ty1)) error(n,"SelectOp expects first operand to be type boolean"); + else if ( Ty1 != Ty2 ) + error(n,"Second and third operands for SelectOp must agree in type"); + else if (isa(Op2) != isa(Op3)) + error(n,"SelectOp requires operands 2 and 3 to both be blocks or " + "neither be blocks"); } } _______________________________________________ hlvm-commits mailing list hlvm-commits at hlvm.org http://hlvm.org/mailman/listinfo/hlvm-commits From rspencer at reidspencer.com Tue Jun 20 09:32:47 2006 From: rspencer at reidspencer.com (rspencer at reidspencer.com) Date: Tue, 20 Jun 2006 10:32:47 -0400 Subject: [hlvm-commits] r314 - in hlvm: AST CodeGen Reader Message-ID: <200606201432.k5KEWl5T008853@sneezy.swagora.com> Author: reid Date: 2006-06-20 10:32:44 -0400 (Tue, 20 Jun 2006) New Revision: 314 Log: Make getValue() a virtual function so Block can override it. Provide a getContainingFunction to Block. Implement code generation for SelectOp. Modified: hlvm/AST/Block.h hlvm/AST/Node.h hlvm/AST/Operator.cpp hlvm/AST/Operator.h hlvm/CodeGen/LLVMGenerator.cpp hlvm/Reader/HLVM.rng Modified: hlvm/AST/Block.h =================================================================== --- hlvm/AST/Block.h 2006-06-20 08:12:09 UTC (rev 313) +++ hlvm/AST/Block.h 2006-06-20 14:32:44 UTC (rev 314) @@ -57,6 +57,7 @@ /// @name Accessors /// @{ public: + virtual const Type* getType() const { return this->back()->getType(); } const std::string& getLabel() const { return label; } AutoVarOp* getAutoVar(const std::string& name) const; const Type* getResultType() { return this->back()->getType(); } Modified: hlvm/AST/Node.h =================================================================== --- hlvm/AST/Node.h 2006-06-20 08:12:09 UTC (rev 313) +++ hlvm/AST/Node.h 2006-06-20 14:32:44 UTC (rev 314) @@ -539,7 +539,7 @@ /// @{ public: // Get the type of the value - inline const Type* getType() const { return type; } + virtual const Type* getType() const { return type; } static inline bool classof(const Value*) { return true; } static inline bool classof(const Node* N) { return N->isValue(); } Modified: hlvm/AST/Operator.cpp =================================================================== --- hlvm/AST/Operator.cpp 2006-06-20 08:12:09 UTC (rev 313) +++ hlvm/AST/Operator.cpp 2006-06-20 14:32:44 UTC (rev 314) @@ -28,6 +28,7 @@ //===----------------------------------------------------------------------===// #include +#include #include #include @@ -39,6 +40,14 @@ { } +Function* +Operator::getContainingFunction() +{ + Node* p = getParent(); + while (p && !isa(p)) p = p->getParent(); + return cast(p); +} + NilaryOperator::~NilaryOperator() { } Modified: hlvm/AST/Operator.h =================================================================== --- hlvm/AST/Operator.h 2006-06-20 08:12:09 UTC (rev 313) +++ hlvm/AST/Operator.h 2006-06-20 14:32:44 UTC (rev 314) @@ -36,6 +36,7 @@ { class Type; +class Function; /// This class is the abstract base class in the Abstract Syntax Tree for all /// operators. An Operator is an instruction to the virtual machine to take @@ -66,6 +67,9 @@ virtual size_t getNumOperands() const = 0; virtual Operator* getOperand(unsigned opnum) const = 0; + /// Return the function containing this operator + Function* getContainingFunction(); + /// Determine if this is a classof some other type. static inline bool classof(const Operator*) { return true; } static inline bool classof(const Node* N) { return N->isOperator(); } Modified: hlvm/CodeGen/LLVMGenerator.cpp =================================================================== --- hlvm/CodeGen/LLVMGenerator.cpp 2006-06-20 08:12:09 UTC (rev 313) +++ hlvm/CodeGen/LLVMGenerator.cpp 2006-06-20 14:32:44 UTC (rev 314) @@ -1195,16 +1195,45 @@ template<> void LLVMGeneratorPass::gen(SelectOp* op) { + hlvmAssert(lops.size() >= 3 && "Too few operands for SelectOp"); + llvm::Value* op3 = lops.back(); lops.pop_back(); + llvm::Value* op2 = lops.back(); lops.pop_back(); + llvm::Value* op1 = lops.back(); lops.pop_back(); + hlvmAssert(op1->getType() == llvm::Type::BoolTy); + hlvmAssert(op2->getType() == op2->getType()); + hlvmAssert(llvm::isa(op2) == + llvm::isa(op3)); + if (llvm::isa(op2)) { + // both are blocks, emit a BranchInstr + new llvm::BranchInst( + llvm::cast(op2), + llvm::cast(op3),op1,lblk); + return; + } + + // A this point, we can only be left with a first class type since all HLVM + // operators translate to a first class type. Since the select operator + // requires first class types, its okay to just use it here. + hlvmAssert(op2->getType()->isFirstClassType()); + new llvm::SelectInst(op1,op2,op3,"select",lblk); } template<> void LLVMGeneratorPass::gen(SwitchOp* op) { + hlvmAssert(lops.size() >= 2 && "Too few operands for SwitchOp"); + llvm::Value* op2 = lops.back(); lops.pop_back(); + llvm::Value* op1 = lops.back(); lops.pop_back(); + } template<> void LLVMGeneratorPass::gen(LoopOp* op) { + hlvmAssert(lops.size() >= 3 && "Too few operands for SelectOp"); + llvm::Value* op3 = lops.back(); lops.pop_back(); + llvm::Value* op2 = lops.back(); lops.pop_back(); + llvm::Value* op1 = lops.back(); lops.pop_back(); } template<> void Modified: hlvm/Reader/HLVM.rng =================================================================== --- hlvm/Reader/HLVM.rng 2006-06-20 08:12:09 UTC (rev 313) +++ hlvm/Reader/HLVM.rng 2006-06-20 14:32:44 UTC (rev 314) @@ -1060,6 +1060,7 @@ + @@ -1112,4 +1113,13 @@ + + + + + + + + + _______________________________________________ hlvm-commits mailing list hlvm-commits at hlvm.org http://hlvm.org/mailman/listinfo/hlvm-commits From rspencer at reidspencer.com Tue Jun 20 09:36:55 2006 From: rspencer at reidspencer.com (rspencer at reidspencer.com) Date: Tue, 20 Jun 2006 10:36:55 -0400 Subject: [hlvm-commits] r315 - hlvm/Writer Message-ID: <200606201436.k5KEat87009441@sneezy.swagora.com> Author: reid Date: 2006-06-20 10:36:54 -0400 (Tue, 20 Jun 2006) New Revision: 315 Log: The dump() function is only a debug mode thing. Make it so. Modified: hlvm/Writer/XMLWriter.cpp Modified: hlvm/Writer/XMLWriter.cpp =================================================================== --- hlvm/Writer/XMLWriter.cpp 2006-06-20 14:32:44 UTC (rev 314) +++ hlvm/Writer/XMLWriter.cpp 2006-06-20 14:36:54 UTC (rev 315) @@ -883,7 +883,9 @@ return new XMLWriterImpl(fname); } +#ifdef HLVM_DEBUG void hlvm::dump(Node*) { } +#endif _______________________________________________ hlvm-commits mailing list hlvm-commits at hlvm.org http://hlvm.org/mailman/listinfo/hlvm-commits From rspencer at reidspencer.com Tue Jun 20 09:42:55 2006 From: rspencer at reidspencer.com (rspencer at reidspencer.com) Date: Tue, 20 Jun 2006 10:42:55 -0400 Subject: [hlvm-commits] r316 - build Message-ID: <200606201442.k5KEgtkA009464@sneezy.swagora.com> Author: reid Date: 2006-06-20 10:42:55 -0400 (Tue, 20 Jun 2006) New Revision: 316 Log: Check variables for None before using them! Patch contributed by Mark Rowe. Modified: build/configure.py Modified: build/configure.py =================================================================== --- build/configure.py 2006-06-20 14:36:54 UTC (rev 315) +++ build/configure.py 2006-06-20 14:42:55 UTC (rev 316) @@ -182,7 +182,7 @@ def CheckProgram(ctxt,progname,varname,moredirs=[],critical=1): ctxt.Message("Checking for Program " + progname + "...") - if exists(ctxt.env[varname]): + if ctxt.env[varname] is not None and exists(ctxt.env[varname]): ret = 1 else: paths = sjoin(moredirs,':') + ':' + ctxt.env['ENV']['PATH'] _______________________________________________ hlvm-commits mailing list hlvm-commits at hlvm.org http://hlvm.org/mailman/listinfo/hlvm-commits From rspencer at reidspencer.com Tue Jun 20 09:55:51 2006 From: rspencer at reidspencer.com (rspencer at reidspencer.com) Date: Tue, 20 Jun 2006 10:55:51 -0400 Subject: [hlvm-commits] r317 - / Message-ID: <200606201455.k5KEtp91009494@sneezy.swagora.com> Author: reid Date: 2006-06-20 10:55:50 -0400 (Tue, 20 Jun 2006) New Revision: 317 Log: Don't search the llvm-gcc4 install area before the gcc install area or you'll end up finding the wrong compiler! Modified: Makefile Modified: Makefile =================================================================== --- Makefile 2006-06-20 14:42:55 UTC (rev 316) +++ Makefile 2006-06-20 14:55:50 UTC (rev 317) @@ -13,7 +13,7 @@ MYMODE := Debug # Specify a path for where the 3rd party software is installed -MYPATH := /proj/llvm/cfe/install:/proj/install +MYPATH := /proj/install:/proj/llvm/cfe/install # Specify where you want HLVM to be installed MYPREFIX := /proj/install/hlvm _______________________________________________ hlvm-commits mailing list hlvm-commits at hlvm.org http://hlvm.org/mailman/listinfo/hlvm-commits From rspencer at reidspencer.com Tue Jun 20 10:16:04 2006 From: rspencer at reidspencer.com (rspencer at reidspencer.com) Date: Tue, 20 Jun 2006 11:16:04 -0400 Subject: [hlvm-commits] r318 - docs Message-ID: <200606201516.k5KFG4So009515@sneezy.swagora.com> Author: reid Date: 2006-06-20 11:16:03 -0400 (Tue, 20 Jun 2006) New Revision: 318 Log: Add a section on getting and installing SCons Modified: docs/DevelopersGuide.html Modified: docs/DevelopersGuide.html =================================================================== --- docs/DevelopersGuide.html 2006-06-20 14:55:50 UTC (rev 317) +++ docs/DevelopersGuide.html 2006-06-20 15:16:03 UTC (rev 318) @@ -496,8 +496,21 @@ ../cfe/configure --prefix=/proj/llvm-gcc4/cfe/install \ --enable-llvm=/proj/llvm/build --enable-languages=c,c++ make - make install - + make install +

    Install SCons

    +

    As noted earlier, HLVM uses the SCons tool for its builds. You need version + 0.96.92. Install it like this:

    +
    +  cd /proj/scons
    +  wget http://internap.dl.sourceforge.net/sourceforge/scons/scons-0.96.92.tar.gz
    +  tar zxf scons-0.96.92.tar.gz
    +  python config.py install
    +

    Alternatively, you could use one of the SCons packages, such as:

    +
    +  cd /proj/scons
    +  wget http://internap.dl.sourceforge.net/sourceforge/scons/scons-0.96.92-1.noarch.rpm
    +  rpm --install scons-0.96.92-1.noarch.rpm
    +

    Build HLVM

    Note in the following that if you've actually used /proj as your build area then you don't need to provide any arguments to make as @@ -509,8 +522,7 @@ svn co svn://hlvm.org/hlvm hlvm cd hlvm make MYMODE=Debug MYPATH=/proj/llvm/cfe/install:/proj/install \ - MYPREFIX=/proj/install/bin - + MYPREFIX=/proj/install/bin

    Coding Style

    _______________________________________________ hlvm-commits mailing list hlvm-commits at hlvm.org http://hlvm.org/mailman/listinfo/hlvm-commits From rspencer at reidspencer.com Tue Jun 20 10:20:21 2006 From: rspencer at reidspencer.com (rspencer at reidspencer.com) Date: Tue, 20 Jun 2006 11:20:21 -0400 Subject: [hlvm-commits] r319 - test/return0 Message-ID: <200606201520.k5KFKLpA009534@sneezy.swagora.com> Author: reid Date: 2006-06-20 11:20:20 -0400 (Tue, 20 Jun 2006) New Revision: 319 Log: Make the constants s32 instead of u32 so they don't have type conflicts with the result of the program. Modified: test/return0/bitwise.hlx Modified: test/return0/bitwise.hlx =================================================================== --- test/return0/bitwise.hlx 2006-06-20 15:16:03 UTC (rev 318) +++ test/return0/bitwise.hlx 2006-06-20 15:20:20 UTC (rev 319) @@ -1,10 +1,10 @@ - 0f0f0f0f - 08080808 - 04040404 - 00000000 + 0f0f0f0f + 08080808 + 04040404 + 00000000 _______________________________________________ hlvm-commits mailing list hlvm-commits at hlvm.org http://hlvm.org/mailman/listinfo/hlvm-commits From rspencer at reidspencer.com Wed Jun 21 16:52:06 2006 From: rspencer at reidspencer.com (rspencer at reidspencer.com) Date: Wed, 21 Jun 2006 17:52:06 -0400 Subject: [hlvm-commits] r320 - in hlvm: Base Runtime Message-ID: <200606212152.k5LLq6wB025903@sneezy.swagora.com> Author: reid Date: 2006-06-21 17:52:05 -0400 (Wed, 21 Jun 2006) New Revision: 320 Log: Renamed Config.h.in so that it doesn't conflict with config.h on cast insensitive file systems. Added: hlvm/Base/Configuration.h.in Removed: hlvm/Base/Config.h.in Modified: hlvm/Base/Memory.cpp hlvm/Base/SConscript hlvm/Runtime/Main.cpp Deleted: hlvm/Base/Config.h.in =================================================================== --- hlvm/Base/Config.h.in 2006-06-20 15:20:20 UTC (rev 319) +++ hlvm/Base/Config.h.in 2006-06-21 21:52:05 UTC (rev 320) @@ -1,100 +0,0 @@ -//===-- HLVM Configuration Template -----------------------------*- 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/Base/Config.h.in -/// @author Reid Spencer (original author) -/// @date 2006/05/04 -/// @since 0.1.0 -/// @brief Template header for capturing configuration data -//===------------------------