summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Core.cpp
diff options
context:
space:
mode:
authorRobert Widmann <devteam.codafi@gmail.com>2018-11-06 01:54:12 +0000
committerRobert Widmann <devteam.codafi@gmail.com>2018-11-06 01:54:12 +0000
commit6c7073f2f8007a6bb1d992eb68a2eaadd7f4529e (patch)
tree6ce97fe6b7bec91f16510ceb66a104af5ab6240d /llvm/lib/IR/Core.cpp
parent927c8803c15ac9f3cab089e3224f2e2b2b437b16 (diff)
downloadbcm5719-llvm-6c7073f2f8007a6bb1d992eb68a2eaadd7f4529e.tar.gz
bcm5719-llvm-6c7073f2f8007a6bb1d992eb68a2eaadd7f4529e.zip
[LLVM-C] Fix Windows Build of Core
strndup doesn't exist outside of GNU-land and modern macOSes. Use strdup instead as c_str() is guaranteed to be NUL-terminated. llvm-svn: 346197
Diffstat (limited to 'llvm/lib/IR/Core.cpp')
-rw-r--r--llvm/lib/IR/Core.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp
index f94b8a04738..a3065733c81 100644
--- a/llvm/lib/IR/Core.cpp
+++ b/llvm/lib/IR/Core.cpp
@@ -2316,7 +2316,7 @@ const char *LLVMIntrinsicCopyOverloadedName(unsigned ID,
ArrayRef<Type*> Tys(unwrap(ParamTypes), ParamCount);
auto Str = llvm::Intrinsic::getName(IID, Tys);
*NameLength = Str.length();
- return strndup(Str.c_str(), Str.length());
+ return strdup(Str.c_str());
}
LLVMBool LLVMIntrinsicIsOverloaded(unsigned ID) {
OpenPOWER on IntegriCloud