Index: compiler-rt/lib/orc/c_api.h =================================================================== --- compiler-rt/lib/orc/c_api.h +++ compiler-rt/lib/orc/c_api.h @@ -50,7 +50,7 @@ typedef union { char *ValuePtr; - char Value[sizeof(ValuePtr)]; + char Value[sizeof(char *)]; } __orc_rt_CWrapperFunctionResultDataUnion; /** @@ -135,8 +135,8 @@ * Create an __orc_rt_CWrapperFunctionResult representing an out-of-band * error. * - * This function takes ownership of the string argument which must have been - * allocated with malloc. + * This function copies the input string. The client is responsible for freeing + * the ErrMsg arg. */ static inline __orc_rt_CWrapperFunctionResult __orc_rt_CreateCWrapperFunctionResultFromOutOfBandError(const char *ErrMsg) { @@ -165,7 +165,7 @@ */ static inline const char * __orc_rt_CWrapperFunctionResultData(const __orc_rt_CWrapperFunctionResult *R) { - assert((R->Size != 0 || R->Data.ValuePtr == nullptr) && + assert((R->Size != 0 || R->Data.ValuePtr == NULL) && "Cannot get data for out-of-band error value"); return R->Size > sizeof(R->Data.Value) ? R->Data.ValuePtr : R->Data.Value; } @@ -177,7 +177,7 @@ */ static inline size_t __orc_rt_CWrapperFunctionResultSize(const __orc_rt_CWrapperFunctionResult *R) { - assert((R->Size != 0 || R->Data.ValuePtr == nullptr) && + assert((R->Size != 0 || R->Data.ValuePtr == NULL) && "Cannot get size for out-of-band error value"); return R->Size; } Index: llvm/include/llvm-c/Transforms/PassBuilder.h =================================================================== --- llvm/include/llvm-c/Transforms/PassBuilder.h +++ llvm/include/llvm-c/Transforms/PassBuilder.h @@ -50,7 +50,7 @@ * responsible for it. The client should call LLVMDisposePassBuilderOptions * to free the pass builder options. */ -LLVMPassBuilderOptionsRef LLVMCreatePassBuilderOptions(); +LLVMPassBuilderOptionsRef LLVMCreatePassBuilderOptions(void); /** * Toggle adding the VerifierPass for the PassBuilder, ensuring all functions