<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Apr 1, 2013, at 11:38 AM, John McCall <<a href="mailto:rjmccall@apple.com">rjmccall@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On Apr 1, 2013, at 11:10 AM, Jordan Rose <<a href="mailto:jordan_rose@apple.com">jordan_rose@apple.com</a>> wrote:<br><blockquote type="cite">On Apr 1, 2013, at 10:58 , Chad Rosier <<a href="mailto:mcrosier@apple.com">mcrosier@apple.com</a>> wrote:<br><blockquote type="cite">Author: mcrosier<br>Date: Mon Apr  1 12:58:03 2013<br>New Revision: 178481<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=178481&view=rev">http://llvm.org/viewvc/llvm-project?rev=178481&view=rev</a><br>Log:<br>Cleanup.  No functional change intended.<br><br>Modified:<br> cfe/trunk/lib/Sema/SemaStmtAsm.cpp<br><br>Modified: cfe/trunk/lib/Sema/SemaStmtAsm.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmtAsm.cpp?rev=178481&r1=178480&r2=178481&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmtAsm.cpp?rev=178481&r1=178480&r2=178481&view=diff</a><br>==============================================================================<br>--- cfe/trunk/lib/Sema/SemaStmtAsm.cpp (original)<br>+++ cfe/trunk/lib/Sema/SemaStmtAsm.cpp Mon Apr  1 12:58:03 2013<br>@@ -515,21 +515,21 @@ NamedDecl *Sema::LookupInlineAsmIdentifi<br>  return 0;<br>}<br><br>-  NamedDecl *ND = Result.getFoundDecl();<br>-  if (isa<VarDecl>(ND) || isa<FunctionDecl>(ND)) {<br>-    if (VarDecl *Var = dyn_cast<VarDecl>(ND)) {<br>-      Type = Context.getTypeInfo(Var->getType()).first;<br>-      QualType Ty = Var->getType();<br>-      if (Ty->isArrayType()) {<br>-        const ArrayType *ATy = Context.getAsArrayType(Ty);<br>-        Length = Type / Context.getTypeInfo(ATy->getElementType()).first;<br>-        Type /= Length; // Type is in terms of a single element.<br>-      }<br>-      Type /= 8; // Type is in terms of bits, but we want bytes.<br>-      Size = Length * Type;<br>-      IsVarDecl = true;<br>+  NamedDecl *FoundDecl = Result.getFoundDecl();<br>+  if (isa<FunctionDecl>(FoundDecl))<br>+    return FoundDecl;<br>+  if (VarDecl *Var = dyn_cast<VarDecl>(FoundDecl)) {<br>+    Type = Context.getTypeInfo(Var->getType()).first;<br>+    QualType Ty = Var->getType();<br>+    if (Ty->isArrayType()) {<br>+      const ArrayType *ATy = Context.getAsArrayType(Ty);<br>+      Length = Type / Context.getTypeInfo(ATy->getElementType()).first;<br>+      Type /= Length; // Type is in terms of a single element.<br>  }<br>-    return ND;<br>+    Type /= 8; // Type is in terms of bits, but we want bytes.<br></blockquote><br>Just noticed this; please use Context.getCharWidth() instead.<br></blockquote><br>Or better yet, ASTContext.toCharUnitsFromBits, or just call<br>ASTContext.getTypeSizeInChars to begin with.<br></div></blockquote><div><br></div><div>Committed r178507.  Thank you both for the suggestions.</div><div><br></div><div> Chad</div><br><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">John.</div></blockquote></div><br></body></html>