[LLVMdev] some errors with LLVMContext

Amir Ramezani amir.ramezani1370 at gmail.com
Mon Sep 22 06:19:46 PDT 2014


hi all,
i'm building a compiler with LLVM for my engine
i've got this error:
g++.exe -std=c++11 -w -D_LARGEFILE64_SOURCE=1 -DHAVE_W32API_H
-D__WXMSW__ -DwxUSE_UNICODE -DwxUSE_UNICODE_MSLU
-DCRYPTOPP_ENABLE_NAMESPACE_WEAK -DBOOST_THREAD_USE_LIB
-DUNICODE -DSFML_STATIC -DINI_REAL=double -g -c
F:\projects\cpp\AGK\src\compiler.cpp -o obj\Debug\src\compiler.o
In file included from F:\projects\cpp\AGK\src\compiler.cpp:9:0:
F:\projects\cpp\AGK\src\compiler.hpp:54:27: error: 'getGlobalContext'
has not been declared
llvm::IRBuilder<> builder(getGlobalContext());
^
what should i do?
this is the header:
/**
*Audio Game Kit
*copyright(se)2014 amir rezaa ramezani
*this file is part of AGK
*distributed under the boost software license, version 1.0
*please see license.txt file in the main directory of the project
***/

#ifndef AGK_COMPILER_H
#define AGK_COMPILER_H

#ifndef ANGELSCRIPT_H
#include <angelscript.h>
#endif
#include <llvm/IR/Verifier.h>
#include <llvm/IR/LLVMContext.h>
#include <llvm/IR/Module.h>
#include <llvm/IR/IRBuilder.h>
#include <llvm/IR/AutoUpgrade.h>
#include <llvm/IR/DerivedTypes.h>
#include <llvm/IR/DIBuilder.h>
#include <llvm/IR/Value.h>
#include <llvm/PassManager.h>
#include <llvm/ExecutionEngine/ExecutionEngine.h>
#include <llvm/ExecutionEngine/JIT.h>
#include <llvm/ExecutionEngine/MCJIT.h>
#include <llvm/Bitcode/ReaderWriter.h>
#include <llvm/Object/COFF.h>
#include <llvm/Object/ELF.h>
#include <llvm/Object/MachO.h>
#include <llvm/Support/DynamicLibrary.h>
#include <llvm-c/TargetMachine.h>
#include <llvm-c/Object.h>
#include <vector>
#include <map>
#include <memory>
#include <stack>

/*
*this is a compiler class that can compile AngelScript scripts to
executables using LLVM frontend
*/
class compiler: public asIJITCompiler
{
public:
compiler();
~compiler();
int CompileFunction(asIScriptFunction *function, asJITFunction *output);
void ReleaseJITFunction(asJITFunction func);
void Save(const char* filename);
private:
asIScriptEngine *engine;
asIScriptModule *module;
asIScriptFunction *mainfunc;
llvm::IRBuilder<> builder(getGlobalContext());
llvm::Module *mod;
llvm::ExecutionEngine *exec;
};

#endif

please help
thanks in advance



More information about the llvm-dev mailing list