diff options
author | Robert Widmann <devteam.codafi@gmail.com> | 2018-11-06 01:54:12 +0000 |
---|---|---|
committer | Robert Widmann <devteam.codafi@gmail.com> | 2018-11-06 01:54:12 +0000 |
commit | 6c7073f2f8007a6bb1d992eb68a2eaadd7f4529e (patch) | |
tree | 6ce97fe6b7bec91f16510ceb66a104af5ab6240d /llvm/lib/IR/Core.cpp | |
parent | 927c8803c15ac9f3cab089e3224f2e2b2b437b16 (diff) | |
download | bcm5719-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.cpp | 2 |
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) { |