LLVM 22.0.0git
Classes | Namespaces | Macros | Typedefs | Functions | Variables
DebugInfoMetadata.cpp File Reference
#include "llvm/IR/DebugInfoMetadata.h"
#include "LLVMContextImpl.h"
#include "MetadataImpl.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/IR/DebugProgramInstruction.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Value.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Compiler.h"
#include <numeric>
#include <optional>
#include "llvm/IR/DebugInfoFlags.def"

Go to the source code of this file.

Classes

struct  EqualScopesMatcher
 
struct  ScopeLocationsMatcher
 

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 

Macros

#define HANDLE_DI_FLAG(ID, NAME)   .Case("DIFlag" #NAME, Flag##NAME)
 
#define HANDLE_DI_FLAG(ID, NAME)
 
#define HANDLE_DI_FLAG(ID, NAME)
 
#define UNWRAP_ARGS_IMPL(...)   __VA_ARGS__
 
#define UNWRAP_ARGS(ARGS)   UNWRAP_ARGS_IMPL ARGS
 
#define DEFINE_GETIMPL_LOOKUP(CLASS, ARGS)
 
#define DEFINE_GETIMPL_STORE(CLASS, ARGS, OPS)
 
#define DEFINE_GETIMPL_STORE_NO_OPS(CLASS, ARGS)
 
#define DEFINE_GETIMPL_STORE_NO_CONSTRUCTOR_ARGS(CLASS, OPS)
 
#define DEFINE_GETIMPL_STORE_N(CLASS, ARGS, OPS, NUM_OPS)
 
#define HANDLE_DISP_FLAG(ID, NAME)   .Case("DISPFlag" #NAME, SPFlag##NAME)
 
#define HANDLE_DISP_FLAG(ID, NAME)
 
#define HANDLE_DISP_FLAG(ID, NAME)
 

Typedefs

using LineColumn = std::pair< unsigned, unsigned >
 

Functions

cl::opt< boolllvm::EnableFSDiscriminator ("enable-fs-discriminator", cl::Hidden, cl::desc("Enable adding flow sensitive discriminators"))
 
LLVM_ABI cl::opt< boolllvm::PickMergedSourceLocations ("pick-merged-source-locations", cl::init(false), cl::Hidden, cl::desc("Preserve line and column number when merging locations."))
 
static void adjustColumn (unsigned &Column)
 
static DILexicalBlockBasecloneAndReplaceParentScope (DILexicalBlockBase *LBB, DIScope *NewParent)
 
static LineColumn getLocalScopeLocationOr (DIScope *S, LineColumn Default)
 Returns the location of DILocalScope, if present, or a default value.
 
template<typename MatcherT >
static std::pair< DIScope *, LineColumngetNearestMatchingScope (const DILocation *L1, const DILocation *L2)
 
static bool isCanonical (const MDString *S)
 

Variables

static const charChecksumKindName [DIFile::CSK_Last]
 

Macro Definition Documentation

◆ DEFINE_GETIMPL_LOOKUP

