From b45ac7bee691a45ccf1c3dc8cdc9c80ea076f1ee Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Thu, 8 Sep 2011 23:38:35 +0200 Subject: Update to LLVM 2.9. --- MLKLexicalContext-MLKLLVMCompilation.mm | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'MLKLexicalContext-MLKLLVMCompilation.mm') diff --git a/MLKLexicalContext-MLKLLVMCompilation.mm b/MLKLexicalContext-MLKLLVMCompilation.mm index 936ada5..8f46a70 100644 --- a/MLKLexicalContext-MLKLLVMCompilation.mm +++ b/MLKLexicalContext-MLKLLVMCompilation.mm @@ -26,11 +26,12 @@ #include #include #include +#include #include +#include "llvm_context.h" using namespace llvm; using namespace std; - id MLKDummyUseLLVMLexicalContext = nil; @implementation MLKLexicalContext (MLKLLVMCompilation) @@ -57,11 +58,11 @@ id MLKDummyUseLLVMLexicalContext = nil; -(Instruction *) functionCellValueForSymbol:(id)name { - std::vector types (2, PointerType::get(PointerType::get(Type::Int8Ty, 0), 0)); - return (new IntToPtrInst (ConstantInt::get(Type::Int64Ty, + std::vector types (2, PointerType::get(PointerType::get(Int8Ty, 0), 0)); + return (new IntToPtrInst (ConstantInt::get(Int64Ty, (uint64_t)[self functionCellForSymbol:name], false), - PointerType::get(PointerType::get(FunctionType::get(PointerType::get(Type::Int8Ty, + PointerType::get(PointerType::get(FunctionType::get(PointerType::get(Int8Ty, 0), types, true), @@ -71,27 +72,27 @@ id MLKDummyUseLLVMLexicalContext = nil; -(Instruction *) closureDataPointerValueForSymbol:(id)name { - return (new IntToPtrInst (ConstantInt::get(Type::Int64Ty, + return (new IntToPtrInst (ConstantInt::get(Int64Ty, (uint64_t)[self closureDataPointerForSymbol:name], false), - PointerType::get(PointerType::get(PointerType::get(Type::Int8Ty, 0), 0), 0))); + PointerType::get(PointerType::get(PointerType::get(Int8Ty, 0), 0), 0))); } -(Instruction *) closureDataLengthValueForSymbol:(id)name { // The length cell isn't really a void** but an intptr_t*. - return (new IntToPtrInst (ConstantInt::get(Type::Int64Ty, + return (new IntToPtrInst (ConstantInt::get(Int64Ty, (uint64_t)[self closureDataLengthForSymbol:name], false), - PointerType::get(PointerType::get(Type::Int8Ty, 0), 0))); + PointerType::get(PointerType::get(Int8Ty, 0), 0))); } -(Instruction *) globalBindingValueForSymbol:(id)name { - return (new IntToPtrInst (ConstantInt::get(Type::Int64Ty, + return (new IntToPtrInst (ConstantInt::get(Int64Ty, (uint64_t)[self bindingForSymbol:name], false), - PointerType::get(Type::Int8Ty, 0))); + PointerType::get(Int8Ty, 0))); } -(Value *) bindingValueForSymbol:(id)name -- cgit v1.2.3