OSDN Git Service

Deprecate LLVMGetDataLayout and replace it by LLVMGetDataLayoutStr
authorAmaury Sechet <deadalnix@gmail.com>
Tue, 16 Feb 2016 00:23:52 +0000 (00:23 +0000)
committerAmaury Sechet <deadalnix@gmail.com>
Tue, 16 Feb 2016 00:23:52 +0000 (00:23 +0000)
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260920 91177308-0d34-0410-b5e6-96231b3b80d8

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

index eb4ec28..3d591ae 100644 (file)
@@ -44,6 +44,9 @@ Non-comprehensive list of changes in this release
 
 * 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 cd987c8..2e0a8b4 100644 (file)
@@ -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);
 
 /**
index b423716..73764af 100644 (file)
@@ -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);
 }