[llvm-commits] [llvm-gcc-4.2] r62080 - /llvm-gcc-4.2/trunk/gcc/llvm-internal.h
Evan Cheng
evan.cheng at apple.com
Sun Jan 11 22:16:35 PST 2009
Author: evancheng
Date: Mon Jan 12 00:16:35 2009
New Revision: 62080
URL: http://llvm.org/viewvc/llvm-project?rev=62080&view=rev
Log:
Forgot to commit this.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-internal.h
Modified: llvm-gcc-4.2/trunk/gcc/llvm-internal.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-internal.h?rev=62080&r1=62079&r2=62080&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-internal.h (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-internal.h Mon Jan 12 00:16:35 2009
@@ -251,23 +251,30 @@
};
/// LValue - This struct represents an lvalue in the program. In particular,
-/// the Ptr member indicates the memory that the lvalue lives in. If this is
-/// a bitfield reference, BitStart indicates the first bit in the memory that
-/// is part of the field and BitSize indicates the extent.
+/// the Ptr member indicates the memory that the lvalue lives in. Alignment
+/// is the alignment of the memory (in bytes).If this is a bitfield reference,
+/// BitStart indicates the first bit in the memory that is part of the field
+/// and BitSize indicates the extent.
///
/// "LValue" is intended to be a light-weight object passed around by-value.
struct LValue {
Value *Ptr;
+ unsigned char Alignment;
unsigned char BitStart;
unsigned char BitSize;
- LValue(Value *P) : Ptr(P), BitStart(255), BitSize(255) {}
- LValue(Value *P, unsigned BSt, unsigned BSi)
- : Ptr(P), BitStart(BSt), BitSize(BSi) {
+ LValue(Value *P, unsigned Align)
+ : Ptr(P), Alignment(Align), BitStart(255), BitSize(255) {}
+ LValue(Value *P, unsigned Align, unsigned BSt, unsigned BSi)
+ : Ptr(P), Alignment(Align), BitStart(BSt), BitSize(BSi) {
assert(BitStart == BSt && BitSize == BSi &&
"Bit values larger than 256?");
+ }
+
+ unsigned getAlignment() const {
+ assert(Alignment && "LValue alignment cannot be zero!");
+ return Alignment;
}
-
bool isBitfield() const { return BitStart != 255; }
};
More information about the llvm-commits
mailing list