summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorMichael Zuckerman <Michael.zuckerman@intel.com>2015-12-15 14:04:18 +0000
committerMichael Zuckerman <Michael.zuckerman@intel.com>2015-12-15 14:04:18 +0000
commit229158c491ecf257890eac9df5d17fb835c816db (patch)
tree85aa5d8e9be46967cce2d7df455b461a9a07546e /clang/lib/CodeGen
parent5acf66ff97843df85a697b38b091cdcc8decbd0a (diff)
downloadbcm5719-llvm-229158c491ecf257890eac9df5d17fb835c816db.tar.gz
bcm5719-llvm-229158c491ecf257890eac9df5d17fb835c816db.zip
[Microsoft][C++] Clang doesn't support a use of "this" pointer inside inline asm
Clang doesn’t support a use of “this” pointer inside inline asm. When I tried to compile a class or a struct (see example) with an inline asm that contains "this" pointer. Clang returns with an error. This patch fixes that. error: expected unqualified-id For example: ''' struct A { void f() { __asm mov eax, this // error: expected unqualified-id } }; ''' Differential Revision: http://reviews.llvm.org/D15115 llvm-svn: 255645
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGStmt.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp
index e125b805b25..cc4fa2ec597 100644
--- a/clang/lib/CodeGen/CGStmt.cpp
+++ b/clang/lib/CodeGen/CGStmt.cpp
@@ -1696,7 +1696,8 @@ llvm::Value* CodeGenFunction::EmitAsmInput(
if (Info.allowsRegister() || !Info.allowsMemory())
if (CodeGenFunction::hasScalarEvaluationKind(InputExpr->getType()))
return EmitScalarExpr(InputExpr);
-
+ if (InputExpr->getStmtClass() == Expr::CXXThisExprClass)
+ return EmitScalarExpr(InputExpr);
InputExpr = InputExpr->IgnoreParenNoopCasts(getContext());
LValue Dest = EmitLValue(InputExpr);
return EmitAsmInputLValue(Info, Dest, InputExpr->getType(), ConstraintStr,
OpenPOWER on IntegriCloud