diff options
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Sema/SemaStmtAsm.cpp | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/clang/lib/Sema/SemaStmtAsm.cpp b/clang/lib/Sema/SemaStmtAsm.cpp index a6008056590..c182b35bfad 100644 --- a/clang/lib/Sema/SemaStmtAsm.cpp +++ b/clang/lib/Sema/SemaStmtAsm.cpp @@ -645,8 +645,8 @@ ExprResult Sema::LookupInlineAsmIdentifier(CXXScopeSpec &SS, // Referring to parameters is not allowed in naked functions. if (CheckNakedParmReference(Result.get(), *this)) return ExprError(); - Expr *Res = Result.get(); - QualType T = Res->getType(); + + QualType T = Result.get()->getType(); if (T->isDependentType()) { return Result; @@ -658,26 +658,16 @@ ExprResult Sema::LookupInlineAsmIdentifier(CXXScopeSpec &SS, } // Otherwise, it needs to be a complete type. - if (RequireCompleteExprType(Res, diag::err_asm_incomplete_type)) { + if (RequireCompleteExprType(Result.get(), diag::err_asm_incomplete_type)) { return ExprError(); } fillInlineAsmTypeInfo(Context, T, Info); // We can work with the expression as long as it's not an r-value. - if (!Res->isRValue()) { - Info.setKindVariable(); - return Result; - } + if (!Result.get()->isRValue()) + Info.IsVarDecl = true; - Expr::EvalResult EvlResult; - // Try to evaluate the identifier as enum constant, currently we do not allow - // other constant integers to be folded. - if (isa<clang::EnumType>(T) && - Res->EvaluateAsRValue(EvlResult, getASTContext())) { - Info.ConstIntValue = EvlResult.Val.getInt(); - Info.setKindConstEnum(); - } return Result; } @@ -784,7 +774,7 @@ Sema::LookupInlineAsmVarDeclField(Expr *E, StringRef Member, fillInlineAsmTypeInfo(Context, Result.get()->getType(), Info); // Fields are "variables" as far as inline assembly is concerned. - Info.setKindVariable(); + Info.IsVarDecl = true; return Result; } |

