This is an archive of the discontinued LLVM Phabricator instance.

[zorg] ClangAndLLDBuilder.py - Adding a missing cast and adding some asserts
ClosedPublic

Authored by sqlbyme on Feb 21 2016, 5:09 PM.

Details

Reviewers
gkistanova
Summary

Ensuring the final string constructed for assignment to the lit_args variable is cast as a list item as it need to be in order to append it to the cmake_command variable. Also, adding some asserts to ensure we protect against incorrect types in the future.

Diff Detail

Event Timeline

sqlbyme updated this revision to Diff 48644.Feb 21 2016, 5:09 PM
sqlbyme retitled this revision from to [zorg] ClangAndLLDBuilder.py - Adding a missing cast and adding some asserts.
sqlbyme updated this object.
sqlbyme added a reviewer: gkistanova.
sqlbyme added a project: Restricted Project.

Galina,
I may have gone a bit overboard with the asserts, happy to hear your (or any other) opinion on the matter.

Thanks,
Mike

sqlbyme updated this revision to Diff 48647.Feb 21 2016, 9:36 PM

After review from silvas, used the asserts in a better manner. Also removed unneeded parenthesis from the lit_args join expression.

gkistanova edited edge metadata.Feb 22 2016, 5:05 PM

I think, the only assert you really need here is the one for '-DLLVM_LIT_ARGS=', as it could be confusing and hard to detect. Wrong data type will fail cleanly with reasonable Python error and, up to me, does not worth a special handling. Please see more detailed explanations in D17493.

Thanks

Galina

sqlbyme updated this revision to Diff 48766.Feb 22 2016, 6:52 PM
sqlbyme edited edge metadata.

Removed unnecessary assertions.

gkistanova accepted this revision.Feb 22 2016, 8:21 PM
gkistanova edited edge metadata.

LGTM.
Committed r261610

This revision is now accepted and ready to land.Feb 22 2016, 8:21 PM
sqlbyme closed this revision.Feb 25 2016, 10:35 AM