summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-12-03 04:14:32 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-12-03 04:14:32 +0000
commita0544d6fdf44a9a28ab324478fcf463d9e37a116 (patch)
tree19c35ff91754811a816dd29b050a034e549bf6f7 /clang/lib/CodeGen/CodeGenFunction.h
parentb2b0795c9fb3e01a60e5592a3ec8816a3d2addb0 (diff)
downloadbcm5719-llvm-a0544d6fdf44a9a28ab324478fcf463d9e37a116.tar.gz
bcm5719-llvm-a0544d6fdf44a9a28ab324478fcf463d9e37a116.zip
Switch LValue so that it exposes alignment in CharUnits. (No functional change.)
llvm-svn: 145753
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index 74f48c3d805..d611996bd1e 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -1537,16 +1537,15 @@ public:
// Helpers
//===--------------------------------------------------------------------===//
- LValue MakeAddrLValue(llvm::Value *V, QualType T, unsigned Alignment = 0) {
+ LValue MakeAddrLValue(llvm::Value *V, QualType T,
+ CharUnits Alignment = CharUnits()) {
return LValue::MakeAddr(V, T, Alignment, getContext(),
CGM.getTBAAInfo(T));
}
LValue MakeNaturalAlignAddrLValue(llvm::Value *V, QualType T) {
- unsigned Alignment;
- if (T->isIncompleteType())
- Alignment = 0;
- else
- Alignment = getContext().getTypeAlignInChars(T).getQuantity();
+ CharUnits Alignment;
+ if (!T->isIncompleteType())
+ Alignment = getContext().getTypeAlignInChars(T);
return LValue::MakeAddr(V, T, Alignment, getContext(),
CGM.getTBAAInfo(T));
}
OpenPOWER on IntegriCloud