This is an archive of the discontinued LLVM Phabricator instance.

Fix attribute((mode([word|unwind_word]))) for x32
ClosedPublic

Authored by hjl.tools on Feb 1 2016, 10:28 AM.

Details

Summary
typedef unsigned int gcc_word __attribute__((mode(word)));

and

typedef unsigned int gcc_unwind_word __attribute__((mode(unwind_word)));

define the largest unsigned integer types which can be stored in a
general purpose register, which may not be the pointer type. For x32,
they aren't pointer nor unsigned long. We should

  1. Make getUnwindWordWidth and getRegisterWidth virtual,
  2. Override them for x32, similar to hasInt128Type.
  3. Use getRegisterWidth for attribute((mode(word)));

This fixes PR 24706.

Diff Detail

Repository
rL LLVM

Event Timeline

hjl.tools updated this revision to Diff 46558.Feb 1 2016, 10:28 AM
hjl.tools retitled this revision from to Fix attribute((mode([word|unwind_word]))) for x32 .
hjl.tools updated this object.
hjl.tools added reviewers: rnk, rafael.
hjl.tools added a subscriber: cfe-commits.
rnk accepted this revision.Feb 1 2016, 10:36 AM
rnk edited edge metadata.

lgtm

Should I land this for you?

This revision is now accepted and ready to land.Feb 1 2016, 10:36 AM

Yes, please. Thanks.

This revision was automatically updated to reflect the committed changes.