This is an archive of the discontinued LLVM Phabricator instance.

DarwinAsmParser: Warn on multiple/mismatching version_min directives
AbandonedPublic

Authored by MatzeB on Jul 24 2015, 12:58 PM.

Details

Summary
  • Add proxy function for MCAsmParser::Note() to MCAsmParserExtension
  • Warn on multiple version_min directives
  • Warn if .xxx_min_version does not match target triple

Diff Detail

Repository
rL LLVM

Event Timeline

MatzeB updated this revision to Diff 30594.Jul 24 2015, 12:58 PM
MatzeB retitled this revision from to DarwinAsmParser: Warn on multiple/mismatching version_min directives.
MatzeB updated this object.
MatzeB added reviewers: rafael, grosbach, steven_wu.
MatzeB set the repository for this revision to rL LLVM.
MatzeB added a subscriber: llvm-commits.
steven_wu edited edge metadata.Jul 24 2015, 1:27 PM

I am not sure if we should warn for UnknownOS. I guess there can be argument both way but we should at least have a test case for it. I am also not sure if you can run i386 asm parser when x86 backend is not built.

I am not sure if we should warn for UnknownOS. I guess there can be argument both way but we should at least have a test case for it. I am also not sure if you can run i386 asm parser when x86 backend is not built.

The "Triple::OSType ExpectedOS = Triple::UnknownOS;" initialization is only there to avoid uninitialized variable warnings, in practice you will always hit one of the switch cases below it.

I am also not sure if you can run i386 asm parser when x86 backend is not built.

I think you are right here. I was looking at the version-min-diagnostics.s test which made the same error when I wrote this. For this test I can switch to the nonexisting thumbv7-apple-macosx.

I am not sure if we should warn for UnknownOS. I guess there can be argument both way but we should at least have a test case for it. I am also not sure if you can run i386 asm parser when x86 backend is not built.

The "Triple::OSType ExpectedOS = Triple::UnknownOS;" initialization is only there to avoid uninitialized variable warnings, in practice you will always hit one of the switch cases below it.

I was actually referring to what if T.getOS() is UnknownOS. With some more thought, I realize version_min directive will not even parse with -triple armv7-apple. The only case might be interesting is what about armv7-apple-darwin?

MatzeB abandoned this revision.Nov 25 2015, 2:36 PM

In the meantime this functionality landed in llvm in r251569.