Many fixes for recent LLVM dev tree API changes

This commit is contained in:
Matt Pharr
2011-07-18 15:54:39 +01:00
parent 65a29ec316
commit 654cfb4b4b
11 changed files with 233 additions and 154 deletions

View File

@@ -133,7 +133,7 @@ lInitSymbol(llvm::Value *lvalue, const char *symName, const Type *type,
// Initialize things without initializers to the undefined value.
// To auto-initialize everything to zero, replace 'UndefValue' with
// 'NullValue' in the below
const llvm::Type *ltype = type->LLVMType(g->ctx);
LLVM_TYPE_CONST llvm::Type *ltype = type->LLVMType(g->ctx);
ctx->StoreInst(llvm::UndefValue::get(ltype), lvalue);
return;
}
@@ -281,7 +281,7 @@ DeclStmt::EmitCode(FunctionEmitContext *ctx) const {
continue;
}
const llvm::Type *llvmType = type->LLVMType(g->ctx);
LLVM_TYPE_CONST llvm::Type *llvmType = type->LLVMType(g->ctx);
assert(llvmType != NULL);
if (declaration->declSpecs->storageClass == SC_STATIC) {
@@ -1414,7 +1414,7 @@ lProcessPrintArg(Expr *expr, FunctionEmitContext *ctx, std::string &argTypes) {
else {
argTypes.push_back(t);
const llvm::Type *llvmExprType = type->LLVMType(g->ctx);
LLVM_TYPE_CONST llvm::Type *llvmExprType = type->LLVMType(g->ctx);
llvm::Value *ptr = ctx->AllocaInst(llvmExprType, "print_arg");
llvm::Value *val = expr->GetValue(ctx);
if (!val)
@@ -1460,7 +1460,7 @@ PrintStmt::EmitCode(FunctionEmitContext *ctx) const {
int nArgs = elist ? elist->exprs.size() : 1;
// Allocate space for the array of pointers to values to be printed
const llvm::Type *argPtrArrayType =
LLVM_TYPE_CONST llvm::Type *argPtrArrayType =
llvm::ArrayType::get(LLVMTypes::VoidPointerType, nArgs);
llvm::Value *argPtrArray = ctx->AllocaInst(argPtrArrayType,
"print_arg_ptrs");