]> granicus.if.org Git - clang/commitdiff
Fix typo and add comment.
authorRafael Espindola <rafael.espindola@gmail.com>
Sat, 1 Jan 2011 21:12:33 +0000 (21:12 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Sat, 1 Jan 2011 21:12:33 +0000 (21:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122669 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGStmt.cpp

index 1fcafe82e637c3f2a07ad4089c0d1993f07c4019..a46a41262709ed4b4cd00c71da625d572fdee9b8 100644 (file)
@@ -919,10 +919,13 @@ SimplifyConstraint(const char *Constraint, const TargetInfo &Target,
   return Result;
 }
 
+/// AddVariableConstraints - Look at AsmExpr and if it is a variable declared
+/// as using a particular register add that as a constraint that will be used
+/// in this asm stmt.
 static std::string
-AddVariableConstraits(const std::string &Constraint, const Expr &AsmExpr,
-                      const TargetInfo &Target, CodeGenModule &CGM,
-                      const AsmStmt &Stmt) {
+AddVariableConstraints(const std::string &Constraint, const Expr &AsmExpr,
+                       const TargetInfo &Target, CodeGenModule &CGM,
+                       const AsmStmt &Stmt) {
   const DeclRefExpr *AsmDeclRef = dyn_cast<DeclRefExpr>(&AsmExpr);
   if (!AsmDeclRef)
     return Constraint;
@@ -1082,7 +1085,7 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) {
     const Expr *OutExpr = S.getOutputExpr(i);
     OutExpr = OutExpr->IgnoreParenNoopCasts(getContext());
 
-    OutputConstraint = AddVariableConstraits(OutputConstraint, *OutExpr, Target,
+    OutputConstraint = AddVariableConstraints(OutputConstraint, *OutExpr, Target,
                                              CGM, S);
 
     LValue Dest = EmitLValue(OutExpr);
@@ -1163,7 +1166,7 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) {
                                          &OutputConstraintInfos);
 
     InputConstraint =
-      AddVariableConstraits(InputConstraint,
+      AddVariableConstraints(InputConstraint,
                             *InputExpr->IgnoreParenNoopCasts(getContext()),
                             Target, CGM, S);