Page MenuHomePhabricator

Ariel-Burton (Ariel Burton)
User

Projects

User does not belong to any projects.

User Details

User Since
May 27 2022, 3:57 PM (11 w, 4 d)

Recent Activity

Mon, Aug 8

Ariel-Burton updated the diff for D130123: Extend ptr32 support to be applied on typedef.
  • Add case to deal with ElaboratedTypes.
Mon, Aug 8, 3:42 PM · Restricted Project, Restricted Project

Thu, Aug 4

Ariel-Burton added a comment to D130123: Extend ptr32 support to be applied on typedef.

Just to make sure that we're on the same page, you'd like to see a test that confirms that clang is rejecting the template<typename T> void f(T __ptr32 a) example, and possibly one that checks that my example is accepted. Is that correct?

Yep, exactly that. Sorry for the delay, the code looks good.

Thu, Aug 4, 3:49 PM · Restricted Project, Restricted Project
Ariel-Burton updated the diff for D130123: Extend ptr32 support to be applied on typedef.

Recover original changes, and commit with new C++ __ptr32 test.

Thu, Aug 4, 3:47 PM · Restricted Project, Restricted Project
Ariel-Burton updated the diff for D130123: Extend ptr32 support to be applied on typedef.

Added C++ tests for __ptr32.

Thu, Aug 4, 3:42 PM · Restricted Project, Restricted Project

Wed, Aug 3

Ariel-Burton added a comment to D130123: Extend ptr32 support to be applied on typedef.

What is your expectation for your template code fragment? MSVC does not accept it.

Yes, I checked, MSVC rejects it, so clang should have test expectations to confirm that. It seems interesting or surprising, to me at least, that MSVC really only accepts __ptr32 on pointers and typedefs of them.

On the other hand, MSVC does accept this:

template <typename T>
void f(T  a) {
  (*a) += sizeof(a);
}
void g(int *p) {
  f(p);
}
void h(int *__ptr32 p) {
    f(p);
}

Right, this makes sense to me. MSVC's diagnostics say something about the __ptr32 qualifier needing to appear after a *, so this extension must be implemented at a pretty low-level, with some exception for typedefs, just like what you have.

Wed, Aug 3, 7:27 PM · Restricted Project, Restricted Project
Ariel-Burton added a comment to D130123: Extend ptr32 support to be applied on typedef.

That sounds reasonable to me, I confirmed that MSVC really only lets you apply these attributes directly to pointer types and to typedefs.

Can you add a test for the other most common type sugar node, the template parameter? It looks like this:

template <typename T>
void f(T __ptr32 a) {
    (*a) += 1;
}
void g(int *p) {
    f(p);
}

If there isn't already a C++ test for __ptr32 & co, go ahead and make one.

Wed, Aug 3, 9:22 AM · Restricted Project, Restricted Project

Wed, Jul 20

Ariel-Burton added inline comments to D130123: Extend ptr32 support to be applied on typedef.
Wed, Jul 20, 4:49 PM · Restricted Project, Restricted Project

Tue, Jul 19

Ariel-Burton added inline comments to D130123: Extend ptr32 support to be applied on typedef.
Tue, Jul 19, 7:22 PM · Restricted Project, Restricted Project
Ariel-Burton retitled D130123: Extend ptr32 support to be applied on typedef from [Phabricator] extend ptr32 support to be applied on typedef to Extend ptr32 support to be applied on typedef.
Tue, Jul 19, 2:04 PM · Restricted Project, Restricted Project
Ariel-Burton requested review of D130123: Extend ptr32 support to be applied on typedef.
Tue, Jul 19, 1:42 PM · Restricted Project, Restricted Project