X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FTarget%2FTarget.cpp;h=4b51b3f7eea5a24750f7233132a574f31fa5f00d;hb=a245b68293c5e8e103c9acb6b8e4ad5676dce15b;hp=ee5178184fb9ff03d2a969f2691a787da5af8a3a;hpb=57edc9d4ff1648568a5dd7e9958649065b260dca;p=oota-llvm.git diff --git a/lib/Target/Target.cpp b/lib/Target/Target.cpp index ee5178184fb..4b51b3f7eea 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,7 +47,9 @@ LLVMTargetDataRef LLVMCreateTargetData(const char *StringRep) { } void LLVMAddTargetData(LLVMTargetDataRef TD, LLVMPassManagerRef PM) { - unwrap(PM)->add(new DataLayoutPass(*unwrap(TD))); + // The DataLayoutPass must now be in sync with the module. Unfortunatelly we + // cannot enforce that from the C api. + unwrap(PM)->add(new DataLayoutPass()); } void LLVMAddTargetLibraryInfo(LLVMTargetLibraryInfoRef TLI,