Files
lifting-bits-remill/remill/BC/Compat/DataLayout.h
T
Peter Goodman 99df2e19d4 Running clang-format on files with some additional custom scripts for… (#444)
* Running clang-format on files with some additional custom scripts for my style

* Fix missing unique_ptr in remill/BC/Optimizer.h

* Fixes and selective disabling of clang-format
2020-08-05 15:42:25 -04:00

27 lines
686 B
C++

#include <llvm/IR/DataLayout.h>
namespace remill {
#if LLVM_VERSION_NUMBER < LLVM_VERSION(10, 0)
inline static uint64_t TypeSizeToBits(uint64_t bits) {
return bits;
}
inline static uint64_t BitsToTypeSize(uint64_t size) {
return size;
}
#else
inline static uint64_t TypeSizeToBits(llvm::TypeSize type_type) {
return type_type.getFixedSize();
}
inline static llvm::TypeSize BitsToTypeSize(uint64_t size) {
return llvm::TypeSize::Fixed(size);
}
#endif
inline static uint64_t SizeOfTypeInBits(const llvm::DataLayout &data_layout,
llvm::Type *type) {
return TypeSizeToBits(data_layout.getTypeSizeInBits(type));
}
} // namespace remill