aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2013-04-01 22:02:05 +0000
committerChad Rosier <mcrosier@apple.com>2013-04-01 22:02:05 +0000
commitd94a3a06b7306aea0455c21abe1cadfe275469fc (patch)
tree3b1a8eea4d0484b31ec3ed811ae1fdf4c05e752d
parent725fe0ede4c5355666a300f4fd7dae9454f35a37 (diff)
Use the ASYContext::getTypeSizeInChars API to cleanup some ugliness, per John
and Jordan's suggestion. No functional change intendend. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178507 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaStmtAsm.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Sema/SemaStmtAsm.cpp b/lib/Sema/SemaStmtAsm.cpp
index 6b13f71c3a..da33bdf717 100644
--- a/lib/Sema/SemaStmtAsm.cpp
+++ b/lib/Sema/SemaStmtAsm.cpp
@@ -519,15 +519,13 @@ NamedDecl *Sema::LookupInlineAsmIdentifier(StringRef Name, SourceLocation Loc,
if (isa<FunctionDecl>(FoundDecl))
return FoundDecl;
if (VarDecl *Var = dyn_cast<VarDecl>(FoundDecl)) {
- Type = Context.getTypeInfo(Var->getType()).first;
QualType Ty = Var->getType();
+ Type = Size = Context.getTypeSizeInChars(Ty).getQuantity();
if (Ty->isArrayType()) {
const ArrayType *ATy = Context.getAsArrayType(Ty);
- Length = Type / Context.getTypeInfo(ATy->getElementType()).first;
- Type /= Length; // Type is in terms of a single element.
+ Type = Context.getTypeSizeInChars(ATy->getElementType()).getQuantity();
+ Length = Size / Type;
}
- Type /= 8; // Type is in terms of bits, but we want bytes.
- Size = Length * Type;
IsVarDecl = true;
return FoundDecl;
}