diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-02-17 22:16:19 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-02-17 22:16:19 +0000 |
commit | 43a5d9e409d9586db26910926b046aa8a3a69421 (patch) | |
tree | c19b02cfae3b5b6155e9d6ddffb9a6aae58f7027 /clang/lib/AST/ASTContext.cpp | |
parent | cf0da6c597fca4b13e4f4190506267ffb2bd2468 (diff) | |
download | bcm5719-llvm-43a5d9e409d9586db26910926b046aa8a3a69421.tar.gz bcm5719-llvm-43a5d9e409d9586db26910926b046aa8a3a69421.zip |
Eek! getDeclAlign sometimes returned alignment in bits.
- Renamed to getDeclAlignInBytes since most other query functions
work in bits.
- Fun to track down as isIntegerConstantExpr was getting it right,
but Evaluate() was getting it wrong. Maybe we should assert they
compute the same thing when they succeed?
llvm-svn: 64828
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r-- | clang/lib/AST/ASTContext.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index c87b08627dd..4a3f00f356a 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -263,7 +263,7 @@ const llvm::fltSemantics &ASTContext::getFloatTypeSemantics(QualType T) const { /// getDeclAlign - Return a conservative estimate of the alignment of the /// specified decl. Note that bitfields do not have a valid alignment, so /// this method will assert on them. -unsigned ASTContext::getDeclAlign(const Decl *D) { +unsigned ASTContext::getDeclAlignInBytes(const Decl *D) { // FIXME: If attribute(align) is specified on the decl, round up to it. if (const ValueDecl *VD = dyn_cast<ValueDecl>(D)) { @@ -275,7 +275,7 @@ unsigned ASTContext::getDeclAlign(const Decl *D) { while (isa<VariableArrayType>(T) || isa<IncompleteArrayType>(T)) T = cast<ArrayType>(T)->getElementType(); - return getTypeAlign(T); + return getTypeAlign(T) / Target.getCharWidth(); } return 1; |