This is an archive of the discontinued LLVM Phabricator instance.

Add target triple normalization to the C API
ClosedPublic

Authored by mhlindstr on Jul 17 2018, 12:01 AM.

Details

Summary

rL333307 was introduced to remove automatic target triple normalization when calling sys::getDefaultTargetTriple(), arguing that users of the latter already called Triple::normalize() if necessary. However, users of the C API currently have no way of doing target triple normalization. This patch introduces an LLVMNormalizeTargetTriple function to the C API which wraps Triple::normalize() and can be used on the result of LLVMGetDefaultTargetTriple to achieve the same effect.

Diff Detail

Repository
rL LLVM

Event Timeline

mhlindstr created this revision.Jul 17 2018, 12:01 AM
Chirag added a subscriber: Chirag.Jul 17 2018, 12:44 AM
whitequark requested changes to this revision.Jul 17 2018, 3:02 AM
whitequark added inline comments.
include/llvm-c/TargetMachine.h
142 ↗(On Diff #155814)

This should take a const char *.

This revision now requires changes to proceed.Jul 17 2018, 3:02 AM
mhlindstr updated this revision to Diff 155840.Jul 17 2018, 3:57 AM

Fixed the patch so that the LLVMNormalizeTargetTriple takes a const char* argument. Sorry about that.

whitequark accepted this revision.Jul 17 2018, 3:59 AM

LGTM, thanks!

This revision is now accepted and ready to land.Jul 17 2018, 3:59 AM

I do not have write access to the repository, can someone else land this?

Thanks again!

This revision was automatically updated to reflect the committed changes.