This is an archive of the discontinued LLVM Phabricator instance.

ARM: update subtarget information for Windows on ARM
ClosedPublic

Authored by abdulras on Mar 31 2014, 11:19 AM.

Details

Summary

Update the subtarget information for Windows on ARM. This enables using the MC
layer to target Windows on ARM.

Diff Detail

Event Timeline

rafael added inline comments.Mar 31 2014, 12:44 PM
lib/IR/DataLayout.cpp
157–158

I think this can now be just

if (T.isOSBinFormatELF() || (T.isOSWindows() && T.getArch() != Triple::x86))
abdulras updated this revision to Unknown Object (????).Mar 31 2014, 4:59 PM

Add a couple of sanity checking tests (ideas for additional tests still welcome!). Fix a stupid mistake that snuck in during rebasing.

rafael added inline comments.Mar 31 2014, 5:30 PM
lib/IR/DataLayout.cpp
157–158

I think this can be just

if (T.isOSBinFormatELF() || (T.isOSWindows() && T.getArch() != Triple::x86))

rnk added inline comments.Mar 31 2014, 5:50 PM
lib/IR/DataLayout.cpp
157–158

We should probably flip this around to be:

if (T.isOSBinFormatCOFF() && T.isOSWindows() && T.getArch() == Triple::X86)
  return "-m:w";
return "-m:e";

The Windows manglings are specific to x86 anyway. They didn't keep them for x86_64 or arm.

lib/Target/ARM/ARMSubtarget.cpp
218

*blink* OK, I guess WinRT is always in Thumb mode.

lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp
235–236

I imagine we will come here for i686-pc-win32-macho, which might be a target that Apple cares about.

abdulras added inline comments.Mar 31 2014, 10:46 PM
lib/IR/DataLayout.cpp
157–158

I like rnk's suggestion better, Ill change it to that.

lib/Target/ARM/ARMSubtarget.cpp
218

Yes, AFAICT, WoA is all thumb mode (but, retains the problem of ensuring that code is marked correctly when generated).

lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp
235–236

This is the ARM target definition, so you must mean armv7-windows-macho. Is there a loader for that?

abdulras updated this revision to Unknown Object (????).Apr 1 2014, 8:47 AM

Address rafael and rnk's comments.

rnk accepted this revision.Apr 1 2014, 10:35 AM

lgtm

abdulras closed this revision.Apr 3 2014, 9:18 AM