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

Amaury SECHET via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 15 15:59:26 PST 2016


deadalnix created this revision.
deadalnix added reviewers: joker.eph, Wallbraker, echristo.
deadalnix added a subscriber: llvm-commits.

The name is confusing as it matche another method on the module.

http://reviews.llvm.org/D17283

Files:
  include/llvm-c/Core.h
  lib/IR/Core.cpp

Index: lib/IR/Core.cpp
===================================================================
--- lib/IR/Core.cpp
+++ 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);
 }
Index: include/llvm-c/Core.h
===================================================================
--- include/llvm-c/Core.h
+++ 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);
 
 /**


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17283.48029.patch
Type: text/x-patch
Size: 1207 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160215/82714a3b/attachment.bin>


More information about the llvm-commits mailing list