forked from OSchip/llvm-project
AST: Simplify CharUnits::alignmentAtOffset
CharUnits::alignmentAtOffset is equivalent to llvm::MinAlign but slightly less efficient. Use it's implementation instead. llvm-svn: 202099
This commit is contained in:
parent
e385d89ce6
commit
5090d9a732
|
@ -173,12 +173,7 @@ namespace clang {
|
|||
/// Given that this is a non-zero alignment value, what is the
|
||||
/// alignment at the given offset?
|
||||
CharUnits alignmentAtOffset(CharUnits offset) {
|
||||
// alignment: 0010000
|
||||
// offset: 1011100
|
||||
// lowBits: 0001011
|
||||
// result: 0000100
|
||||
QuantityType lowBits = (Quantity-1) & (offset.Quantity-1);
|
||||
return CharUnits((lowBits + 1) & ~lowBits);
|
||||
return CharUnits(llvm::MinAlign(Quantity, offset.Quantity));
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue