@@ -112,20 +112,22 @@ extern "C" void LLVMRustPrintPassTimings() {
112
112
TimerGroup::printAll (OS);
113
113
}
114
114
115
- extern " C" LLVMValueRef LLVMRustGetNamedValue (LLVMModuleRef M,
116
- const char *Name ) {
117
- return wrap (unwrap (M)->getNamedValue (Name));
115
+ extern " C" LLVMValueRef LLVMRustGetNamedValue (LLVMModuleRef M, const char *Name,
116
+ size_t NameLen ) {
117
+ return wrap (unwrap (M)->getNamedValue (StringRef ( Name, NameLen) ));
118
118
}
119
119
120
120
extern " C" LLVMValueRef LLVMRustGetOrInsertFunction (LLVMModuleRef M,
121
121
const char *Name,
122
+ size_t NameLen,
122
123
LLVMTypeRef FunctionTy) {
123
- return wrap (
124
- unwrap (M)->getOrInsertFunction (Name, unwrap<FunctionType>(FunctionTy))
124
+ return wrap (unwrap (M)
125
+ ->getOrInsertFunction (StringRef (Name, NameLen),
126
+ unwrap<FunctionType>(FunctionTy))
125
127
#if LLVM_VERSION_GE(9, 0)
126
- .getCallee ()
128
+ .getCallee ()
127
129
#endif
128
- );
130
+ );
129
131
}
130
132
131
133
extern " C" LLVMValueRef
@@ -395,22 +397,26 @@ static InlineAsm::AsmDialect fromRust(LLVMRustAsmDialect Dialect) {
395
397
}
396
398
}
397
399
398
- extern " C" LLVMValueRef LLVMRustInlineAsm (LLVMTypeRef Ty, char *AsmString,
399
- char *Constraints,
400
- LLVMBool HasSideEffects,
401
- LLVMBool IsAlignStack,
402
- LLVMRustAsmDialect Dialect) {
403
- return wrap (InlineAsm::get (unwrap<FunctionType>(Ty), AsmString, Constraints,
400
+ extern " C" LLVMValueRef
401
+ LLVMRustInlineAsm (LLVMTypeRef Ty, char *AsmString, size_t AsmStringLen,
402
+ char *Constraints, size_t ConstraintsLen,
403
+ LLVMBool HasSideEffects, LLVMBool IsAlignStack,
404
+ LLVMRustAsmDialect Dialect) {
405
+ return wrap (InlineAsm::get (unwrap<FunctionType>(Ty),
406
+ StringRef (AsmString, AsmStringLen),
407
+ StringRef (Constraints, ConstraintsLen),
404
408
HasSideEffects, IsAlignStack, fromRust (Dialect)));
405
409
}
406
410
407
- extern " C" bool LLVMRustInlineAsmVerify (LLVMTypeRef Ty,
408
- char *Constraints) {
409
- return InlineAsm::Verify (unwrap<FunctionType>(Ty), Constraints);
411
+ extern " C" bool LLVMRustInlineAsmVerify (LLVMTypeRef Ty, char *Constraints,
412
+ size_t ConstraintsLen) {
413
+ return InlineAsm::Verify (unwrap<FunctionType>(Ty),
414
+ StringRef (Constraints, ConstraintsLen));
410
415
}
411
416
412
- extern " C" void LLVMRustAppendModuleInlineAsm (LLVMModuleRef M, const char *Asm) {
413
- unwrap (M)->appendModuleInlineAsm (StringRef (Asm));
417
+ extern " C" void LLVMRustAppendModuleInlineAsm (LLVMModuleRef M, const char *Asm,
418
+ size_t AsmLen) {
419
+ unwrap (M)->appendModuleInlineAsm (StringRef (Asm, AsmLen));
414
420
}
415
421
416
422
typedef DIBuilder *LLVMRustDIBuilderRef;
@@ -1282,12 +1288,11 @@ extern "C" void LLVMRustFreeOperandBundleDef(OperandBundleDef *Bundle) {
1282
1288
1283
1289
extern " C" LLVMValueRef LLVMRustBuildCall (LLVMBuilderRef B, LLVMValueRef Fn,
1284
1290
LLVMValueRef *Args, unsigned NumArgs,
1285
- OperandBundleDef *Bundle,
1286
- const char *Name) {
1291
+ OperandBundleDef *Bundle) {
1287
1292
unsigned Len = Bundle ? 1 : 0 ;
1288
1293
ArrayRef<OperandBundleDef> Bundles = makeArrayRef (Bundle, Len);
1289
1294
return wrap (unwrap (B)->CreateCall (
1290
- unwrap (Fn), makeArrayRef (unwrap (Args), NumArgs), Bundles, Name ));
1295
+ unwrap (Fn), makeArrayRef (unwrap (Args), NumArgs), Bundles));
1291
1296
}
1292
1297
1293
1298
extern " C" LLVMValueRef LLVMRustBuildMemCpy (LLVMBuilderRef B,
0 commit comments