summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclAttr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaDeclAttr.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index a254caeff75..e1fead3d4c2 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -3730,14 +3730,17 @@ static void handleModeAttr(Sema &S, Decl *D, const AttributeList &Attr) {
NewTy = S.Context.LongDoubleTy;
break;
case 128:
- if (!IntegerMode) {
+ if (!IntegerMode && S.Context.getTargetInfo().getLongDoubleWidth() != 128) {
S.Diag(Attr.getLoc(), diag::err_unsupported_machine_mode) << Name;
return;
}
- if (OldTy->isSignedIntegerType())
- NewTy = S.Context.Int128Ty;
- else
- NewTy = S.Context.UnsignedInt128Ty;
+ if (IntegerMode) {
+ if (OldTy->isSignedIntegerType())
+ NewTy = S.Context.Int128Ty;
+ else
+ NewTy = S.Context.UnsignedInt128Ty;
+ } else
+ NewTy = S.Context.LongDoubleTy;
break;
}
OpenPOWER on IntegriCloud