Changeset View
Changeset View
Standalone View
Standalone View
llvm/include/llvm/Support/Alignment.h
Show First 20 Lines • Show All 327 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
inline MaybeAlign operator/(MaybeAlign Lhs, uint64_t Divisor) { | inline MaybeAlign operator/(MaybeAlign Lhs, uint64_t Divisor) { | ||||
assert(llvm::isPowerOf2_64(Divisor) && | assert(llvm::isPowerOf2_64(Divisor) && | ||||
"Divisor must be positive and a power of 2"); | "Divisor must be positive and a power of 2"); | ||||
return Lhs ? Lhs.getValue() / Divisor : MaybeAlign(); | return Lhs ? Lhs.getValue() / Divisor : MaybeAlign(); | ||||
} | } | ||||
inline Align max(MaybeAlign Lhs, Align Rhs) { | |||||
return Lhs && *Lhs > Rhs ? *Lhs : Rhs; | |||||
} | |||||
inline Align max(Align Lhs, MaybeAlign Rhs) { | |||||
return Rhs && *Rhs > Lhs ? *Rhs : Lhs; | |||||
} | |||||
#undef ALIGN_CHECK_ISPOSITIVE | #undef ALIGN_CHECK_ISPOSITIVE | ||||
#undef ALIGN_CHECK_ISSET | #undef ALIGN_CHECK_ISSET | ||||
} // namespace llvm | } // namespace llvm | ||||
#endif // LLVM_SUPPORT_ALIGNMENT_H_ | #endif // LLVM_SUPPORT_ALIGNMENT_H_ |