Function.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692
  1. //===-- Function.h ----------------------------------------------*- C++ -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. #ifndef LLDB_SYMBOL_FUNCTION_H
  9. #define LLDB_SYMBOL_FUNCTION_H
  10. #include "lldb/Core/AddressRange.h"
  11. #include "lldb/Core/Declaration.h"
  12. #include "lldb/Core/Mangled.h"
  13. #include "lldb/Expression/DWARFExpression.h"
  14. #include "lldb/Symbol/Block.h"
  15. #include "lldb/Utility/UserID.h"
  16. #include "llvm/ADT/ArrayRef.h"
  17. #include <mutex>
  18. namespace lldb_private {
  19. class ExecutionContext;
  20. /// \class FunctionInfo Function.h "lldb/Symbol/Function.h"
  21. /// A class that contains generic function information.
  22. ///
  23. /// This provides generic function information that gets reused between inline
  24. /// functions and function types.
  25. class FunctionInfo {
  26. public:
  27. /// Construct with the function method name and optional declaration
  28. /// information.
  29. ///
  30. /// \param[in] name
  31. /// A C string name for the method name for this function. This
  32. /// value should not be the mangled named, but the simple method
  33. /// name.
  34. ///
  35. /// \param[in] decl_ptr
  36. /// Optional declaration information that describes where the
  37. /// function was declared. This can be NULL.
  38. FunctionInfo(const char *name, const Declaration *decl_ptr);
  39. /// Construct with the function method name and optional declaration
  40. /// information.
  41. ///
  42. /// \param[in] name
  43. /// A name for the method name for this function. This value
  44. /// should not be the mangled named, but the simple method name.
  45. ///
  46. /// \param[in] decl_ptr
  47. /// Optional declaration information that describes where the
  48. /// function was declared. This can be NULL.
  49. FunctionInfo(ConstString name, const Declaration *decl_ptr);
  50. /// Destructor.
  51. ///
  52. /// The destructor is virtual since classes inherit from this class.
  53. virtual ~FunctionInfo();
  54. /// Compare two function information objects.
  55. ///
  56. /// First compares the method names, and if equal, then compares the
  57. /// declaration information.
  58. ///
  59. /// \param[in] lhs
  60. /// The Left Hand Side const FunctionInfo object reference.
  61. ///
  62. /// \param[in] rhs
  63. /// The Right Hand Side const FunctionInfo object reference.
  64. ///
  65. /// \return
  66. /// -1 if lhs < rhs
  67. /// 0 if lhs == rhs
  68. /// 1 if lhs > rhs
  69. static int Compare(const FunctionInfo &lhs, const FunctionInfo &rhs);
  70. /// Dump a description of this object to a Stream.
  71. ///
  72. /// Dump a description of the contents of this object to the supplied stream
  73. /// \a s.
  74. ///
  75. /// \param[in] s
  76. /// The stream to which to dump the object description.
  77. void Dump(Stream *s, bool show_fullpaths) const;
  78. /// Get accessor for the declaration information.
  79. ///
  80. /// \return
  81. /// A reference to the declaration object.
  82. Declaration &GetDeclaration();
  83. /// Get const accessor for the declaration information.
  84. ///
  85. /// \return
  86. /// A const reference to the declaration object.
  87. const Declaration &GetDeclaration() const;
  88. /// Get accessor for the method name.
  89. ///
  90. /// \return
  91. /// A const reference to the method name object.
  92. ConstString GetName() const;
  93. /// Get the memory cost of this object.
  94. ///
  95. /// \return
  96. /// The number of bytes that this object occupies in memory.
  97. /// The returned value does not include the bytes for any
  98. /// shared string values.
  99. ///
  100. /// \see ConstString::StaticMemorySize ()
  101. virtual size_t MemorySize() const;
  102. protected:
  103. /// Function method name (not a mangled name).
  104. ConstString m_name;
  105. /// Information describing where this function information was defined.
  106. Declaration m_declaration;
  107. };
  108. /// \class InlineFunctionInfo Function.h "lldb/Symbol/Function.h"
  109. /// A class that describes information for an inlined function.
  110. class InlineFunctionInfo : public FunctionInfo {
  111. public:
  112. /// Construct with the function method name, mangled name, and optional
  113. /// declaration information.
  114. ///
  115. /// \param[in] name
  116. /// A C string name for the method name for this function. This
  117. /// value should not be the mangled named, but the simple method
  118. /// name.
  119. ///
  120. /// \param[in] mangled
  121. /// A C string name for the mangled name for this function. This
  122. /// value can be NULL if there is no mangled information.
  123. ///
  124. /// \param[in] decl_ptr
  125. /// Optional declaration information that describes where the
  126. /// function was declared. This can be NULL.
  127. ///
  128. /// \param[in] call_decl_ptr
  129. /// Optional calling location declaration information that
  130. /// describes from where this inlined function was called.
  131. InlineFunctionInfo(const char *name, llvm::StringRef mangled,
  132. const Declaration *decl_ptr,
  133. const Declaration *call_decl_ptr);
  134. /// Construct with the function method name, mangled name, and optional
  135. /// declaration information.
  136. ///
  137. /// \param[in] name
  138. /// A name for the method name for this function. This value
  139. /// should not be the mangled named, but the simple method name.
  140. ///
  141. /// \param[in] mangled
  142. /// A name for the mangled name for this function. This value
  143. /// can be empty if there is no mangled information.
  144. ///
  145. /// \param[in] decl_ptr
  146. /// Optional declaration information that describes where the
  147. /// function was declared. This can be NULL.
  148. ///
  149. /// \param[in] call_decl_ptr
  150. /// Optional calling location declaration information that
  151. /// describes from where this inlined function was called.
  152. InlineFunctionInfo(ConstString name, const Mangled &mangled,
  153. const Declaration *decl_ptr,
  154. const Declaration *call_decl_ptr);
  155. /// Destructor.
  156. ~InlineFunctionInfo() override;
  157. /// Compare two inlined function information objects.
  158. ///
  159. /// First compares the FunctionInfo objects, and if equal, compares the
  160. /// mangled names.
  161. ///
  162. /// \param[in] lhs
  163. /// The Left Hand Side const InlineFunctionInfo object
  164. /// reference.
  165. ///
  166. /// \param[in] rhs
  167. /// The Right Hand Side const InlineFunctionInfo object
  168. /// reference.
  169. ///
  170. /// \return
  171. /// -1 if lhs < rhs
  172. /// 0 if lhs == rhs
  173. /// 1 if lhs > rhs
  174. int Compare(const InlineFunctionInfo &lhs, const InlineFunctionInfo &rhs);
  175. /// Dump a description of this object to a Stream.
  176. ///
  177. /// Dump a description of the contents of this object to the supplied stream
  178. /// \a s.
  179. ///
  180. /// \param[in] s
  181. /// The stream to which to dump the object description.
  182. void Dump(Stream *s, bool show_fullpaths) const;
  183. void DumpStopContext(Stream *s) const;
  184. ConstString GetName() const;
  185. ConstString GetDisplayName() const;
  186. /// Get accessor for the call site declaration information.
  187. ///
  188. /// \return
  189. /// A reference to the declaration object.
  190. Declaration &GetCallSite();
  191. /// Get const accessor for the call site declaration information.
  192. ///
  193. /// \return
  194. /// A const reference to the declaration object.
  195. const Declaration &GetCallSite() const;
  196. /// Get accessor for the mangled name object.
  197. ///
  198. /// \return
  199. /// A reference to the mangled name object.
  200. Mangled &GetMangled();
  201. /// Get const accessor for the mangled name object.
  202. ///
  203. /// \return
  204. /// A const reference to the mangled name object.
  205. const Mangled &GetMangled() const;
  206. /// Get the memory cost of this object.
  207. ///
  208. /// \return
  209. /// The number of bytes that this object occupies in memory.
  210. /// The returned value does not include the bytes for any
  211. /// shared string values.
  212. ///
  213. /// \see ConstString::StaticMemorySize ()
  214. size_t MemorySize() const override;
  215. private:
  216. /// Mangled inlined function name (can be empty if there is no mangled
  217. /// information).
  218. Mangled m_mangled;
  219. Declaration m_call_decl;
  220. };
  221. class Function;
  222. /// \class CallSiteParameter Function.h "lldb/Symbol/Function.h"
  223. ///
  224. /// Represent the locations of a parameter at a call site, both in the caller
  225. /// and in the callee.
  226. struct CallSiteParameter {
  227. DWARFExpression LocationInCallee;
  228. DWARFExpression LocationInCaller;
  229. };
  230. /// A vector of \c CallSiteParameter.
  231. using CallSiteParameterArray = llvm::SmallVector<CallSiteParameter, 0>;
  232. /// \class CallEdge Function.h "lldb/Symbol/Function.h"
  233. ///
  234. /// Represent a call made within a Function. This can be used to find a path
  235. /// in the call graph between two functions, or to evaluate DW_OP_entry_value.
  236. class CallEdge {
  237. public:
  238. enum class AddrType : uint8_t { Call, AfterCall };
  239. virtual ~CallEdge() {}
  240. /// Get the callee's definition.
  241. ///
  242. /// Note that this might lazily invoke the DWARF parser. A register context
  243. /// from the caller's activation is needed to find indirect call targets.
  244. virtual Function *GetCallee(ModuleList &images,
  245. ExecutionContext &exe_ctx) = 0;
  246. /// Get the load PC address of the instruction which executes after the call
  247. /// returns. Returns LLDB_INVALID_ADDRESS iff this is a tail call. \p caller
  248. /// is the Function containing this call, and \p target is the Target which
  249. /// made the call.
  250. lldb::addr_t GetReturnPCAddress(Function &caller, Target &target) const;
  251. /// Return an address in the caller. This can either be the address of the
  252. /// call instruction, or the address of the instruction after the call.
  253. std::pair<AddrType, lldb::addr_t> GetCallerAddress(Function &caller,
  254. Target &target) const {
  255. return {caller_address_type,
  256. GetLoadAddress(caller_address, caller, target)};
  257. }
  258. bool IsTailCall() const { return is_tail_call; }
  259. /// Get the call site parameters available at this call edge.
  260. llvm::ArrayRef<CallSiteParameter> GetCallSiteParameters() const {
  261. return parameters;
  262. }
  263. /// Non-tail-calls go first, sorted by the return address. They are followed
  264. /// by tail calls, which have no specific order.
  265. std::pair<bool, lldb::addr_t> GetSortKey() const {
  266. return {is_tail_call, GetUnresolvedReturnPCAddress()};
  267. }
  268. protected:
  269. CallEdge(AddrType caller_address_type, lldb::addr_t caller_address,
  270. bool is_tail_call, CallSiteParameterArray &&parameters)
  271. : caller_address(caller_address),
  272. caller_address_type(caller_address_type), is_tail_call(is_tail_call),
  273. parameters(std::move(parameters)) {}
  274. /// Helper that finds the load address of \p unresolved_pc, a file address
  275. /// which refers to an instruction within \p caller.
  276. static lldb::addr_t GetLoadAddress(lldb::addr_t unresolved_pc,
  277. Function &caller, Target &target);
  278. /// Like \ref GetReturnPCAddress, but returns an unresolved file address.
  279. lldb::addr_t GetUnresolvedReturnPCAddress() const {
  280. return caller_address_type == AddrType::AfterCall && !is_tail_call
  281. ? caller_address
  282. : LLDB_INVALID_ADDRESS;
  283. }
  284. private:
  285. lldb::addr_t caller_address;
  286. AddrType caller_address_type;
  287. bool is_tail_call;
  288. CallSiteParameterArray parameters;
  289. };
  290. /// A direct call site. Used to represent call sites where the address of the
  291. /// callee is fixed (e.g. a function call in C in which the call target is not
  292. /// a function pointer).
  293. class DirectCallEdge : public CallEdge {
  294. public:
  295. /// Construct a call edge using a symbol name to identify the callee, and a
  296. /// return PC within the calling function to identify a specific call site.
  297. DirectCallEdge(const char *symbol_name, AddrType caller_address_type,
  298. lldb::addr_t caller_address, bool is_tail_call,
  299. CallSiteParameterArray &&parameters)
  300. : CallEdge(caller_address_type, caller_address, is_tail_call,
  301. std::move(parameters)) {
  302. lazy_callee.symbol_name = symbol_name;
  303. }
  304. Function *GetCallee(ModuleList &images, ExecutionContext &exe_ctx) override;
  305. private:
  306. void ParseSymbolFileAndResolve(ModuleList &images);
  307. // Used to describe a direct call.
  308. //
  309. // Either the callee's mangled name or its definition, discriminated by
  310. // \ref resolved.
  311. union {
  312. const char *symbol_name;
  313. Function *def;
  314. } lazy_callee;
  315. /// Whether or not an attempt was made to find the callee's definition.
  316. bool resolved = false;
  317. };
  318. /// An indirect call site. Used to represent call sites where the address of
  319. /// the callee is not fixed, e.g. a call to a C++ virtual function (where the
  320. /// address is loaded out of a vtable), or a call to a function pointer in C.
  321. class IndirectCallEdge : public CallEdge {
  322. public:
  323. /// Construct a call edge using a DWARFExpression to identify the callee, and
  324. /// a return PC within the calling function to identify a specific call site.
  325. IndirectCallEdge(DWARFExpression call_target, AddrType caller_address_type,
  326. lldb::addr_t caller_address, bool is_tail_call,
  327. CallSiteParameterArray &&parameters)
  328. : CallEdge(caller_address_type, caller_address, is_tail_call,
  329. std::move(parameters)),
  330. call_target(std::move(call_target)) {}
  331. Function *GetCallee(ModuleList &images, ExecutionContext &exe_ctx) override;
  332. private:
  333. // Used to describe an indirect call.
  334. //
  335. // Specifies the location of the callee address in the calling frame.
  336. DWARFExpression call_target;
  337. };
  338. /// \class Function Function.h "lldb/Symbol/Function.h"
  339. /// A class that describes a function.
  340. ///
  341. /// Functions belong to CompileUnit objects (Function::m_comp_unit), have
  342. /// unique user IDs (Function::UserID), know how to reconstruct their symbol
  343. /// context (Function::SymbolContextScope), have a specific function type
  344. /// (Function::m_type_uid), have a simple method name (FunctionInfo::m_name),
  345. /// be declared at a specific location (FunctionInfo::m_declaration), possibly
  346. /// have mangled names (Function::m_mangled), an optional return type
  347. /// (Function::m_type), and contains lexical blocks (Function::m_blocks).
  348. ///
  349. /// The function information is split into a few pieces:
  350. /// \li The concrete instance information
  351. /// \li The abstract information
  352. ///
  353. /// The abstract information is found in the function type (Type) that
  354. /// describes a function information, return type and parameter types.
  355. ///
  356. /// The concrete information is the address range information and specific
  357. /// locations for an instance of this function.
  358. class Function : public UserID, public SymbolContextScope {
  359. public:
  360. /// Construct with a compile unit, function UID, function type UID, optional
  361. /// mangled name, function type, and a section offset based address range.
  362. ///
  363. /// \param[in] comp_unit
  364. /// The compile unit to which this function belongs.
  365. ///
  366. /// \param[in] func_uid
  367. /// The UID for this function. This value is provided by the
  368. /// SymbolFile plug-in and can be any value that allows
  369. /// the plug-in to quickly find and parse more detailed
  370. /// information when and if more information is needed.
  371. ///
  372. /// \param[in] func_type_uid
  373. /// The type UID for the function Type to allow for lazy type
  374. /// parsing from the debug information.
  375. ///
  376. /// \param[in] mangled
  377. /// The optional mangled name for this function. If empty, there
  378. /// is no mangled information.
  379. ///
  380. /// \param[in] func_type
  381. /// The optional function type. If NULL, the function type will
  382. /// be parsed on demand when accessed using the
  383. /// Function::GetType() function by asking the SymbolFile
  384. /// plug-in to get the type for \a func_type_uid.
  385. ///
  386. /// \param[in] range
  387. /// The section offset based address for this function.
  388. Function(CompileUnit *comp_unit, lldb::user_id_t func_uid,
  389. lldb::user_id_t func_type_uid, const Mangled &mangled,
  390. Type *func_type, const AddressRange &range);
  391. /// Destructor.
  392. ~Function() override;
  393. /// \copydoc SymbolContextScope::CalculateSymbolContext(SymbolContext*)
  394. ///
  395. /// \see SymbolContextScope
  396. void CalculateSymbolContext(SymbolContext *sc) override;
  397. lldb::ModuleSP CalculateSymbolContextModule() override;
  398. CompileUnit *CalculateSymbolContextCompileUnit() override;
  399. Function *CalculateSymbolContextFunction() override;
  400. const AddressRange &GetAddressRange() { return m_range; }
  401. lldb::LanguageType GetLanguage() const;
  402. /// Find the file and line number of the source location of the start of the
  403. /// function. This will use the declaration if present and fall back on the
  404. /// line table if that fails. So there may NOT be a line table entry for
  405. /// this source file/line combo.
  406. ///
  407. /// \param[out] source_file
  408. /// The source file.
  409. ///
  410. /// \param[out] line_no
  411. /// The line number.
  412. void GetStartLineSourceInfo(FileSpec &source_file, uint32_t &line_no);
  413. /// Find the file and line number of the source location of the end of the
  414. /// function.
  415. ///
  416. ///
  417. /// \param[out] source_file
  418. /// The source file.
  419. ///
  420. /// \param[out] line_no
  421. /// The line number.
  422. void GetEndLineSourceInfo(FileSpec &source_file, uint32_t &line_no);
  423. /// Get the outgoing call edges from this function, sorted by their return
  424. /// PC addresses (in increasing order).
  425. llvm::ArrayRef<std::unique_ptr<CallEdge>> GetCallEdges();
  426. /// Get the outgoing tail-calling edges from this function. If none exist,
  427. /// return None.
  428. llvm::ArrayRef<std::unique_ptr<CallEdge>> GetTailCallingEdges();
  429. /// Get the outgoing call edge from this function which has the given return
  430. /// address \p return_pc, or return nullptr. Note that this will not return a
  431. /// tail-calling edge.
  432. CallEdge *GetCallEdgeForReturnAddress(lldb::addr_t return_pc, Target &target);
  433. /// Get accessor for the block list.
  434. ///
  435. /// \return
  436. /// The block list object that describes all lexical blocks
  437. /// in the function.
  438. ///
  439. /// \see BlockList
  440. Block &GetBlock(bool can_create);
  441. /// Get accessor for the compile unit that owns this function.
  442. ///
  443. /// \return
  444. /// A compile unit object pointer.
  445. CompileUnit *GetCompileUnit();
  446. /// Get const accessor for the compile unit that owns this function.
  447. ///
  448. /// \return
  449. /// A const compile unit object pointer.
  450. const CompileUnit *GetCompileUnit() const;
  451. void GetDescription(Stream *s, lldb::DescriptionLevel level, Target *target);
  452. /// Get accessor for the frame base location.
  453. ///
  454. /// \return
  455. /// A location expression that describes the function frame
  456. /// base.
  457. DWARFExpression &GetFrameBaseExpression() { return m_frame_base; }
  458. /// Get const accessor for the frame base location.
  459. ///
  460. /// \return
  461. /// A const compile unit object pointer.
  462. const DWARFExpression &GetFrameBaseExpression() const { return m_frame_base; }
  463. ConstString GetName() const;
  464. ConstString GetNameNoArguments() const;
  465. ConstString GetDisplayName() const;
  466. const Mangled &GetMangled() const { return m_mangled; }
  467. /// Get the DeclContext for this function, if available.
  468. ///
  469. /// \return
  470. /// The DeclContext, or NULL if none exists.
  471. CompilerDeclContext GetDeclContext();
  472. /// Get accessor for the type that describes the function return value type,
  473. /// and parameter types.
  474. ///
  475. /// \return
  476. /// A type object pointer.
  477. Type *GetType();
  478. /// Get const accessor for the type that describes the function return value
  479. /// type, and parameter types.
  480. ///
  481. /// \return
  482. /// A const type object pointer.
  483. const Type *GetType() const;
  484. CompilerType GetCompilerType();
  485. /// Get the size of the prologue instructions for this function. The
  486. /// "prologue" instructions include any instructions given line number 0
  487. /// immediately following the prologue end.
  488. ///
  489. /// \return
  490. /// The size of the prologue.
  491. uint32_t GetPrologueByteSize();
  492. /// Dump a description of this object to a Stream.
  493. ///
  494. /// Dump a description of the contents of this object to the supplied stream
  495. /// \a s.
  496. ///
  497. /// \param[in] s
  498. /// The stream to which to dump the object description.
  499. ///
  500. /// \param[in] show_context
  501. /// If \b true, variables will dump their symbol context
  502. /// information.
  503. void Dump(Stream *s, bool show_context) const;
  504. /// \copydoc SymbolContextScope::DumpSymbolContext(Stream*)
  505. ///
  506. /// \see SymbolContextScope
  507. void DumpSymbolContext(Stream *s) override;
  508. /// Get the memory cost of this object.
  509. ///
  510. /// \return
  511. /// The number of bytes that this object occupies in memory.
  512. /// The returned value does not include the bytes for any
  513. /// shared string values.
  514. ///
  515. /// \see ConstString::StaticMemorySize ()
  516. size_t MemorySize() const;
  517. /// Get whether compiler optimizations were enabled for this function
  518. ///
  519. /// The debug information may provide information about whether this
  520. /// function was compiled with optimization or not. In this case,
  521. /// "optimized" means that the debug experience may be difficult for the
  522. /// user to understand. Variables may not be available when the developer
  523. /// would expect them, stepping through the source lines in the function may
  524. /// appear strange, etc.
  525. ///
  526. /// \return
  527. /// Returns 'true' if this function was compiled with
  528. /// optimization. 'false' indicates that either the optimization
  529. /// is unknown, or this function was built without optimization.
  530. bool GetIsOptimized();
  531. /// Get whether this function represents a 'top-level' function
  532. ///
  533. /// The concept of a top-level function is language-specific, mostly meant
  534. /// to represent the notion of scripting-style code that has global
  535. /// visibility of the variables/symbols/functions/... defined within the
  536. /// containing file/module
  537. ///
  538. /// If stopped in a top-level function, LLDB will expose global variables
  539. /// as-if locals in the 'frame variable' command
  540. ///
  541. /// \return
  542. /// Returns 'true' if this function is a top-level function,
  543. /// 'false' otherwise.
  544. bool IsTopLevelFunction();
  545. lldb::DisassemblerSP GetInstructions(const ExecutionContext &exe_ctx,
  546. const char *flavor,
  547. bool force_live_memory = false);
  548. bool GetDisassembly(const ExecutionContext &exe_ctx, const char *flavor,
  549. Stream &strm, bool force_live_memory = false);
  550. protected:
  551. enum {
  552. /// Whether we already tried to calculate the prologue size.
  553. flagsCalculatedPrologueSize = (1 << 0)
  554. };
  555. /// The compile unit that owns this function.
  556. CompileUnit *m_comp_unit;
  557. /// The user ID of for the prototype Type for this function.
  558. lldb::user_id_t m_type_uid;
  559. /// The function prototype type for this function that includes the function
  560. /// info (FunctionInfo), return type and parameters.
  561. Type *m_type;
  562. /// The mangled function name if any. If empty, there is no mangled
  563. /// information.
  564. Mangled m_mangled;
  565. /// All lexical blocks contained in this function.
  566. Block m_block;
  567. /// The function address range that covers the widest range needed to contain
  568. /// all blocks
  569. AddressRange m_range;
  570. /// The frame base expression for variables that are relative to the frame
  571. /// pointer.
  572. DWARFExpression m_frame_base;
  573. Flags m_flags;
  574. /// Compute the prologue size once and cache it.
  575. uint32_t m_prologue_byte_size;
  576. /// Exclusive lock that controls read/write access to m_call_edges and
  577. /// m_call_edges_resolved.
  578. std::mutex m_call_edges_lock;
  579. /// Whether call site info has been parsed.
  580. bool m_call_edges_resolved = false;
  581. /// Outgoing call edges.
  582. std::vector<std::unique_ptr<CallEdge>> m_call_edges;
  583. private:
  584. Function(const Function &) = delete;
  585. const Function &operator=(const Function &) = delete;
  586. };
  587. } // namespace lldb_private
  588. #endif // LLDB_SYMBOL_FUNCTION_H