This is an archive of the discontinued LLVM Phabricator instance.

Add Windows ARM targets for mingw and cygwin to clang
ClosedPublic

Authored by martell on Jul 9 2015, 11:06 AM.

Details

Summary

Add support for armv7-windows-gnu targets to the clang front end.

Relative LLVM review

http://reviews.llvm.org/D11075

Windows only supports Little endian so it made more sense to have the naming reflect this.
It was confusing looking through the source to see that darwin arm targets did not specify endianess because they only support one yet we were specifying for itanium arm on windows.
I fixed that in the patch also

Diff Detail

Event Timeline

martell updated this revision to Diff 29359.Jul 9 2015, 11:06 AM
martell retitled this revision from to Add Windows ARM targets for mingw and cygwin to clang.
martell updated this object.
martell added reviewers: yaron.keren, rnk.
martell updated this object.Jul 9 2015, 11:25 AM
martell updated this object.Jul 9 2015, 11:28 AM
martell updated this object.Jul 9 2015, 11:46 AM
martell updated this revision to Diff 29388.Jul 9 2015, 2:00 PM

Updated with full file context as requested by Yaron

martell updated this revision to Diff 29407.Jul 9 2015, 3:55 PM

Tidied up the patch to make it more readable

rnk accepted this revision.Jul 10 2015, 9:51 AM
rnk edited edge metadata.

lgtm

This revision is now accepted and ready to land.Jul 10 2015, 9:51 AM
yaron.keren requested changes to this revision.Jul 13 2015, 11:15 PM
yaron.keren edited edge metadata.

This does not compile against SVN. Please update and run tests.

C:\llvm-clean\tools\clang\lib\Basic\Targets.cpp(4961): error C2011: '`anonymous-namespace'::MinGWARMTargetInfo' : 'class'

type redefinition [C:\llvm-clean\msvc\tools\clang\lib\Basic\clangBasic.vcxproj]

C:\llvm-clean\tools\clang\lib\Basic\Targets.cpp(4979): error C2011: '`anonymous-namespace'::CygwinARMTargetInfo' : 'class'  type redefinition [C:\llvm-clean\msvc\tools\clang\lib\Basic\clangBasic.vcxproj]
C:\llvm-clean\tools\clang\lib\Basic\Targets.cpp(7121): error C2027: use of undefined type '`anonymous-namespace'::CygwinAR MTargetInfo' [C:\llvm-clean\msvc\tools\clang\lib\Basic\clangBasic.vcxproj]
C:\llvm-clean\tools\clang\lib\Basic\Targets.cpp(7123): error C2027: use of undefined type '`anonymous-namespace'::MinGWARM TargetInfo' [C:\llvm-clean\msvc\tools\clang\lib\Basic\clangBasic.vcxproj]
This revision now requires changes to proceed.Jul 13 2015, 11:15 PM

Also, please base the diff from top-level llvm directory not from clang subdir, so that the diff starts with:

Index: tools/clang/lib/Basic/Targets.cpp

  • tools/clang/lib/Basic/Targets.cpp

+++ tools/clang/lib/Basic/Targets.cpp

martell updated this revision to Diff 29684.Jul 14 2015, 10:53 AM
martell edited edge metadata.

compnerd requested that we leave the le postfix for itanium targets
added back in the blank namespace guard to fix compile errors

Yaron I previously had namespace guards around the 2 targets.
Removing these in the latest patch caused the compile failure
It seems all mingw targets have a separate guard like this.

If someone could explain why this is needed it would be great :)

martell updated this revision to Diff 29687.Jul 14 2015, 10:56 AM
martell edited edge metadata.

2nd attempt to set it to tools/clang/

yaron.keren accepted this revision.Jul 15 2015, 6:48 AM
yaron.keren edited edge metadata.

I merged the anonymous namespaces to the existing one, r242292.

This revision is now accepted and ready to land.Jul 15 2015, 6:48 AM
yaron.keren closed this revision.Jul 15 2015, 6:48 AM