This is an archive of the discontinued LLVM Phabricator instance.

Prevent errors of omission when adding backend names.
ClosedPublic

Authored by dougk on May 1 2015, 12:46 PM.

Details

Summary

Add test that getArchTypeForLLVMName() returns something other than Unknown for all but 1 special case.

Diff Detail

Event Timeline

dougk updated this revision to Diff 24825.May 1 2015, 12:46 PM
dougk retitled this revision from to Prevent errors of omission when adding backend names..
dougk updated this object.
dougk edited the test plan for this revision. (Show Details)
dougk added reviewers: rnk, chandlerc.
dougk added a subscriber: Unknown Object (MLST).
dougk added a comment.May 1 2015, 12:56 PM

For context, this test would have prevented the bug that I fixed in http://reviews.llvm.org/D9436 ("Add 'sparcel' in one more place")

chandlerc edited edge metadata.May 1 2015, 7:18 PM

Please use the LLVM naming conventions for variables. Please use a range based for loop. I would prefer EXPECT_NE here rather than ASSERT_NE.

dougk added a comment.May 4 2015, 1:46 PM

To use a range-based for loop requires an artificial object as the head of the registry because begin() and end() are static methods.
Something like this:

llvm::TargetRegistry RegistryRoot;
for (const auto& Target : RegistryRoot ) {

Do you prefer that and/or should I change the other (6 ish) places where the explicit loop appears?

dougk updated this revision to Diff 24916.May 4 2015, 2:24 PM
dougk edited edge metadata.

changes per review, and moved new file to Support instead of MC

chandlerc accepted this revision.May 8 2015, 8:17 AM
chandlerc edited edge metadata.

LGTM

This revision is now accepted and ready to land.May 8 2015, 8:17 AM
This revision was automatically updated to reflect the committed changes.