diff options
| author | 2019-06-23 21:36:31 +0000 | |
|---|---|---|
| committer | 2019-06-23 21:36:31 +0000 | |
| commit | 23f101f37937a1bd4a29726cab2f76e0fb038b35 (patch) | |
| tree | f7da7d6b32c2e07114da399150bfa88d72187012 /gnu/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp | |
| parent | sort previous; ok deraadt (diff) | |
| download | wireguard-openbsd-23f101f37937a1bd4a29726cab2f76e0fb038b35.tar.xz wireguard-openbsd-23f101f37937a1bd4a29726cab2f76e0fb038b35.zip | |
Import LLVM 8.0.0 release including clang, lld and lldb.
Diffstat (limited to 'gnu/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp')
| -rw-r--r-- | gnu/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gnu/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp b/gnu/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp index 64dca930722..334fcacf807 100644 --- a/gnu/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp +++ b/gnu/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp @@ -103,8 +103,9 @@ static ExFunc lookupFunction(const Function *F) { // composite function name should be. std::string ExtName = "lle_"; FunctionType *FT = F->getFunctionType(); - for (unsigned i = 0, e = FT->getNumContainedTypes(); i != e; ++i) - ExtName += getTypeID(FT->getContainedType(i)); + ExtName += getTypeID(FT->getReturnType()); + for (Type *T : FT->params()) + ExtName += getTypeID(T); ExtName += ("_" + F->getName()).str(); sys::ScopedLock Writer(*FunctionsLock); @@ -227,7 +228,8 @@ static bool ffiInvoke(RawFunc Fn, Function *F, ArrayRef<GenericValue> ArgVals, Type *RetTy = FTy->getReturnType(); ffi_type *rtype = ffiTypeFor(RetTy); - if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, NumArgs, rtype, &args[0]) == FFI_OK) { + if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, NumArgs, rtype, args.data()) == + FFI_OK) { SmallVector<uint8_t, 128> ret; if (RetTy->getTypeID() != Type::VoidTyID) ret.resize(TD.getTypeStoreSize(RetTy)); |
