Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:51

0001 //===-- Function.h ----------------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_SYMBOL_FUNCTION_H
0010 #define LLDB_SYMBOL_FUNCTION_H
0011 
0012 #include "lldb/Core/AddressRange.h"
0013 #include "lldb/Core/Declaration.h"
0014 #include "lldb/Core/Mangled.h"
0015 #include "lldb/Expression/DWARFExpressionList.h"
0016 #include "lldb/Symbol/Block.h"
0017 #include "lldb/Utility/UserID.h"
0018 #include "llvm/ADT/ArrayRef.h"
0019 
0020 #include <mutex>
0021 
0022 namespace lldb_private {
0023 
0024 class ExecutionContext;
0025 
0026 /// \class FunctionInfo Function.h "lldb/Symbol/Function.h"
0027 /// A class that contains generic function information.
0028 ///
0029 /// This provides generic function information that gets reused between inline
0030 /// functions and function types.
0031 class FunctionInfo {
0032 public:
0033   /// Construct with the function method name and optional declaration
0034   /// information.
0035   ///
0036   /// \param[in] name
0037   ///     A C string name for the method name for this function. This
0038   ///     value should not be the mangled named, but the simple method
0039   ///     name.
0040   ///
0041   /// \param[in] decl_ptr
0042   ///     Optional declaration information that describes where the
0043   ///     function was declared. This can be NULL.
0044   FunctionInfo(const char *name, const Declaration *decl_ptr);
0045 
0046   /// Construct with the function method name and optional declaration
0047   /// information.
0048   ///
0049   /// \param[in] name
0050   ///     A name for the method name for this function. This value
0051   ///     should not be the mangled named, but the simple method name.
0052   ///
0053   /// \param[in] decl_ptr
0054   ///     Optional declaration information that describes where the
0055   ///     function was declared. This can be NULL.
0056   FunctionInfo(ConstString name, const Declaration *decl_ptr);
0057 
0058   /// Destructor.
0059   ///
0060   /// The destructor is virtual since classes inherit from this class.
0061   virtual ~FunctionInfo();
0062 
0063   /// Compare two function information objects.
0064   ///
0065   /// First compares the method names, and if equal, then compares the
0066   /// declaration information.
0067   ///
0068   /// \param[in] lhs
0069   ///     The Left Hand Side const FunctionInfo object reference.
0070   ///
0071   /// \param[in] rhs
0072   ///     The Right Hand Side const FunctionInfo object reference.
0073   ///
0074   /// \return
0075   ///     -1 if lhs < rhs
0076   ///     0 if lhs == rhs
0077   ///     1 if lhs > rhs
0078   static int Compare(const FunctionInfo &lhs, const FunctionInfo &rhs);
0079 
0080   /// Dump a description of this object to a Stream.
0081   ///
0082   /// Dump a description of the contents of this object to the supplied stream
0083   /// \a s.
0084   ///
0085   /// \param[in] s
0086   ///     The stream to which to dump the object description.
0087   void Dump(Stream *s, bool show_fullpaths) const;
0088 
0089   /// Get accessor for the declaration information.
0090   ///
0091   /// \return
0092   ///     A reference to the declaration object.
0093   Declaration &GetDeclaration();
0094 
0095   /// Get const accessor for the declaration information.
0096   ///
0097   /// \return
0098   ///     A const reference to the declaration object.
0099   const Declaration &GetDeclaration() const;
0100 
0101   /// Get accessor for the method name.
0102   ///
0103   /// \return
0104   ///     A const reference to the method name object.
0105   ConstString GetName() const;
0106 
0107   /// Get the memory cost of this object.
0108   ///
0109   /// \return
0110   ///     The number of bytes that this object occupies in memory.
0111   ///     The returned value does not include the bytes for any
0112   ///     shared string values.
0113   virtual size_t MemorySize() const;
0114 
0115 protected:
0116   /// Function method name (not a mangled name).
0117   ConstString m_name;
0118 
0119   /// Information describing where this function information was defined.
0120   Declaration m_declaration;
0121 };
0122 
0123 /// \class InlineFunctionInfo Function.h "lldb/Symbol/Function.h"
0124 /// A class that describes information for an inlined function.
0125 class InlineFunctionInfo : public FunctionInfo {
0126 public:
0127   /// Construct with the function method name, mangled name, and optional
0128   /// declaration information.
0129   ///
0130   /// \param[in] name
0131   ///     A C string name for the method name for this function. This
0132   ///     value should not be the mangled named, but the simple method
0133   ///     name.
0134   ///
0135   /// \param[in] mangled
0136   ///     A C string name for the mangled name for this function. This
0137   ///     value can be NULL if there is no mangled information.
0138   ///
0139   /// \param[in] decl_ptr
0140   ///     Optional declaration information that describes where the
0141   ///     function was declared. This can be NULL.
0142   ///
0143   /// \param[in] call_decl_ptr
0144   ///     Optional calling location declaration information that
0145   ///     describes from where this inlined function was called.
0146   InlineFunctionInfo(const char *name, llvm::StringRef mangled,
0147                      const Declaration *decl_ptr,
0148                      const Declaration *call_decl_ptr);
0149 
0150   /// Construct with the function method name, mangled name, and optional
0151   /// declaration information.
0152   ///
0153   /// \param[in] name
0154   ///     A name for the method name for this function. This value
0155   ///     should not be the mangled named, but the simple method name.
0156   ///
0157   /// \param[in] mangled
0158   ///     A name for the mangled name for this function. This value
0159   ///     can be empty if there is no mangled information.
0160   ///
0161   /// \param[in] decl_ptr
0162   ///     Optional declaration information that describes where the
0163   ///     function was declared. This can be NULL.
0164   ///
0165   /// \param[in] call_decl_ptr
0166   ///     Optional calling location declaration information that
0167   ///     describes from where this inlined function was called.
0168   InlineFunctionInfo(ConstString name, const Mangled &mangled,
0169                      const Declaration *decl_ptr,
0170                      const Declaration *call_decl_ptr);
0171 
0172   /// Destructor.
0173   ~InlineFunctionInfo() override;
0174 
0175   /// Compare two inlined function information objects.
0176   ///
0177   /// First compares the FunctionInfo objects, and if equal, compares the
0178   /// mangled names.
0179   ///
0180   /// \param[in] lhs
0181   ///     The Left Hand Side const InlineFunctionInfo object
0182   ///     reference.
0183   ///
0184   /// \param[in] rhs
0185   ///     The Right Hand Side const InlineFunctionInfo object
0186   ///     reference.
0187   ///
0188   /// \return
0189   ///     -1 if lhs < rhs
0190   ///     0 if lhs == rhs
0191   ///     1 if lhs > rhs
0192   int Compare(const InlineFunctionInfo &lhs, const InlineFunctionInfo &rhs);
0193 
0194   /// Dump a description of this object to a Stream.
0195   ///
0196   /// Dump a description of the contents of this object to the supplied stream
0197   /// \a s.
0198   ///
0199   /// \param[in] s
0200   ///     The stream to which to dump the object description.
0201   void Dump(Stream *s, bool show_fullpaths) const;
0202 
0203   void DumpStopContext(Stream *s) const;
0204 
0205   ConstString GetName() const;
0206 
0207   ConstString GetDisplayName() const;
0208 
0209   /// Get accessor for the call site declaration information.
0210   ///
0211   /// \return
0212   ///     A reference to the declaration object.
0213   Declaration &GetCallSite();
0214 
0215   /// Get const accessor for the call site declaration information.
0216   ///
0217   /// \return
0218   ///     A const reference to the declaration object.
0219   const Declaration &GetCallSite() const;
0220 
0221   /// Get accessor for the mangled name object.
0222   ///
0223   /// \return
0224   ///     A reference to the mangled name object.
0225   Mangled &GetMangled();
0226 
0227   /// Get const accessor for the mangled name object.
0228   ///
0229   /// \return
0230   ///     A const reference to the mangled name object.
0231   const Mangled &GetMangled() const;
0232 
0233   /// Get the memory cost of this object.
0234   ///
0235   /// \return
0236   ///     The number of bytes that this object occupies in memory.
0237   ///     The returned value does not include the bytes for any
0238   ///     shared string values.
0239   size_t MemorySize() const override;
0240 
0241 private:
0242   /// Mangled inlined function name (can be empty if there is no mangled
0243   /// information).
0244   Mangled m_mangled;
0245 
0246   Declaration m_call_decl;
0247 };
0248 
0249 class Function;
0250 
0251 /// \class CallSiteParameter Function.h "lldb/Symbol/Function.h"
0252 ///
0253 /// Represent the locations of a parameter at a call site, both in the caller
0254 /// and in the callee.
0255 struct CallSiteParameter {
0256   DWARFExpressionList LocationInCallee;
0257   DWARFExpressionList LocationInCaller;
0258 };
0259 
0260 /// A vector of \c CallSiteParameter.
0261 using CallSiteParameterArray = llvm::SmallVector<CallSiteParameter, 0>;
0262 
0263 /// \class CallEdge Function.h "lldb/Symbol/Function.h"
0264 ///
0265 /// Represent a call made within a Function. This can be used to find a path
0266 /// in the call graph between two functions, or to evaluate DW_OP_entry_value.
0267 class CallEdge {
0268 public:
0269   enum class AddrType : uint8_t { Call, AfterCall };
0270   virtual ~CallEdge();
0271 
0272   /// Get the callee's definition.
0273   ///
0274   /// Note that this might lazily invoke the DWARF parser. A register context
0275   /// from the caller's activation is needed to find indirect call targets.
0276   virtual Function *GetCallee(ModuleList &images,
0277                               ExecutionContext &exe_ctx) = 0;
0278 
0279   /// Get the load PC address of the instruction which executes after the call
0280   /// returns. Returns LLDB_INVALID_ADDRESS iff this is a tail call. \p caller
0281   /// is the Function containing this call, and \p target is the Target which
0282   /// made the call.
0283   lldb::addr_t GetReturnPCAddress(Function &caller, Target &target) const;
0284 
0285   /// Return an address in the caller. This can either be the address of the
0286   /// call instruction, or the address of the instruction after the call.
0287   std::pair<AddrType, lldb::addr_t> GetCallerAddress(Function &caller,
0288                                                      Target &target) const {
0289     return {caller_address_type,
0290             GetLoadAddress(caller_address, caller, target)};
0291   }
0292 
0293   bool IsTailCall() const { return is_tail_call; }
0294 
0295   /// Get the call site parameters available at this call edge.
0296   llvm::ArrayRef<CallSiteParameter> GetCallSiteParameters() const {
0297     return parameters;
0298   }
0299 
0300   /// Non-tail-calls go first, sorted by the return address. They are followed
0301   /// by tail calls, which have no specific order.
0302   std::pair<bool, lldb::addr_t> GetSortKey() const {
0303     return {is_tail_call, GetUnresolvedReturnPCAddress()};
0304   }
0305 
0306 protected:
0307   CallEdge(AddrType caller_address_type, lldb::addr_t caller_address,
0308            bool is_tail_call, CallSiteParameterArray &&parameters);
0309 
0310   /// Helper that finds the load address of \p unresolved_pc, a file address
0311   /// which refers to an instruction within \p caller.
0312   static lldb::addr_t GetLoadAddress(lldb::addr_t unresolved_pc,
0313                                      Function &caller, Target &target);
0314 
0315   /// Like \ref GetReturnPCAddress, but returns an unresolved file address.
0316   lldb::addr_t GetUnresolvedReturnPCAddress() const {
0317     return caller_address_type == AddrType::AfterCall && !is_tail_call
0318                ? caller_address
0319                : LLDB_INVALID_ADDRESS;
0320   }
0321 
0322 private:
0323   lldb::addr_t caller_address;
0324   AddrType caller_address_type;
0325   bool is_tail_call;
0326 
0327   CallSiteParameterArray parameters;
0328 };
0329 
0330 /// A direct call site. Used to represent call sites where the address of the
0331 /// callee is fixed (e.g. a function call in C in which the call target is not
0332 /// a function pointer).
0333 class DirectCallEdge : public CallEdge {
0334 public:
0335   /// Construct a call edge using a symbol name to identify the callee, and a
0336   /// return PC within the calling function to identify a specific call site.
0337   DirectCallEdge(const char *symbol_name, AddrType caller_address_type,
0338                  lldb::addr_t caller_address, bool is_tail_call,
0339                  CallSiteParameterArray &&parameters);
0340 
0341   Function *GetCallee(ModuleList &images, ExecutionContext &exe_ctx) override;
0342 
0343 private:
0344   void ParseSymbolFileAndResolve(ModuleList &images);
0345 
0346   // Used to describe a direct call.
0347   //
0348   // Either the callee's mangled name or its definition, discriminated by
0349   // \ref resolved.
0350   union {
0351     const char *symbol_name;
0352     Function *def;
0353   } lazy_callee;
0354 
0355   /// Whether or not an attempt was made to find the callee's definition.
0356   bool resolved = false;
0357 };
0358 
0359 /// An indirect call site. Used to represent call sites where the address of
0360 /// the callee is not fixed, e.g. a call to a C++ virtual function (where the
0361 /// address is loaded out of a vtable), or a call to a function pointer in C.
0362 class IndirectCallEdge : public CallEdge {
0363 public:
0364   /// Construct a call edge using a DWARFExpression to identify the callee, and
0365   /// a return PC within the calling function to identify a specific call site.
0366   IndirectCallEdge(DWARFExpressionList call_target,
0367                    AddrType caller_address_type, lldb::addr_t caller_address,
0368                    bool is_tail_call, CallSiteParameterArray &&parameters);
0369 
0370   Function *GetCallee(ModuleList &images, ExecutionContext &exe_ctx) override;
0371 
0372 private:
0373   // Used to describe an indirect call.
0374   //
0375   // Specifies the location of the callee address in the calling frame.
0376   DWARFExpressionList call_target;
0377 };
0378 
0379 /// \class Function Function.h "lldb/Symbol/Function.h"
0380 /// A class that describes a function.
0381 ///
0382 /// Functions belong to CompileUnit objects (Function::m_comp_unit), have
0383 /// unique user IDs (Function::UserID), know how to reconstruct their symbol
0384 /// context (Function::SymbolContextScope), have a specific function type
0385 /// (Function::m_type_uid), have a simple method name (FunctionInfo::m_name),
0386 /// be declared at a specific location (FunctionInfo::m_declaration), possibly
0387 /// have mangled names (Function::m_mangled), an optional return type
0388 /// (Function::m_type), and contains lexical blocks (Function::m_blocks).
0389 ///
0390 /// The function information is split into a few pieces:
0391 ///     \li The concrete instance information
0392 ///     \li The abstract information
0393 ///
0394 /// The abstract information is found in the function type (Type) that
0395 /// describes a function information, return type and parameter types.
0396 ///
0397 /// The concrete information is the address range information and specific
0398 /// locations for an instance of this function.
0399 class Function : public UserID, public SymbolContextScope {
0400 public:
0401   /// Construct with a compile unit, function UID, function type UID, optional
0402   /// mangled name, function type, and a section offset based address range.
0403   ///
0404   /// \param[in] comp_unit
0405   ///     The compile unit to which this function belongs.
0406   ///
0407   /// \param[in] func_uid
0408   ///     The UID for this function. This value is provided by the
0409   ///     SymbolFile plug-in and can be any value that allows
0410   ///     the plug-in to quickly find and parse more detailed
0411   ///     information when and if more information is needed.
0412   ///
0413   /// \param[in] func_type_uid
0414   ///     The type UID for the function Type to allow for lazy type
0415   ///     parsing from the debug information.
0416   ///
0417   /// \param[in] mangled
0418   ///     The optional mangled name for this function. If empty, there
0419   ///     is no mangled information.
0420   ///
0421   /// \param[in] func_type
0422   ///     The optional function type. If NULL, the function type will
0423   ///     be parsed on demand when accessed using the
0424   ///     Function::GetType() function by asking the SymbolFile
0425   ///     plug-in to get the type for \a func_type_uid.
0426   ///
0427   /// \param[in] range
0428   ///     The section offset based address for this function.
0429   Function(CompileUnit *comp_unit, lldb::user_id_t func_uid,
0430            lldb::user_id_t func_type_uid, const Mangled &mangled,
0431            Type *func_type, Address address, AddressRanges ranges);
0432 
0433   /// Destructor.
0434   ~Function() override;
0435 
0436   /// \copydoc SymbolContextScope::CalculateSymbolContext(SymbolContext*)
0437   ///
0438   /// \see SymbolContextScope
0439   void CalculateSymbolContext(SymbolContext *sc) override;
0440 
0441   lldb::ModuleSP CalculateSymbolContextModule() override;
0442 
0443   CompileUnit *CalculateSymbolContextCompileUnit() override;
0444 
0445   Function *CalculateSymbolContextFunction() override;
0446 
0447   /// DEPRECATED: Use GetAddressRanges instead.
0448   const AddressRange &GetAddressRange() { return m_range; }
0449 
0450   AddressRanges GetAddressRanges() { return m_block.GetRanges(); }
0451 
0452   /// Return the address of the function (its entry point). This address is also
0453   /// used as a base address for relocation of function-scope entities (blocks
0454   /// and variables).
0455   const Address &GetAddress() const { return m_address; }
0456 
0457   bool GetRangeContainingLoadAddress(lldb::addr_t load_addr, Target &target,
0458                                      AddressRange &range) {
0459     return m_block.GetRangeContainingLoadAddress(load_addr, target, range);
0460   }
0461 
0462   lldb::LanguageType GetLanguage() const;
0463   /// Find the file and line number of the source location of the start of the
0464   /// function.  This will use the declaration if present and fall back on the
0465   /// line table if that fails.  So there may NOT be a line table entry for
0466   /// this source file/line combo.
0467   ///
0468   /// \param[out] source_file
0469   ///     The source file.
0470   ///
0471   /// \param[out] line_no
0472   ///     The line number.
0473   void GetStartLineSourceInfo(lldb::SupportFileSP &source_file_sp,
0474                               uint32_t &line_no);
0475 
0476   /// Find the file and line number of the source location of the end of the
0477   /// function.
0478   ///
0479   ///
0480   /// \param[out] source_file
0481   ///     The source file.
0482   ///
0483   /// \param[out] line_no
0484   ///     The line number.
0485   void GetEndLineSourceInfo(FileSpec &source_file, uint32_t &line_no);
0486 
0487   /// Get the outgoing call edges from this function, sorted by their return
0488   /// PC addresses (in increasing order).
0489   llvm::ArrayRef<std::unique_ptr<CallEdge>> GetCallEdges();
0490 
0491   /// Get the outgoing tail-calling edges from this function. If none exist,
0492   /// return std::nullopt.
0493   llvm::ArrayRef<std::unique_ptr<CallEdge>> GetTailCallingEdges();
0494 
0495   /// Get the outgoing call edge from this function which has the given return
0496   /// address \p return_pc, or return nullptr. Note that this will not return a
0497   /// tail-calling edge.
0498   CallEdge *GetCallEdgeForReturnAddress(lldb::addr_t return_pc, Target &target);
0499 
0500   /// Get accessor for the block list.
0501   ///
0502   /// \return
0503   ///     The block list object that describes all lexical blocks
0504   ///     in the function.
0505   ///
0506   /// \see BlockList
0507   Block &GetBlock(bool can_create);
0508 
0509   /// Get accessor for the compile unit that owns this function.
0510   ///
0511   /// \return
0512   ///     A compile unit object pointer.
0513   CompileUnit *GetCompileUnit();
0514 
0515   /// Get const accessor for the compile unit that owns this function.
0516   ///
0517   /// \return
0518   ///     A const compile unit object pointer.
0519   const CompileUnit *GetCompileUnit() const;
0520 
0521   void GetDescription(Stream *s, lldb::DescriptionLevel level, Target *target);
0522 
0523   /// Get accessor for the frame base location.
0524   ///
0525   /// \return
0526   ///     A location expression that describes the function frame
0527   ///     base.
0528   DWARFExpressionList &GetFrameBaseExpression() { return m_frame_base; }
0529 
0530   /// Get const accessor for the frame base location.
0531   ///
0532   /// \return
0533   ///     A const compile unit object pointer.
0534   const DWARFExpressionList &GetFrameBaseExpression() const { return m_frame_base; }
0535 
0536   ConstString GetName() const;
0537 
0538   ConstString GetNameNoArguments() const;
0539 
0540   ConstString GetDisplayName() const;
0541 
0542   const Mangled &GetMangled() const { return m_mangled; }
0543 
0544   /// Get the DeclContext for this function, if available.
0545   ///
0546   /// \return
0547   ///     The DeclContext, or NULL if none exists.
0548   CompilerDeclContext GetDeclContext();
0549 
0550   /// Get the CompilerContext for this function, if available.
0551   ///
0552   /// \return
0553   ///     The CompilerContext, or an empty vector if none is available.
0554   std::vector<CompilerContext> GetCompilerContext();
0555 
0556   /// Get accessor for the type that describes the function return value type,
0557   /// and parameter types.
0558   ///
0559   /// \return
0560   ///     A type object pointer.
0561   Type *GetType();
0562 
0563   /// Get const accessor for the type that describes the function return value
0564   /// type, and parameter types.
0565   ///
0566   /// \return
0567   ///     A const type object pointer.
0568   const Type *GetType() const;
0569 
0570   CompilerType GetCompilerType();
0571 
0572   /// Get the size of the prologue instructions for this function.  The
0573   /// "prologue" instructions include any instructions given line number 0
0574   /// immediately following the prologue end.
0575   ///
0576   /// \return
0577   ///     The size of the prologue.
0578   uint32_t GetPrologueByteSize();
0579 
0580   /// Dump a description of this object to a Stream.
0581   ///
0582   /// Dump a description of the contents of this object to the supplied stream
0583   /// \a s.
0584   ///
0585   /// \param[in] s
0586   ///     The stream to which to dump the object description.
0587   ///
0588   /// \param[in] show_context
0589   ///     If \b true, variables will dump their symbol context
0590   ///     information.
0591   void Dump(Stream *s, bool show_context) const;
0592 
0593   /// \copydoc SymbolContextScope::DumpSymbolContext(Stream*)
0594   ///
0595   /// \see SymbolContextScope
0596   void DumpSymbolContext(Stream *s) override;
0597 
0598   /// Get the memory cost of this object.
0599   ///
0600   /// \return
0601   ///     The number of bytes that this object occupies in memory.
0602   ///     The returned value does not include the bytes for any
0603   ///     shared string values.
0604   size_t MemorySize() const;
0605 
0606   /// Get whether compiler optimizations were enabled for this function
0607   ///
0608   /// The debug information may provide information about whether this
0609   /// function was compiled with optimization or not.  In this case,
0610   /// "optimized" means that the debug experience may be difficult for the
0611   /// user to understand.  Variables may not be available when the developer
0612   /// would expect them, stepping through the source lines in the function may
0613   /// appear strange, etc.
0614   ///
0615   /// \return
0616   ///     Returns 'true' if this function was compiled with
0617   ///     optimization.  'false' indicates that either the optimization
0618   ///     is unknown, or this function was built without optimization.
0619   bool GetIsOptimized();
0620 
0621   /// Get whether this function represents a 'top-level' function
0622   ///
0623   /// The concept of a top-level function is language-specific, mostly meant
0624   /// to represent the notion of scripting-style code that has global
0625   /// visibility of the variables/symbols/functions/... defined within the
0626   /// containing file/module
0627   ///
0628   /// If stopped in a top-level function, LLDB will expose global variables
0629   /// as-if locals in the 'frame variable' command
0630   ///
0631   /// \return
0632   ///     Returns 'true' if this function is a top-level function,
0633   ///     'false' otherwise.
0634   bool IsTopLevelFunction();
0635 
0636   lldb::DisassemblerSP GetInstructions(const ExecutionContext &exe_ctx,
0637                                        const char *flavor,
0638                                        bool force_live_memory = false);
0639 
0640   bool GetDisassembly(const ExecutionContext &exe_ctx, const char *flavor,
0641                       Stream &strm, bool force_live_memory = false);
0642 
0643 protected:
0644   enum {
0645     /// Whether we already tried to calculate the prologue size.
0646     flagsCalculatedPrologueSize = (1 << 0)
0647   };
0648 
0649   /// The compile unit that owns this function.
0650   CompileUnit *m_comp_unit;
0651 
0652   /// The user ID of for the prototype Type for this function.
0653   lldb::user_id_t m_type_uid;
0654 
0655   /// The function prototype type for this function that includes the function
0656   /// info (FunctionInfo), return type and parameters.
0657   Type *m_type;
0658 
0659   /// The mangled function name if any. If empty, there is no mangled
0660   /// information.
0661   Mangled m_mangled;
0662 
0663   /// All lexical blocks contained in this function.
0664   Block m_block;
0665 
0666   /// The function address range that covers the widest range needed to contain
0667   /// all blocks. DEPRECATED: do not use this field in new code as the range may
0668   /// include addresses belonging to other functions.
0669   AddressRange m_range;
0670 
0671   /// The address (entry point) of the function.
0672   Address m_address;
0673 
0674   /// The frame base expression for variables that are relative to the frame
0675   /// pointer.
0676   DWARFExpressionList m_frame_base;
0677 
0678   Flags m_flags;
0679 
0680   /// Compute the prologue size once and cache it.
0681   uint32_t m_prologue_byte_size;
0682 
0683   /// Exclusive lock that controls read/write access to m_call_edges and
0684   /// m_call_edges_resolved.
0685   std::mutex m_call_edges_lock;
0686 
0687   /// Whether call site info has been parsed.
0688   bool m_call_edges_resolved = false;
0689 
0690   /// Outgoing call edges.
0691   std::vector<std::unique_ptr<CallEdge>> m_call_edges;
0692 
0693 private:
0694   Function(const Function &) = delete;
0695   const Function &operator=(const Function &) = delete;
0696 };
0697 
0698 } // namespace lldb_private
0699 
0700 #endif // LLDB_SYMBOL_FUNCTION_H