aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/include/llvm/IR/DIBuilder.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2023-04-14 21:41:27 +0000
committerDimitry Andric <dim@FreeBSD.org>2023-06-22 18:20:56 +0000
commitbdd1243df58e60e85101c09001d9812a789b6bc4 (patch)
treea1ce621c7301dd47ba2ddc3b8eaa63b441389481 /contrib/llvm-project/llvm/include/llvm/IR/DIBuilder.h
parent781624ca2d054430052c828ba8d2c2eaf2d733e7 (diff)
parente3b557809604d036af6e00c60f012c2025b59a5e (diff)
downloadsrc-bdd1243df58e60e85101c09001d9812a789b6bc4.tar.gz
src-bdd1243df58e60e85101c09001d9812a789b6bc4.zip
Merge llvm-project main llvmorg-16-init-18548-gb0daacf58f41
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-16-init-18548-gb0daacf58f41. PR: 271047 MFC after: 1 month
Diffstat (limited to 'contrib/llvm-project/llvm/include/llvm/IR/DIBuilder.h')
-rw-r--r--contrib/llvm-project/llvm/include/llvm/IR/DIBuilder.h59
1 files changed, 41 insertions, 18 deletions
diff --git a/contrib/llvm-project/llvm/include/llvm/IR/DIBuilder.h b/contrib/llvm-project/llvm/include/llvm/IR/DIBuilder.h
index 9afa715b650c..45b94044bc64 100644
--- a/contrib/llvm-project/llvm/include/llvm/IR/DIBuilder.h
+++ b/contrib/llvm-project/llvm/include/llvm/IR/DIBuilder.h
@@ -17,7 +17,6 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/MapVector.h"
-#include "llvm/ADT/Optional.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
@@ -27,6 +26,7 @@
#include "llvm/Support/Casting.h"
#include <algorithm>
#include <cstdint>
+#include <optional>
namespace llvm {
@@ -37,6 +37,7 @@ namespace llvm {
class LLVMContext;
class Module;
class Value;
+ class DbgAssignIntrinsic;
class DIBuilder {
Module &M;
@@ -47,8 +48,9 @@ namespace llvm {
Function *ValueFn; ///< llvm.dbg.value
Function *LabelFn; ///< llvm.dbg.label
Function *AddrFn; ///< llvm.dbg.addr
+ Function *AssignFn; ///< llvm.dbg.assign
- SmallVector<Metadata *, 4> AllEnumTypes;
+ SmallVector<TrackingMDNodeRef, 4> AllEnumTypes;
/// Track the RetainTypes, since they can be updated later on.
SmallVector<TrackingMDNodeRef, 4> AllRetainTypes;
SmallVector<Metadata *, 4> AllSubprograms;
@@ -171,10 +173,10 @@ namespace llvm {
/// \param Checksum Optional checksum kind (e.g. CSK_MD5, CSK_SHA1, etc.)
/// and value.
/// \param Source Optional source text.
- DIFile *
- createFile(StringRef Filename, StringRef Directory,
- Optional<DIFile::ChecksumInfo<StringRef>> Checksum = None,
- Optional<StringRef> Source = None);
+ DIFile *createFile(
+ StringRef Filename, StringRef Directory,
+ std::optional<DIFile::ChecksumInfo<StringRef>> Checksum = std::nullopt,
+ std::optional<StringRef> Source = std::nullopt);
/// Create debugging information entry for a macro.
/// \param Parent Macro parent (could be nullptr).
@@ -254,7 +256,7 @@ namespace llvm {
DIDerivedType *
createPointerType(DIType *PointeeTy, uint64_t SizeInBits,
uint32_t AlignInBits = 0,
- Optional<unsigned> DWARFAddressSpace = None,
+ std::optional<unsigned> DWARFAddressSpace = std::nullopt,
StringRef Name = "", DINodeArray Annotations = nullptr);
/// Create debugging information entry for a pointer to member.
@@ -269,11 +271,10 @@ namespace llvm {
/// Create debugging information entry for a c++
/// style reference or rvalue reference type.
- DIDerivedType *createReferenceType(unsigned Tag, DIType *RTy,
- uint64_t SizeInBits = 0,
- uint32_t AlignInBits = 0,
- Optional<unsigned> DWARFAddressSpace =
- None);
+ DIDerivedType *createReferenceType(
+ unsigned Tag, DIType *RTy, uint64_t SizeInBits = 0,
+ uint32_t AlignInBits = 0,
+ std::optional<unsigned> DWARFAddressSpace = std::nullopt);
/// Create debugging information entry for a typedef.
/// \param Ty Original type.
@@ -282,10 +283,12 @@ namespace llvm {
/// \param LineNo Line number.
/// \param Context The surrounding context for the typedef.
/// \param AlignInBits Alignment. (optional)
+ /// \param Flags Flags to describe inheritance attribute, e.g. private
/// \param Annotations Annotations. (optional)
DIDerivedType *createTypedef(DIType *Ty, StringRef Name, DIFile *File,
unsigned LineNo, DIScope *Context,
uint32_t AlignInBits = 0,
+ DINode::DIFlags Flags = DINode::FlagZero,
DINodeArray Annotations = nullptr);
/// Create debugging information entry for a 'friend'.
@@ -515,10 +518,10 @@ namespace llvm {
/// \param Name Value parameter name.
/// \param Ty Parameter type.
/// \param Val The fully qualified name of the template.
- DITemplateValueParameter *createTemplateTemplateParameter(DIScope *Scope,
- StringRef Name,
- DIType *Ty,
- StringRef Val);
+ /// \param IsDefault Parameter is default or not.
+ DITemplateValueParameter *
+ createTemplateTemplateParameter(DIScope *Scope, StringRef Name, DIType *Ty,
+ StringRef Val, bool IsDefault = false);
/// Create debugging information for a template parameter pack.
/// \param Scope Scope in which this type is defined.
@@ -683,7 +686,7 @@ namespace llvm {
DIGlobalVariable *createTempGlobalVariableFwdDecl(
DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *File,
unsigned LineNo, DIType *Ty, bool IsLocalToUnit, MDNode *Decl = nullptr,
- MDTuple *TemplateParams= nullptr, uint32_t AlignInBits = 0);
+ MDTuple *TemplateParams = nullptr, uint32_t AlignInBits = 0);
/// Create a new descriptor for an auto variable. This is a local variable
/// that is not a subprogram parameter.
@@ -728,7 +731,7 @@ namespace llvm {
/// Create a new descriptor for the specified
/// variable which has a complex address expression for its address.
/// \param Addr An array of complex address operations.
- DIExpression *createExpression(ArrayRef<uint64_t> Addr = None);
+ DIExpression *createExpression(ArrayRef<uint64_t> Addr = std::nullopt);
/// Create an expression for a variable that does not have an address, but
/// does have a constant value.
@@ -915,6 +918,26 @@ namespace llvm {
DIExpression *Expr, const DILocation *DL,
BasicBlock *InsertAtEnd);
+ /// Insert a new llvm.dbg.assign intrinsic call.
+ /// \param LinkedInstr Instruction with a DIAssignID to link with the new
+ /// intrinsic. The intrinsic will be inserted after
+ /// this instruction.
+ /// \param Val The value component of this dbg.assign.
+ /// \param SrcVar Variable's debug info descriptor.
+ /// \param ValExpr A complex location expression to modify \p Val.
+ /// \param Addr The address component (store destination).
+ /// \param AddrExpr A complex location expression to modify \p Addr.
+ /// NOTE: \p ValExpr carries the FragInfo for the
+ /// variable.
+ /// \param DL Debug info location, usually: (line: 0,
+ /// column: 0, scope: var-decl-scope). See
+ /// getDebugValueLoc.
+ DbgAssignIntrinsic *insertDbgAssign(Instruction *LinkedInstr, Value *Val,
+ DILocalVariable *SrcVar,
+ DIExpression *ValExpr, Value *Addr,
+ DIExpression *AddrExpr,
+ const DILocation *DL);
+
/// Insert a new llvm.dbg.declare intrinsic call.
/// \param Storage llvm::Value of the variable
/// \param VarInfo Variable's debug info descriptor.