diff --git a/ctx.cpp b/ctx.cpp index eb2d4d81..27e2f0f4 100644 --- a/ctx.cpp +++ b/ctx.cpp @@ -1437,7 +1437,7 @@ FunctionEmitContext::addGSMetadata(llvm::Instruction *inst, SourcePos pos) { llvm::Value *line = LLVMInt32(pos.first_line); #ifdef LLVM_2_8 - md = llvm::MDNode::get(*g->ctx, &first_line, 1); + md = llvm::MDNode::get(*g->ctx, &line, 1); #else md = llvm::MDNode::get(*g->ctx, line); #endif @@ -1445,7 +1445,7 @@ FunctionEmitContext::addGSMetadata(llvm::Instruction *inst, SourcePos pos) { llvm::Value *column = LLVMInt32(pos.first_column); #ifdef LLVM_2_8 - md = llvm::MDNode::get(*g->ctx, &first_column, 1); + md = llvm::MDNode::get(*g->ctx, &column, 1); #else md = llvm::MDNode::get(*g->ctx, column); #endif diff --git a/main.cpp b/main.cpp index 09034828..2ec1f9a8 100644 --- a/main.cpp +++ b/main.cpp @@ -38,6 +38,7 @@ #include "ispc.h" #include "module.h" #include +#include #include #ifdef LLVM_2_8 #include diff --git a/module.cpp b/module.cpp index 42c03fbe..0c4b3a7c 100644 --- a/module.cpp +++ b/module.cpp @@ -82,7 +82,9 @@ #ifndef LLVM_2_8 #include #include -#endif // !LLVM_2_8 +#else // !LLVM_2_8 +#include +#endif // LLVM_2_8 #include #include #include