[llvm-commits] [hlvm] r38124 - in /hlvm/trunk: build/filterbuilders.py build/hlvm.py docs/SConscript hlvm/AST/AST.cpp hlvm/CodeGen/LLVMGenerator.cpp hlvm/CodeGen/SConscript tools/hlvm-compiler/SConscript tools/hlvm-compiler/hlvm-compiler.cpp
Reid Spencer
reid at x10sys.com
Sat Jul 7 17:00:05 PDT 2007
Author: reid
Date: Sat Jul 7 19:00:05 2007
New Revision: 38124
URL: http://llvm.org/viewvc/llvm-project?rev=38124&view=rev
Log:
Get some build problems out of the way.
Modified:
hlvm/trunk/build/filterbuilders.py
hlvm/trunk/build/hlvm.py
hlvm/trunk/docs/SConscript
hlvm/trunk/hlvm/AST/AST.cpp
hlvm/trunk/hlvm/CodeGen/LLVMGenerator.cpp
hlvm/trunk/hlvm/CodeGen/SConscript
hlvm/trunk/tools/hlvm-compiler/SConscript
hlvm/trunk/tools/hlvm-compiler/hlvm-compiler.cpp
Modified: hlvm/trunk/build/filterbuilders.py
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/build/filterbuilders.py?rev=38124&r1=38123&r2=38124&view=diff
==============================================================================
--- hlvm/trunk/build/filterbuilders.py (original)
+++ hlvm/trunk/build/filterbuilders.py Sat Jul 7 19:00:05 2007
@@ -94,7 +94,7 @@
tknFile.write('%%\n')
tknFile.close()
gperfAction = env.Action(
- env['GPERF'] + " -tcDCIoGl --fast 0 -L C++ -Z " + TokenHashClass +
+ env['with_gperf'] + " -tcDCIoGl --fast 0 -L C++ -Z " + TokenHashClass +
" -s 2 -S 1 -k '*' " + tknFilename + " >" + TokenHashFile)
env.Execute(gperfAction)
tokenList = ""
Modified: hlvm/trunk/build/hlvm.py
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/build/hlvm.py?rev=38124&r1=38123&r2=38124&view=diff
==============================================================================
--- hlvm/trunk/build/hlvm.py (original)
+++ hlvm/trunk/build/hlvm.py Sat Jul 7 19:00:05 2007
@@ -17,7 +17,7 @@
return glob.glob(spec)
def GetAllCXXFiles(env):
- return env.Flatten([GetFiles(env,'*.cpp')])
+ return GetFiles(env,'*.cpp')
def GetRNGQuoteSource(env):
from build import filterbuilders
Modified: hlvm/trunk/docs/SConscript
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/docs/SConscript?rev=38124&r1=38123&r2=38124&view=diff
==============================================================================
--- hlvm/trunk/docs/SConscript (original)
+++ hlvm/trunk/docs/SConscript Sat Jul 7 19:00:05 2007
@@ -22,7 +22,7 @@
#===----------------------------------------------------------------------===#
from os.path import join as pjoin
Import('env')
-cmd = '$XSLTPROC ' + pjoin(env['AbsSrcRoot'],'docs','RngToXHTML.xsl') + ' $SOURCE > $TARGET'
+cmd = '$with_xsltproc ' + pjoin(env['AbsSrcRoot'],'docs','RngToXHTML.xsl') + ' $SOURCE > $TARGET'
rng2xhtml = Builder(action=cmd, src_suffix='rng', suffix='html')
env.Append(BUILDERS= {'Rng2XHTML':rng2xhtml})
env.Rng2XHTML('HLVM.rng.html',['HLVM.rng'])
Modified: hlvm/trunk/hlvm/AST/AST.cpp
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/AST.cpp?rev=38124&r1=38123&r2=38124&view=diff
==============================================================================
--- hlvm/trunk/hlvm/AST/AST.cpp (original)
+++ hlvm/trunk/hlvm/AST/AST.cpp Sat Jul 7 19:00:05 2007
@@ -77,7 +77,7 @@
CharacterType* CharacterSingleton;
OctetType* OctetSingleton;
IntegerType* UInt8Singleton;
- IntegerType* UInt16Singleton;;
+ IntegerType* UInt16Singleton;
IntegerType* UInt32Singleton;
IntegerType* UInt64Singleton;
IntegerType* UInt128Singleton;
Modified: hlvm/trunk/hlvm/CodeGen/LLVMGenerator.cpp
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/CodeGen/LLVMGenerator.cpp?rev=38124&r1=38123&r2=38124&view=diff
==============================================================================
--- hlvm/trunk/hlvm/CodeGen/LLVMGenerator.cpp (original)
+++ hlvm/trunk/hlvm/CodeGen/LLVMGenerator.cpp Sat Jul 7 19:00:05 2007
@@ -27,7 +27,7 @@
/// @brief Provides the implementation of the HLVM -> LLVM Code Generator
//===----------------------------------------------------------------------===//
-#include <hlvm/CodeGen/LLVM/LLVMGenerator.h>
+#include <hlvm/CodeGen/LLVMGenerator.h>
#include <hlvm/AST/AST.h>
#include <hlvm/AST/Bundle.h>
#include <hlvm/AST/Import.h>
@@ -53,12 +53,18 @@
#include <llvm/PassManager.h>
#include <llvm/Assembly/PrintModulePass.h>
-using namespace hlvm;
+//namespace {
+//using namespace llvm;
+//include <hlvm/CodeGen/string_decl.inc>
+//include <hlvm/CodeGen/program.inc>
+//}
+
namespace
{
+using namespace hlvm;
-class LLVMGeneratorPass : public Pass
+class LLVMGeneratorPass : public hlvm::Pass
{
public:
LLVMGeneratorPass(const AST* tree)
@@ -68,7 +74,7 @@
~LLVMGeneratorPass() { }
/// Conversion functions
- inline const llvm::Type* getType(const Type* ty);
+ inline const llvm::Type* getType(const hlvm::Type* ty);
inline llvm::GlobalValue::LinkageTypes getLinkageTypes(LinkageKinds lk);
inline std::string getLinkageName(LinkageItem* li);
@@ -84,14 +90,14 @@
inline void gen(RealType* t);
inline void gen(OctetType* t);
inline void gen(VoidType* t);
- inline void gen(PointerType* t);
- inline void gen(ArrayType* t);
+ inline void gen(hlvm::PointerType* t);
+ inline void gen(hlvm::ArrayType* t);
inline void gen(VectorType* t);
inline void gen(StructureType* t);
inline void gen(SignatureType* t);
inline void gen(ConstLiteralInteger* t);
inline void gen(Variable* v);
- inline void gen(Function* f);
+ inline void gen(hlvm::Function* f);
inline void gen(Program* p);
inline void gen(Block* f);
inline void gen(ReturnOp* f);
@@ -113,13 +119,13 @@
///< The current LLVM instructions we're generating
const AST* ast; ///< The current Tree we're traversing
const Bundle* bundle; ///< The current Bundle we're traversing
- const Function* function; ///< The current Function we're traversing
+ const hlvm::Function* function; ///< The current Function we're traversing
const Block* block; ///< The current Block we're traversing
};
const llvm::Type*
-LLVMGeneratorPass::getType(const Type* ty)
+LLVMGeneratorPass::getType(const hlvm::Type* ty)
{
// First, lets see if its cached already
const llvm::Type* result = ltypes.lookup(ty->getName());
@@ -182,12 +188,12 @@
}
case PointerTypeID: {
result = llvm::PointerType::get(
- getType(llvm::cast<PointerType>(ty)->getTargetType()));
+ getType(llvm::cast<hlvm::PointerType>(ty)->getTargetType()));
break;
}
case ArrayTypeID: {
const llvm::Type* elemType =
- getType(llvm::cast<ArrayType>(ty)->getElementType());
+ getType(llvm::cast<hlvm::ArrayType>(ty)->getElementType());
std::vector<const llvm::Type*> Fields;
Fields.push_back(llvm::Type::UIntTy);
Fields.push_back(llvm::PointerType::get(elemType));
@@ -253,12 +259,12 @@
}
void
-LLVMGeneratorPass::gen(PointerType* t)
+LLVMGeneratorPass::gen(hlvm::PointerType* t)
{
}
void
-LLVMGeneratorPass::gen(ArrayType* t)
+LLVMGeneratorPass::gen(hlvm::ArrayType* t)
{
}
@@ -280,7 +286,7 @@
void
LLVMGeneratorPass::gen(ConstLiteralInteger* i)
{
- const Type* hType = i->getType();
+ const hlvm::Type* hType = i->getType();
const llvm::Type* lType = getType(hType);
if (llvm::cast<IntegerType>(hType)->isSigned())
lops.push_back(llvm::ConstantSInt::get(lType,i->getValue()));
@@ -334,7 +340,7 @@
}
void
-LLVMGeneratorPass::gen(Function* f)
+LLVMGeneratorPass::gen(hlvm::Function* f)
{
lfunc = new llvm::Function(
llvm::cast<llvm::FunctionType>(getType(f->getSignature())),
@@ -411,7 +417,7 @@
// container that is being asked for.
switch (n->getID()) {
case BundleID: gen(llvm::cast<Bundle>(n)); break;
- case FunctionID: gen(llvm::cast<Function>(n)); break;
+ case FunctionID: gen(llvm::cast<hlvm::Function>(n)); break;
case ProgramID: gen(llvm::cast<Program>(n)); break;
case BlockID: gen(llvm::cast<Block>(n)); break;
default:
@@ -432,8 +438,8 @@
case RealTypeID: gen(llvm::cast<RealType>(n)); break;
case OctetTypeID: gen(llvm::cast<OctetType>(n)); break;
case VoidTypeID: gen(llvm::cast<VoidType>(n)); break;
- case PointerTypeID: gen(llvm::cast<PointerType>(n)); break;
- case ArrayTypeID: gen(llvm::cast<ArrayType>(n)); break;
+ case PointerTypeID: gen(llvm::cast<hlvm::PointerType>(n)); break;
+ case ArrayTypeID: gen(llvm::cast<hlvm::ArrayType>(n)); break;
case VectorTypeID: gen(llvm::cast<VectorType>(n)); break;
case StructureTypeID: gen(llvm::cast<StructureType>(n)); break;
case SignatureTypeID: gen(llvm::cast<SignatureType>(n)); break;
@@ -460,8 +466,10 @@
}
+namespace hlvm {
+
void
-hlvm::generateBytecode(AST* tree,std::ostream& output)
+generateBytecode(AST* tree,std::ostream& output)
{
hlvm::PassManager* PM = hlvm::PassManager::create();
LLVMGeneratorPass genPass(tree);
@@ -474,7 +482,7 @@
}
void
-hlvm::generateAssembly(AST* tree, std::ostream& output)
+generateAssembly(AST* tree, std::ostream& output)
{
hlvm::PassManager* PM = hlvm::PassManager::create();
LLVMGeneratorPass genPass(tree);
@@ -487,3 +495,5 @@
delete mod;
delete PM;
}
+
+}
Modified: hlvm/trunk/hlvm/CodeGen/SConscript
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/CodeGen/SConscript?rev=38124&r1=38123&r2=38124&view=diff
==============================================================================
--- hlvm/trunk/hlvm/CodeGen/SConscript (original)
+++ hlvm/trunk/hlvm/CodeGen/SConscript Sat Jul 7 19:00:05 2007
@@ -22,5 +22,10 @@
#===----------------------------------------------------------------------===#
from build import hlvm
Import('env')
-lib = env.Library('HLVMLCodeGen',hlvm.GetAllCXXFiles(env))
+hlvm.GetCpp2LLVMCpp(env)
+env.Cpp2LLVMCpp('string_decl.inc','string.cxx',
+ LLVM2CPPFLAGS='-gen-type -for struct._hlvm_string -funcname getStringDecl')
+env.Cpp2LLVMCpp('program.inc','program.cxx',
+ LLVM2CPPFLAGS='-gen-contents -funcname "getProgramDef"')
+lib = env.Library('HLVMCodeGen',hlvm.GetAllCXXFiles(env))
hlvm.InstallLibrary(env,lib)
Modified: hlvm/trunk/tools/hlvm-compiler/SConscript
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/tools/hlvm-compiler/SConscript?rev=38124&r1=38123&r2=38124&view=diff
==============================================================================
--- hlvm/trunk/tools/hlvm-compiler/SConscript (original)
+++ hlvm/trunk/tools/hlvm-compiler/SConscript Sat Jul 7 19:00:05 2007
@@ -25,7 +25,7 @@
Import('env')
prog = env.Program('hlvm-compiler', hlvm.GetAllCXXFiles(env),
LIBS=[
- 'HLVMLLVMCG',
+ 'HLVMCodeGen',
'HLVMXMLReader',
'HLVMXMLWriter',
'HLVMPass',
@@ -33,17 +33,15 @@
'HLVMBase',
'xml2',
'LLVMLinker',
+ 'LLVMBCReader',
+ 'LLVMBCWriter',
+ 'LLVMCore',
'LLVMSupport',
+ 'LLVMbzip2',
'LLVMSystem',
'apr-1',
'stdc++'
- ],
- LINKFLAGS=[
- pjoin(env['LLVM_lib'],'LLVMCore') + env['OBJSUFFIX'],
- pjoin(env['LLVM_lib'],'LLVMBCReader') + env['OBJSUFFIX'],
- pjoin(env['LLVM_lib'],'LLVMBCWriter') + env['OBJSUFFIX'],
- pjoin(env['LLVM_lib'],'LLVMbzip2') + env['OBJSUFFIX']
- ]
+ ]
)
hlvm.InstallProgram(env,prog)
Modified: hlvm/trunk/tools/hlvm-compiler/hlvm-compiler.cpp
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/tools/hlvm-compiler/hlvm-compiler.cpp?rev=38124&r1=38123&r2=38124&view=diff
==============================================================================
--- hlvm/trunk/tools/hlvm-compiler/hlvm-compiler.cpp (original)
+++ hlvm/trunk/tools/hlvm-compiler/hlvm-compiler.cpp Sat Jul 7 19:00:05 2007
@@ -31,7 +31,7 @@
#include <hlvm/Reader/XML/XMLReader.h>
#include <hlvm/Writer/XML/XMLWriter.h>
#include <hlvm/Pass/Pass.h>
-#include <hlvm/CodeGen/LLVM/LLVMGenerator.h>
+#include <hlvm/CodeGen/LLVMGenerator.h>
#include <llvm/Support/CommandLine.h>
#include <llvm/System/Signals.h>
#include <fstream>
More information about the llvm-commits
mailing list