Many fixes for recent LLVM dev tree API changes
This commit is contained in:
8
stmt.cpp
8
stmt.cpp
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user