[llvm] r260920 - Deprecate LLVMGetDataLayout and replace it by LLVMGetDataLayoutStr

Amaury Sechet via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 15 16:23:52 PST 2016


Author: deadalnix
Date: Mon Feb 15 18:23:52 2016
New Revision: 260920

URL: http://llvm.org/viewvc/llvm-project?rev=260920&view=rev
Log:
Deprecate LLVMGetDataLayout and replace it by LLVMGetDataLayoutStr

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

Reviewers: joker.eph, Wallbraker, echristo

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D17283

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

Modified: llvm/trunk/docs/ReleaseNotes.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ReleaseNotes.rst?rev=260920&r1=260919&r2=260920&view=diff
==============================================================================
--- llvm/trunk/docs/ReleaseNotes.rst (original)
+++ llvm/trunk/docs/ReleaseNotes.rst Mon Feb 15 18:23:52 2016
@@ -44,6 +44,9 @@ Non-comprehensive list of changes in thi
 
 * 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

Modified: llvm/trunk/include/llvm-c/Core.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/Core.h?rev=260920&r1=260919&r2=260920&view=diff
==============================================================================
--- llvm/trunk/include/llvm-c/Core.h (original)
+++ llvm/trunk/include/llvm-c/Core.h Mon Feb 15 18:23:52 2016
@@ -481,8 +481,13 @@ void LLVMDisposeModule(LLVMModuleRef M);
 /**
  * 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);
 
 /**

Modified: llvm/trunk/lib/IR/Core.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Core.cpp?rev=260920&r1=260919&r2=260920&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Core.cpp (original)
+++ llvm/trunk/lib/IR/Core.cpp Mon Feb 15 18:23:52 2016
@@ -160,10 +160,14 @@ void LLVMDisposeModule(LLVMModuleRef M)
 }
 
 /*--.. 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);
 }




More information about the llvm-commits mailing list