aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-03-15 23:12:51 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-03-15 23:12:51 +0000
commita43ef3e0511dc48d98d61598163c9deddc09cb9c (patch)
tree106281859900054aaedc772d960893e83cedc643 /lib
parent64f678eab13b5de9dcebf13d973fbc4731eb1bfd (diff)
When a variable has a specified asm name, but isn't using the register storage class, the asm name doesn't specify a register. PR12244.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152873 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/CGStmt.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp
index b2da32bb52..e65c5f468f 100644
--- a/lib/CodeGen/CGStmt.cpp
+++ b/lib/CodeGen/CGStmt.cpp
@@ -1295,6 +1295,8 @@ AddVariableConstraints(const std::string &Constraint, const Expr &AsmExpr,
const VarDecl *Variable = dyn_cast<VarDecl>(&Value);
if (!Variable)
return Constraint;
+ if (Variable->getStorageClass() != SC_Register)
+ return Constraint;
AsmLabelAttr *Attr = Variable->getAttr<AsmLabelAttr>();
if (!Attr)
return Constraint;