Updated the PCS calling convention to use the new checkStringLiteralArgument helper function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190710 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index 8530c8b..ceb4a36 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -3869,18 +3869,11 @@
CC_C;
break;
case AttributeList::AT_Pcs: {
- StringLiteral *Str = 0;
- if (attr.isArgExpr(0))
- Str = dyn_cast<StringLiteral>(attr.getArgAsExpr(0));
-
- if (!Str || !Str->isAscii()) {
- Diag(attr.getLoc(), diag::err_attribute_argument_type) << attr.getName()
- << AANT_ArgumentString;
+ StringRef StrRef;
+ if (!checkStringLiteralArgument(*this, StrRef, attr, 0)) {
attr.setInvalid();
return true;
}
-
- StringRef StrRef = Str->getString();
if (StrRef == "aapcs") {
CC = CC_AAPCS;
break;