[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
This commit is contained in:
Robert Widmann 2018-11-06 01:54:12 +00:00
parent 927c8803c1
commit 6c7073f2f8
1 changed files with 1 additions and 1 deletions

View File

@ -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) {