From 6c7073f2f8007a6bb1d992eb68a2eaadd7f4529e Mon Sep 17 00:00:00 2001 From: Robert Widmann Date: Tue, 6 Nov 2018 01:54:12 +0000 Subject: [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 --- llvm/lib/IR/Core.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/IR/Core.cpp') 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 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) { -- cgit v1.2.3