This is an archive of the discontinued LLVM Phabricator instance.

Simplify ARMTargetParser::getArchSynonym
ClosedPublic

Authored by tyomitch on Jun 4 2015, 11:20 AM.

Details

Summary
  1. The only caller, ARMTargetParser::parseArch, uses the results for an "endswith" test; so, including the "arm" prefix into the result is unnecessary.
  2. Most ARMTargetParser::parseArch callers pass it the output from ARMTargetParser::getCanonicalArchName; so, make this behaviour the default. Then, including the "arm" prefix into the cases is unnecessary.

Diff Detail

Repository
rL LLVM

Event Timeline

tyomitch updated this revision to Diff 27133.Jun 4 2015, 11:20 AM
tyomitch retitled this revision from to Simplify ARMTargetParser::getArchSynonym.
tyomitch updated this object.
tyomitch edited the test plan for this revision. (Show Details)
tyomitch added a reviewer: rengolin.
tyomitch set the repository for this revision to rL LLVM.
tyomitch added a subscriber: Unknown Object (MLST).
rengolin edited edge metadata.Jun 4 2015, 1:57 PM

There are also lots of places that are calling parseArch(getCanonical()), can you simplify them as well?

Some of them are in Clang...

lib/Support/TargetParser.cpp
371 ↗(On Diff #27133)

The reason why I didn't do this initially is because I was calling parseArch() inside getCanonicalArchName(). Now this is safe, thanks for fixing this.

This revision was automatically updated to reflect the committed changes.