create our own global context, it's been removed from LLVM

(cherry picked from commit 26a4e2bd13)
This commit is contained in:
Rainer Schuetze 2016-04-16 10:02:13 +02:00 committed by Kai Nacke
parent 5ec3e7d38b
commit eaa9e8130c
4 changed files with 17 additions and 5 deletions

View file

@ -36,6 +36,7 @@
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Transforms/Utils/ModuleUtils.h"
#include "llvm/Support/ManagedStatic.h"
#include <stack>
#include "llvm/Support/CommandLine.h"
@ -56,6 +57,13 @@ llvm::cl::opt<llvm::GlobalVariable::ThreadLocalMode> clThreadModel(
Type *getTypeInfoType(Type *t, Scope *sc);
/******************************************************************************
* Global context
******************************************************************************/
static llvm::ManagedStatic<llvm::LLVMContext> GlobalContext;
llvm::LLVMContext& getGlobalContext() { return *GlobalContext; }
/******************************************************************************
* DYNAMIC MEMORY HELPERS
******************************************************************************/