[PATCH] D49414: Add target triple normalization to the C API

whitequark via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 17 04:02:42 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL337263: [LLVM-C] Add target triple normalization to the C API. (authored by whitequark, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D49414?vs=155840&id=155843#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D49414

Files:
  llvm/trunk/include/llvm-c/TargetMachine.h
  llvm/trunk/lib/Target/TargetMachineC.cpp


Index: llvm/trunk/lib/Target/TargetMachineC.cpp
===================================================================
--- llvm/trunk/lib/Target/TargetMachineC.cpp
+++ llvm/trunk/lib/Target/TargetMachineC.cpp
@@ -238,6 +238,10 @@
   return strdup(sys::getDefaultTargetTriple().c_str());
 }
 
+char *LLVMNormalizeTargetTriple(const char* triple) {
+  return strdup(Triple::normalize(StringRef(triple)).c_str());
+}
+
 char *LLVMGetHostCPUName(void) {
   return strdup(sys::getHostCPUName().data());
 }
Index: llvm/trunk/include/llvm-c/TargetMachine.h
===================================================================
--- llvm/trunk/include/llvm-c/TargetMachine.h
+++ llvm/trunk/include/llvm-c/TargetMachine.h
@@ -137,6 +137,10 @@
   disposed with LLVMDisposeMessage. */
 char* LLVMGetDefaultTargetTriple(void);
 
+/** Normalize a target triple. The result needs to be disposed with
+  LLVMDisposeMessage. */
+char* LLVMNormalizeTargetTriple(const char* triple);
+
 /** Get the host CPU as a string. The result needs to be disposed with
   LLVMDisposeMessage. */
 char* LLVMGetHostCPUName(void);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49414.155843.patch
Type: text/x-patch
Size: 1093 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180717/6560d879/attachment.bin>


More information about the llvm-commits mailing list