This is an archive of the discontinued LLVM Phabricator instance.

Change representation of member function pointers for MIPS targets
ClosedPublic

Authored by zoran.jovanovic on Jan 23 2015, 7:46 AM.

Details

Summary

Member function pointer is represented with 2 words: <ptr, adj>
Currently, last significant bit of 'ptr' is used for marking virtual functions.
This can not be used for microMIPS and mips16 because odd addresses are valid for these platforms.
Patch introduces new TargetCXXABI - GenericMips. Only difference compered to GenericItanium (used for MIPS until now) is that it sets UseARMMethodPtrABI to true.
In order to be able to link with code for other MIPS targets and with code generated with gcc this should be used for all MIPS targets.

Diff Detail

Event Timeline

zoran.jovanovic retitled this revision from to Change representation of member function pointers for MIPS targets.
zoran.jovanovic updated this object.
zoran.jovanovic edited the test plan for this revision. (Show Details)
zoran.jovanovic added a reviewer: dsanders.
zoran.jovanovic added a subscriber: Unknown Object (MLST).
dsanders accepted this revision.Feb 13 2015, 7:24 AM
dsanders edited edge metadata.
dsanders added a subscriber: atanasyan.

I'm not particularly knowledgeable about C++ ABI's but I have compared the gcc and clang output and I agree that this change makes the representation the same as gcc's. I tested MIPS32r2 and microMIPS. On that basis, LGTM apart from TargetCXXABI::tryParse() as noted below.

lib/Basic/TargetInfo.cpp
658

Shouldn't "arm" be "mips" here?

This revision is now accepted and ready to land.Feb 13 2015, 7:24 AM
atanasyan accepted this revision.Feb 13 2015, 7:51 AM
atanasyan added a reviewer: atanasyan.

LGTM

This revision was automatically updated to reflect the committed changes.