diff options
author | Amaury Sechet <deadalnix@gmail.com> | 2016-02-16 00:23:52 +0000 |
---|---|---|
committer | Amaury Sechet <deadalnix@gmail.com> | 2016-02-16 00:23:52 +0000 |
commit | f3549c4a1116ba88cbaebc7333e866cff9f5a612 (patch) | |
tree | 5d0a3c4e82c3b231a2016854d134a0b013d25b77 | |
parent | 2ffde01b5627d6c466287fea9f5b5ba2be9948c2 (diff) | |
download | bcm5719-llvm-f3549c4a1116ba88cbaebc7333e866cff9f5a612.tar.gz bcm5719-llvm-f3549c4a1116ba88cbaebc7333e866cff9f5a612.zip |
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
llvm-svn: 260920
-rw-r--r-- | llvm/docs/ReleaseNotes.rst | 3 | ||||
-rw-r--r-- | llvm/include/llvm-c/Core.h | 7 | ||||
-rw-r--r-- | llvm/lib/IR/Core.cpp | 6 |
3 files changed, 14 insertions, 2 deletions
diff --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst index eb4ec2857f6..3d591ae9678 100644 --- a/llvm/docs/ReleaseNotes.rst +++ b/llvm/docs/ReleaseNotes.rst @@ -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 diff --git a/llvm/include/llvm-c/Core.h b/llvm/include/llvm-c/Core.h index cd987c88f56..2e0a8b4f285 100644 --- a/llvm/include/llvm-c/Core.h +++ b/llvm/include/llvm-c/Core.h @@ -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); /** diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp index b423716f3ac..73764af4da9 100644 --- a/llvm/lib/IR/Core.cpp +++ b/llvm/lib/IR/Core.cpp @@ -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); } |