Fix for llvm 3.2 - TargetData -> DataLayout
This commit is contained in:
parent
e2e6221f25
commit
f3e9eb0b05
1 changed files with 6 additions and 5 deletions
|
|
@ -53,7 +53,7 @@
|
||||||
#include "llvm/Support/MemoryBuffer.h"
|
#include "llvm/Support/MemoryBuffer.h"
|
||||||
#include "llvm/Support/CallSite.h"
|
#include "llvm/Support/CallSite.h"
|
||||||
#include "llvm/Support/FormattedStream.h"
|
#include "llvm/Support/FormattedStream.h"
|
||||||
#include "llvm/Target/TargetData.h"
|
//#include "llvm/Target/TargetData.h"
|
||||||
#include "llvm/Support/TargetRegistry.h"
|
#include "llvm/Support/TargetRegistry.h"
|
||||||
#include "llvm/Support/TargetSelect.h"
|
#include "llvm/Support/TargetSelect.h"
|
||||||
#include "llvm/Support/Host.h"
|
#include "llvm/Support/Host.h"
|
||||||
|
|
@ -356,12 +356,12 @@ unsigned char* LLVMTargetMachineEmitFile(LLVMTargetMachineRef tmref,
|
||||||
|
|
||||||
PassManager pm;
|
PassManager pm;
|
||||||
|
|
||||||
if (!tm->getTargetData()){
|
if (!tm->getDataLayout()){
|
||||||
error = "No target data in target machine";
|
error = "No target data in target machine";
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
pm.add(new TargetData(*tm->getTargetData()));
|
pm.add(new DataLayout(*tm->getDataLayout()));
|
||||||
|
|
||||||
bool failed;
|
bool failed;
|
||||||
if( assembly ) {
|
if( assembly ) {
|
||||||
|
|
@ -427,7 +427,7 @@ void LLVMPrintRegisteredTargetsForVersion(){
|
||||||
LLVMTargetDataRef LLVMTargetMachineGetTargetData(LLVMTargetMachineRef tm)
|
LLVMTargetDataRef LLVMTargetMachineGetTargetData(LLVMTargetMachineRef tm)
|
||||||
{
|
{
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
return wrap(new TargetData(*unwrap(tm)->getTargetData()));
|
return wrap(new DataLayout(*unwrap(tm)->getDataLayout()));
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned char* LLVMGetNativeCodeFromModule(LLVMModuleRef module, int assembly,
|
unsigned char* LLVMGetNativeCodeFromModule(LLVMModuleRef module, int assembly,
|
||||||
|
|
@ -992,7 +992,8 @@ void LLVMSetDoesNotThrow(LLVMValueRef fn, int DoesNotThrow)
|
||||||
llvm::Function *fnp = llvm::unwrap<llvm::Function>(fn);
|
llvm::Function *fnp = llvm::unwrap<llvm::Function>(fn);
|
||||||
assert(fnp);
|
assert(fnp);
|
||||||
|
|
||||||
return fnp->setDoesNotThrow((bool)DoesNotThrow);
|
if ((bool)DoesNotThrow)
|
||||||
|
fnp->setDoesNotThrow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue