1b9c1b51eSKate Stone //===-- ThreadPlanCallFunctionUsingABI.h --------------------------------*- C++
2b9c1b51eSKate Stone //-*-===//
390ff7911SEwan Crawford //
42946cd70SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
52946cd70SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
62946cd70SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
790ff7911SEwan Crawford //
890ff7911SEwan Crawford //===----------------------------------------------------------------------===//
990ff7911SEwan Crawford 
10cdc514e4SJonas Devlieghere #ifndef LLDB_TARGET_THREADPLANCALLFUNCTIONUSINGABI_H
11cdc514e4SJonas Devlieghere #define LLDB_TARGET_THREADPLANCALLFUNCTIONUSINGABI_H
1290ff7911SEwan Crawford 
1390ff7911SEwan Crawford #include "lldb/Target/ABI.h"
1490ff7911SEwan Crawford #include "lldb/Target/Thread.h"
1590ff7911SEwan Crawford #include "lldb/Target/ThreadPlanCallFunction.h"
16b9c1b51eSKate Stone #include "lldb/lldb-private.h"
1790ff7911SEwan Crawford 
1890ff7911SEwan Crawford #include "llvm/ADT/ArrayRef.h"
196ab018ecSHans Wennborg #include "llvm/IR/DerivedTypes.h"
2090ff7911SEwan Crawford 
2190ff7911SEwan Crawford namespace lldb_private {
2290ff7911SEwan Crawford 
23b9c1b51eSKate Stone class ThreadPlanCallFunctionUsingABI : public ThreadPlanCallFunction {
24b9c1b51eSKate Stone   // Create a thread plan to call a function at the address passed in the
2505097246SAdrian Prantl   // "function" argument, this function is executed using register manipulation
2605097246SAdrian Prantl   // instead of JIT. Class derives from ThreadPlanCallFunction and differs by
2705097246SAdrian Prantl   // calling a alternative
28b9c1b51eSKate Stone   // ABI interface ABI::PrepareTrivialCall() which provides more detailed
29b9c1b51eSKate Stone   // information.
3090ff7911SEwan Crawford public:
3190ff7911SEwan Crawford   ThreadPlanCallFunctionUsingABI(Thread &thread,
3290ff7911SEwan Crawford                                  const Address &function_address,
3390ff7911SEwan Crawford                                  llvm::Type &function_prototype,
3490ff7911SEwan Crawford                                  llvm::Type &return_type,
3590ff7911SEwan Crawford                                  llvm::ArrayRef<ABI::CallArgument> args,
3690ff7911SEwan Crawford                                  const EvaluateExpressionOptions &options);
3790ff7911SEwan Crawford 
386ac50bf1SPavel Labath   ~ThreadPlanCallFunctionUsingABI() override;
3990ff7911SEwan Crawford 
40b9c1b51eSKate Stone   void GetDescription(Stream *s, lldb::DescriptionLevel level) override;
4190ff7911SEwan Crawford 
4290ff7911SEwan Crawford protected:
43b9c1b51eSKate Stone   void SetReturnValue() override;
4490ff7911SEwan Crawford 
4590ff7911SEwan Crawford private:
4690ff7911SEwan Crawford   llvm::Type &m_return_type;
47*eaebcbc6SKonrad Kleine   ThreadPlanCallFunctionUsingABI(const ThreadPlanCallFunctionUsingABI &) =
48*eaebcbc6SKonrad Kleine       delete;
49*eaebcbc6SKonrad Kleine   const ThreadPlanCallFunctionUsingABI &
50*eaebcbc6SKonrad Kleine   operator=(const ThreadPlanCallFunctionUsingABI &) = delete;
5190ff7911SEwan Crawford };
5290ff7911SEwan Crawford 
5390ff7911SEwan Crawford } // namespace lldb_private
5490ff7911SEwan Crawford 
55cdc514e4SJonas Devlieghere #endif // LLDB_TARGET_THREADPLANCALLFUNCTIONUSINGABI_H
56