[un]wrap extracted from lib/Target/Target[MachineC].cpp, lib/ExecutionEngine/ExecutionEngineBindings.cpp into include/llvm/IR/DataLayout.h

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208680 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Artyom Skrobov 2014-05-13 09:45:26 +00:00
parent e9592d0838
commit 04b617977e
4 changed files with 10 additions and 33 deletions

View File

@ -445,6 +445,16 @@ public:
}
};
typedef struct LLVMOpaqueTargetData *LLVMTargetDataRef;
inline DataLayout *unwrap(LLVMTargetDataRef P) {
return reinterpret_cast<DataLayout*>(P);
}
inline LLVMTargetDataRef wrap(const DataLayout *P) {
return reinterpret_cast<LLVMTargetDataRef>(const_cast<DataLayout*>(P));
}
class DataLayoutPass : public ImmutablePass {
DataLayout DL;

View File

@ -27,14 +27,6 @@ using namespace llvm;
// Wrapping the C bindings types.
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(GenericValue, LLVMGenericValueRef)
inline DataLayout *unwrap(LLVMTargetDataRef P) {
return reinterpret_cast<DataLayout*>(P);
}
inline LLVMTargetDataRef wrap(const DataLayout *P) {
return reinterpret_cast<LLVMTargetDataRef>(const_cast<DataLayout*>(P));
}
inline TargetLibraryInfo *unwrap(LLVMTargetLibraryInfoRef P) {
return reinterpret_cast<TargetLibraryInfo*>(P);
}

View File

@ -24,14 +24,6 @@
using namespace llvm;
inline DataLayout *unwrap(LLVMTargetDataRef P) {
return reinterpret_cast<DataLayout*>(P);
}
inline LLVMTargetDataRef wrap(const DataLayout *P) {
return reinterpret_cast<LLVMTargetDataRef>(const_cast<DataLayout*>(P));
}
inline TargetLibraryInfo *unwrap(LLVMTargetLibraryInfoRef P) {
return reinterpret_cast<TargetLibraryInfo*>(P);
}

View File

@ -30,23 +30,6 @@
using namespace llvm;
inline DataLayout *unwrap(LLVMTargetDataRef P) {
return reinterpret_cast<DataLayout*>(P);
}
inline LLVMTargetDataRef wrap(const DataLayout *P) {
return reinterpret_cast<LLVMTargetDataRef>(const_cast<DataLayout*>(P));
}
inline TargetLibraryInfo *unwrap(LLVMTargetLibraryInfoRef P) {
return reinterpret_cast<TargetLibraryInfo*>(P);
}
inline LLVMTargetLibraryInfoRef wrap(const TargetLibraryInfo *P) {
TargetLibraryInfo *X = const_cast<TargetLibraryInfo*>(P);
return reinterpret_cast<LLVMTargetLibraryInfoRef>(X);
}
inline TargetMachine *unwrap(LLVMTargetMachineRef P) {
return reinterpret_cast<TargetMachine*>(P);
}