summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2013-04-01 17:58:03 +0000
committerChad Rosier <mcrosier@apple.com>2013-04-01 17:58:03 +0000
commit10230d4d6edc19d6cbe85e34cb4c26350deac79e (patch)
tree4c0b26bdba580b448c25b9179ecf9c902570865b /clang/lib/Sema
parentf6d45f237977a35291c280826e968e03c9530a30 (diff)
downloadbcm5719-llvm-10230d4d6edc19d6cbe85e34cb4c26350deac79e.tar.gz
bcm5719-llvm-10230d4d6edc19d6cbe85e34cb4c26350deac79e.zip
Cleanup. No functional change intended.
llvm-svn: 178481
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaStmtAsm.cpp35
1 files changed, 17 insertions, 18 deletions
diff --git a/clang/lib/Sema/SemaStmtAsm.cpp b/clang/lib/Sema/SemaStmtAsm.cpp
index 4ca8d69bf6a..6b13f71c3ae 100644
--- a/clang/lib/Sema/SemaStmtAsm.cpp
+++ b/clang/lib/Sema/SemaStmtAsm.cpp
@@ -515,21 +515,21 @@ NamedDecl *Sema::LookupInlineAsmIdentifier(StringRef Name, SourceLocation Loc,
return 0;
}
- NamedDecl *ND = Result.getFoundDecl();
- if (isa<VarDecl>(ND) || isa<FunctionDecl>(ND)) {
- if (VarDecl *Var = dyn_cast<VarDecl>(ND)) {
- Type = Context.getTypeInfo(Var->getType()).first;
- QualType Ty = Var->getType();
- 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 /= 8; // Type is in terms of bits, but we want bytes.
- Size = Length * Type;
- IsVarDecl = true;
+ NamedDecl *FoundDecl = Result.getFoundDecl();
+ if (isa<FunctionDecl>(FoundDecl))
+ return FoundDecl;
+ if (VarDecl *Var = dyn_cast<VarDecl>(FoundDecl)) {
+ Type = Context.getTypeInfo(Var->getType()).first;
+ QualType Ty = Var->getType();
+ 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.
}
- return ND;
+ Type /= 8; // Type is in terms of bits, but we want bytes.
+ Size = Length * Type;
+ IsVarDecl = true;
+ return FoundDecl;
}
// FIXME: Handle other kinds of results? (FieldDecl, etc.)
@@ -549,13 +549,12 @@ bool Sema::LookupInlineAsmField(StringRef Base, StringRef Member,
if (!BaseResult.isSingleResult())
return true;
- NamedDecl *FoundDecl = BaseResult.getFoundDecl();
const RecordType *RT = 0;
- if (VarDecl *VD = dyn_cast<VarDecl>(FoundDecl)) {
+ NamedDecl *FoundDecl = BaseResult.getFoundDecl();
+ if (VarDecl *VD = dyn_cast<VarDecl>(FoundDecl))
RT = VD->getType()->getAs<RecordType>();
- } else if (TypedefDecl *TD = dyn_cast<TypedefDecl>(FoundDecl)) {
+ else if (TypedefDecl *TD = dyn_cast<TypedefDecl>(FoundDecl))
RT = TD->getUnderlyingType()->getAs<RecordType>();
- }
if (!RT)
return true;
OpenPOWER on IntegriCloud