diff options
| author | Eric Christopher <echristo@gmail.com> | 2017-07-25 19:17:32 +0000 |
|---|---|---|
| committer | Eric Christopher <echristo@gmail.com> | 2017-07-25 19:17:32 +0000 |
| commit | cf94152f274c65a583dfc5cf1787fbbef752e004 (patch) | |
| tree | 5e1c9f2e8add9d8faad15d2016e68774fa9e0aeb /clang/lib/Sema | |
| parent | 578363ac08da813a59cd19f3d41bd8e5af019d84 (diff) | |
| download | bcm5719-llvm-cf94152f274c65a583dfc5cf1787fbbef752e004.tar.gz bcm5719-llvm-cf94152f274c65a583dfc5cf1787fbbef752e004.zip | |
Revert "This patch enables the usage of constant Enum identifiers within Microsoft style inline assembly statements." as it is causing msan failures.
This reverts commits r308985 and r308965
llvm-svn: 309004
Diffstat (limited to 'clang/lib/Sema')
| -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; } |

