This is an archive of the discontinued LLVM Phabricator instance.

Implement MS _ReturnAddress and _AddressOfReturnAddress intrinsics
ClosedPublic

Authored by agutowski on Oct 12 2016, 6:35 PM.

Event Timeline

agutowski updated this revision to Diff 74464.Oct 12 2016, 6:35 PM
agutowski retitled this revision from to Implement MS _ReturnAddress and _AddressOfReturnAddress intrinsics.
agutowski updated this object.
agutowski added reviewers: rnk, hans, thakis, majnemer.
agutowski added a subscriber: cfe-commits.
hans accepted this revision.Oct 13 2016, 12:38 AM
hans edited edge metadata.

lgtm with a comment

test/CodeGen/ms-intrinsics.c
3

Using CHECK-X86 for both 32- and 64-bit might be confusing to the reader. Maybe call it CHECK-INTEL? (Or maybe it's juts me that's confused.)

This revision is now accepted and ready to land.Oct 13 2016, 12:38 AM
majnemer added inline comments.Oct 13 2016, 12:58 AM
lib/CodeGen/CGBuiltin.cpp
1151–1152

I'd just use Builder.getInt32(0), this will DTRT regardless of whatever UnsignedIntTy is.

agutowski updated this revision to Diff 74533.Oct 13 2016, 8:55 AM
agutowski edited edge metadata.

change checking prefix for x86 tests; use Int32 instead of UnsignedIntTy

agutowski closed this revision.Oct 13 2016, 9:12 AM