#define DEFINE_GETIMPL_LOOKUP (   CLASS,
  ARGS 
)
Value:
do { \
if (Storage == Uniqued) { \
if (auto *N = getUniqued(Context.pImpl->CLASS##s, \
CLASS##Info::KeyTy(UNWRAP_ARGS(ARGS)))) \
return N; \
if (!ShouldCreate) \
return nullptr; \
} else { \
assert(ShouldCreate && \
"Expected non-uniqued nodes to always be created"); \
} \
} while (false)
#define UNWRAP_ARGS(ARGS)
static T * getUniqued(DenseSet< T *, InfoT > &Store, const typename InfoT::KeyTy &Key)
Definition: MetadataImpl.h:22
#define N

Definition at line 587 of file DebugInfoMetadata.cpp.

◆ DEFINE_GETIMPL_STORE

#define DEFINE_GETIMPL_STORE (   CLASS,
  ARGS,
  OPS 
)
Value:
return storeImpl(new (std::size(OPS), Storage) \
CLASS(Context, Storage, UNWRAP_ARGS(ARGS), OPS), \
Storage, Context.pImpl->CLASS##s)

Definition at line 600 of file DebugInfoMetadata.cpp.

◆ DEFINE_GETIMPL_STORE_N

#define DEFINE_GETIMPL_STORE_N (   CLASS,
  ARGS,
  OPS,
  NUM_OPS 
)
Value:
return storeImpl(new (NUM_OPS, Storage) \
CLASS(Context, Storage, UNWRAP_ARGS(ARGS), OPS), \
Storage, Context.pImpl->CLASS##s)

Definition at line 611 of file DebugInfoMetadata.cpp.

◆ DEFINE_GETIMPL_STORE_NO_CONSTRUCTOR_ARGS

#define DEFINE_GETIMPL_STORE_NO_CONSTRUCTOR_ARGS (   CLASS,
  OPS 
)
Value:
return storeImpl(new (std::size(OPS), Storage) CLASS(Context, Storage, OPS), \
Storage, Context.pImpl->CLASS##s)

Definition at line 608 of file DebugInfoMetadata.cpp.

◆ DEFINE_GETIMPL_STORE_NO_OPS

#define DEFINE_GETIMPL_STORE_NO_OPS (   CLASS,
  ARGS 
)
Value:
return storeImpl(new (0u, Storage) \
CLASS(Context, Storage, UNWRAP_ARGS(ARGS)), \
Storage, Context.pImpl->CLASS##s)

Definition at line 604 of file DebugInfoMetadata.cpp.

◆ HANDLE_DI_FLAG [1/3]

#define HANDLE_DI_FLAG (   ID,
  NAME 
)    .Case("DIFlag" #NAME, Flag##NAME)

◆ HANDLE_DI_FLAG [2/3]

#define HANDLE_DI_FLAG (   ID,
  NAME 
)
Value:
case Flag##NAME: \
return "DIFlag" #NAME;

◆ HANDLE_DI_FLAG [3/3]

#define HANDLE_DI_FLAG (   ID,
  NAME 
)
Value:
if (DIFlags Bit = Flags & Flag##NAME) { \
SplitFlags.push_back(Bit); \
Flags &= ~Bit; \
}

◆ HANDLE_DISP_FLAG [1/3]

#define HANDLE_DISP_FLAG (   ID,
  NAME 
)    .Case("DISPFlag" #NAME, SPFlag##NAME)

◆ HANDLE_DISP_FLAG [2/3]

#define HANDLE_DISP_FLAG (   ID,
  NAME 
)
Value:
case SPFlag##NAME: \
return "DISPFlag" #NAME;

◆ HANDLE_DISP_FLAG [3/3]

#define HANDLE_DISP_FLAG (   ID,
  NAME 
)
Value:
if (DISPFlags Bit = Flags & SPFlag##NAME) { \
SplitFlags.push_back(Bit); \
Flags &= ~Bit; \
}

◆ UNWRAP_ARGS

#define UNWRAP_ARGS (   ARGS)    UNWRAP_ARGS_IMPL ARGS

Definition at line 586 of file DebugInfoMetadata.cpp.

◆ UNWRAP_ARGS_IMPL

#define UNWRAP_ARGS_IMPL (   ...)    __VA_ARGS__

Definition at line 585 of file DebugInfoMetadata.cpp.

Typedef Documentation

◆ LineColumn

using LineColumn = std::pair<unsigned , unsigned >

Definition at line 135 of file DebugInfoMetadata.cpp.

Function Documentation

◆ adjustColumn()

static void adjustColumn ( unsigned Column)
static

Definition at line 77 of file DebugInfoMetadata.cpp.

◆ cloneAndReplaceParentScope()

static DILexicalBlockBase * cloneAndReplaceParentScope ( DILexicalBlockBase LBB,
DIScope NewParent 
)
static

◆ getLocalScopeLocationOr()

static LineColumn getLocalScopeLocationOr ( DIScope S,
LineColumn  Default 
)
static

Returns the location of DILocalScope, if present, or a default value.

Definition at line 138 of file DebugInfoMetadata.cpp.

References assert(), llvm::Default, and llvm_unreachable.

Referenced by getNearestMatchingScope().

◆ getNearestMatchingScope()

template<typename MatcherT >
static std::pair< DIScope *, LineColumn > getNearestMatchingScope ( const DILocation L1,
const DILocation L2 
)
static

Definition at line 154 of file DebugInfoMetadata.cpp.

References getLocalScopeLocationOr(), llvm::DIScope::getScope(), and S1.

◆ isCanonical()

static bool isCanonical ( const MDString S)
static

Variable Documentation

◆ ChecksumKindName

const char* ChecksumKindName[DIFile::CSK_Last]
static
Initial value:
= {
"CSK_MD5",
"CSK_SHA1",
"CSK_SHA256",
}

Definition at line 1145 of file DebugInfoMetadata.cpp.