diff options
author | Chad Rosier <mcrosier@apple.com> | 2013-04-01 22:02:05 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2013-04-01 22:02:05 +0000 |
commit | c3aa20265adc492bf9432589c7f8072d6ea3eb31 (patch) | |
tree | 6acd0073e275839696d58beac08428df34d04daa /clang/lib/Sema/SemaStmtAsm.cpp | |
parent | 9423f507b1541266d1d8eebed01572afc6f6f207 (diff) | |
download | bcm5719-llvm-c3aa20265adc492bf9432589c7f8072d6ea3eb31.tar.gz bcm5719-llvm-c3aa20265adc492bf9432589c7f8072d6ea3eb31.zip |
Use the ASYContext::getTypeSizeInChars API to cleanup some ugliness, per John
and Jordan's suggestion. No functional change intendend.
llvm-svn: 178507
Diffstat (limited to 'clang/lib/Sema/SemaStmtAsm.cpp')
-rw-r--r-- | clang/lib/Sema/SemaStmtAsm.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaStmtAsm.cpp b/clang/lib/Sema/SemaStmtAsm.cpp index 6b13f71c3ae..da33bdf717e 100644 --- a/clang/lib/Sema/SemaStmtAsm.cpp +++ b/clang/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; } |