[PATCH] D79673: Allow 32-bit pointer extensions to be used without -fms-extensions

2020-05-15 Thread David Zarzycki via Phabricator via cfe-commits
davezarzycki abandoned this revision.
davezarzycki added a comment.

I'm going to abandon this change for now. The problem is that the MS extensions 
are not as pervasive through the language as I wanted. For example, I'd really 
like them to work on aggregate types. This would allow all of the pointers to 
said types to not need annotation, unlike the current MS model.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79673/new/

https://reviews.llvm.org/D79673



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79673: Allow 32-bit pointer extensions to be used without -fms-extensions

2020-05-09 Thread David Zarzycki via Phabricator via cfe-commits
davezarzycki created this revision.
davezarzycki added reviewers: akhuang, rnk, rsmith.
davezarzycki added a project: clang.
Herald added a reviewer: aaron.ballman.

One should not need to use `-fms-extensions` in order to use 32-bit pointers on 
64-bit platforms.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79673

Files:
  clang/include/clang/Basic/Attr.td


Index: clang/include/clang/Basic/Attr.td
===
--- clang/include/clang/Basic/Attr.td
+++ clang/include/clang/Basic/Attr.td
@@ -3080,22 +3080,22 @@
 }
 
 def Ptr32 : TypeAttr {
-  let Spellings = [Keyword<"__ptr32">];
+  let Spellings = [Keyword<"__ptr32">, Clang<"ptr32">];
   let Documentation = [Ptr32Docs];
 }
 
 def Ptr64 : TypeAttr {
-  let Spellings = [Keyword<"__ptr64">];
+  let Spellings = [Keyword<"__ptr64">, Clang<"ptr64">];
   let Documentation = [Ptr64Docs];
 }
 
 def SPtr : TypeAttr {
-  let Spellings = [Keyword<"__sptr">];
+  let Spellings = [Keyword<"__sptr">, Clang<"sptr">];
   let Documentation = [SPtrDocs];
 }
 
 def UPtr : TypeAttr {
-  let Spellings = [Keyword<"__uptr">];
+  let Spellings = [Keyword<"__uptr">, Clang<"uptr">];
   let Documentation = [UPtrDocs];
 }
 


Index: clang/include/clang/Basic/Attr.td
===
--- clang/include/clang/Basic/Attr.td
+++ clang/include/clang/Basic/Attr.td
@@ -3080,22 +3080,22 @@
 }
 
 def Ptr32 : TypeAttr {
-  let Spellings = [Keyword<"__ptr32">];
+  let Spellings = [Keyword<"__ptr32">, Clang<"ptr32">];
   let Documentation = [Ptr32Docs];
 }
 
 def Ptr64 : TypeAttr {
-  let Spellings = [Keyword<"__ptr64">];
+  let Spellings = [Keyword<"__ptr64">, Clang<"ptr64">];
   let Documentation = [Ptr64Docs];
 }
 
 def SPtr : TypeAttr {
-  let Spellings = [Keyword<"__sptr">];
+  let Spellings = [Keyword<"__sptr">, Clang<"sptr">];
   let Documentation = [SPtrDocs];
 }
 
 def UPtr : TypeAttr {
-  let Spellings = [Keyword<"__uptr">];
+  let Spellings = [Keyword<"__uptr">, Clang<"uptr">];
   let Documentation = [UPtrDocs];
 }
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79673: Allow 32-bit pointer extensions to be used without -fms-extensions

2020-05-09 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added a comment.

Needs a test.

I believe these are only implemented for x86 in LLVM. What happens if you try 
to use this on non-x86? I wouldn't be surprised if we crash, but we should 
probably produce a proper error and test it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79673/new/

https://reviews.llvm.org/D79673



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D79673: Allow 32-bit pointer extensions to be used without -fms-extensions

2020-05-09 Thread David Zarzycki via Phabricator via cfe-commits
davezarzycki added a comment.

In D79673#2028204 , @rnk wrote:

> Needs a test.
>
> I believe these are only implemented for x86 in LLVM. What happens if you try 
> to use this on non-x86? I wouldn't be surprised if we crash, but we should 
> probably produce a proper error and test it.


I just tested top-of-tree `clang -fms-extensions -target arm64-unknown-linux` 
(sans this patch) and apparently the attributes are ignored, which could cause 
crashes at run time if a later compiler actually honors this attributes on 
non-x86 targets and people try to mix object files created by older and newer 
compilers.

I agree that the bugs you point out are worth fixing. That being said, I'm not 
looking to fix all of the bugs with these attributes with this patch. If it's 
okay, I'd like to focus on exposing the feature outside of `-fms-extensions`. 
If people want to ignore the Microsoft extension and design how this feature 
"should" work, that's fine too.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79673/new/

https://reviews.llvm.org/D79673



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits