X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FTarget%2FTarget.cpp;h=d277f82eb869bd2f983f9bca31a535e1085a4fe0;hb=8308f0e30fb647576a9a9de775e45fb4b1c0a08f;hp=ee5178184fb9ff03d2a969f2691a787da5af8a3a;hpb=57edc9d4ff1648568a5dd7e9958649065b260dca;p=oota-llvm.git diff --git a/lib/Target/Target.cpp b/lib/Target/Target.cpp index ee5178184fb..d277f82eb86 100644 --- a/lib/Target/Target.cpp +++ b/lib/Target/Target.cpp @@ -24,14 +24,6 @@ using namespace llvm; -inline DataLayout *unwrap(LLVMTargetDataRef P) { - return reinterpret_cast(P); -} - -inline LLVMTargetDataRef wrap(const DataLayout *P) { - return reinterpret_cast(const_cast(P)); -} - inline TargetLibraryInfo *unwrap(LLVMTargetLibraryInfoRef P) { return reinterpret_cast(P); } @@ -55,6 +47,8 @@ LLVMTargetDataRef LLVMCreateTargetData(const char *StringRep) { } void LLVMAddTargetData(LLVMTargetDataRef TD, LLVMPassManagerRef PM) { + // The DataLayoutPass must now be in sync with the module. Unfortunatelly we + // cannot enforce that from the C api. unwrap(PM)->add(new DataLayoutPass(*unwrap(TD))); }