[PATCH] D17283: Deprecate LLVMGetDataLayout and replace it by LLVMGetDataLayoutStr

Amaury SECHET via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 15 16:28:21 PST 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL260920: Deprecate LLVMGetDataLayout and replace it by LLVMGetDataLayoutStr (authored by deadalnix).

Changed prior to commit:
  http://reviews.llvm.org/D17283?vs=48029&id=48037#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D17283

Files:
  llvm/trunk/docs/ReleaseNotes.rst
  llvm/trunk/include/llvm-c/Core.h
  llvm/trunk/lib/IR/Core.cpp

Index: llvm/trunk/docs/ReleaseNotes.rst
===================================================================
--- llvm/trunk/docs/ReleaseNotes.rst
+++ llvm/trunk/docs/ReleaseNotes.rst
@@ -44,6 +44,9 @@
 
 * The C API function LLVMAddTargetData has been removed.
 
+* The C API function LLVMGetDataLayout is deprecated
+  in favor of LLVMGetDataLayoutStr.
+
 .. NOTE
    For small 1-3 sentence descriptions, just add an entry at the end of
    this list. If your description won't fit comfortably in one bullet
Index: llvm/trunk/include/llvm-c/Core.h
===================================================================
--- llvm/trunk/include/llvm-c/Core.h
+++ llvm/trunk/include/llvm-c/Core.h
@@ -481,8 +481,13 @@
 /**
  * Obtain the data layout for a module.
  *
- * @see Module::getDataLayout()
+ * @see Module::getDataLayoutStr()
+ *
+ * LLVMGetDataLayout is DEPRECATED, as the name is not only incorrect,
+ * but match the name of another method on the module. Prefer the use
+ * of LLVMGetDataLayoutStr, which is not ambiguous.
  */
+const char *LLVMGetDataLayoutStr(LLVMModuleRef M);
 const char *LLVMGetDataLayout(LLVMModuleRef M);
 
 /**
Index: llvm/trunk/lib/IR/Core.cpp
===================================================================
--- llvm/trunk/lib/IR/Core.cpp
+++ llvm/trunk/lib/IR/Core.cpp
@@ -160,10 +160,14 @@
 }
 
 /*--.. Data layout .........................................................--*/
-const char * LLVMGetDataLayout(LLVMModuleRef M) {
+const char *LLVMGetDataLayoutStr(LLVMModuleRef M) {
   return unwrap(M)->getDataLayoutStr().c_str();
 }
 
+const char *LLVMGetDataLayout(LLVMModuleRef M) {
+  return LLVMGetDataLayoutStr(M);
+}
+
 void LLVMSetDataLayout(LLVMModuleRef M, const char *DataLayoutStr) {
   unwrap(M)->setDataLayout(DataLayoutStr);
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17283.48037.patch
Type: text/x-patch
Size: 1781 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160216/d58fc162/attachment.bin>


More information about the llvm-commits mailing list