LLVM  mainline
Public Member Functions | Static Public Member Functions
llvm::DebugLoc Class Reference

A debug info location. More...

#include <DebugLoc.h>

List of all members.

Public Member Functions

 DebugLoc ()
 DebugLoc (DebugLoc &&X)
 DebugLoc (const DebugLoc &X)
DebugLocoperator= (DebugLoc &&X)
DebugLocoperator= (const DebugLoc &X)
 DebugLoc (const MDLocation *L)
 Construct from an MDLocation.
 DebugLoc (const MDNode *N)
 Construct from an MDNode.
 operator bool () const
 Check for null.
bool hasTrivialDestructor () const
 Check whether this has a trivial destructor.
unsigned getLine () const
unsigned getCol () const
MDNodegetScope () const
MDLocationgetInlinedAt () const
MDNodegetInlinedAtScope () const
 Get the fully inlined-at scope for a DebugLoc.
DebugLoc getFnDebugLoc () const
 Find the debug info location for the start of the function.
MDNodegetAsMDNode () const
 Return this as a bar MDNode.
bool operator== (const DebugLoc &DL) const
bool operator!= (const DebugLoc &DL) const
void dump () const
void print (raw_ostream &OS) const
 prints source location /path/to/file.exe:line:col @[inlined at]
MDLocationget () const
 Get the underlying MDLocation.
 operator MDLocation * () const
MDLocationoperator-> () const
MDLocationoperator* () const

Static Public Member Functions

static DebugLoc get (unsigned Line, unsigned Col, const MDNode *Scope, const MDNode *InlinedAt=nullptr)
 Create a new DebugLoc.

Detailed Description

A debug info location.

This class is a wrapper around a tracking reference to an MDLocation pointer.

To avoid extra includes, DebugLoc doubles the MDLocation API with a one based on relatively opaque MDNode pointers.

Definition at line 34 of file DebugLoc.h.


Constructor & Destructor Documentation

Definition at line 38 of file DebugLoc.h.

Referenced by dump(), get(), and getFnDebugLoc().

llvm::DebugLoc::DebugLoc ( DebugLoc &&  X) [inline]

Definition at line 39 of file DebugLoc.h.

Definition at line 40 of file DebugLoc.h.

Construct from an MDLocation.

Definition at line 19 of file DebugLoc.cpp.

DebugLoc::DebugLoc ( const MDNode N) [explicit]

Construct from an MDNode.

Note: if N is not an MDLocation, a verifier check will fail, and accessors will crash. However, construction from other nodes is supported in order to handle forward references when reading textual IR.

Definition at line 20 of file DebugLoc.cpp.


Member Function Documentation

void DebugLoc::dump ( ) const

Definition at line 70 of file DebugLoc.cpp.

References llvm::dbgs(), DebugLoc(), getCol(), getInlinedAt(), and getLine().

DebugLoc DebugLoc::get ( unsigned  Line,
unsigned  Col,
const MDNode Scope,
const MDNode InlinedAt = nullptr 
) [static]

Create a new DebugLoc.

Create a new DebugLoc at the specified line/col and scope/inline. This forwards to MDLocation::get().

If !Scope, returns a default-constructed DebugLoc.

FIXME: Remove this. Users should use MDLocation::get().

Definition at line 59 of file DebugLoc.cpp.

References DebugLoc(), get(), and llvm::MDNode::getContext().

MDNode* llvm::DebugLoc::getAsMDNode ( ) const [inline]

Return this as a bar MDNode.

Definition at line 113 of file DebugLoc.h.

Find the debug info location for the start of the function.

Walk up the scope chain of given debug loc and find line number info for the function.

FIXME: Remove this. Users should use MDLocation/MDLocalScope API to find the subprogram, and then MDLocation::get().

Definition at line 50 of file DebugLoc.cpp.

References DebugLoc(), get(), llvm::getDISubprogram(), getInlinedAtScope(), and llvm::SP.

Referenced by llvm::WinCodeViewLineTables::beginFunction().

Definition at line 41 of file DebugLoc.cpp.

Referenced by dump(), print(), and printDebugLoc().

Get the fully inlined-at scope for a DebugLoc.

Gets the inlined-at scope for a DebugLoc.

Definition at line 46 of file DebugLoc.cpp.

Referenced by llvm::getDISubprogram(), and getFnDebugLoc().

Check whether this has a trivial destructor.

Definition at line 80 of file DebugLoc.h.

References llvm::TypedTrackingMDRef< T >::hasTrivialDestructor().

Referenced by llvm::SDNode::SDNode(), and llvm::MachineInstr::setDebugLoc().

llvm::DebugLoc::operator bool ( ) const [inline, explicit]

Check for null.

Check for null in a way that is safe with broken debug info. Unlike the conversion to MDLocation, this doesn't require that Loc is of the right type. Important for cases like llvm::StripDebugInfo() and Instruction::hasMetadata().

Definition at line 77 of file DebugLoc.h.

llvm::DebugLoc::operator MDLocation * ( ) const [inline]

Definition at line 66 of file DebugLoc.h.

bool llvm::DebugLoc::operator!= ( const DebugLoc DL) const [inline]

Definition at line 116 of file DebugLoc.h.

MDLocation& llvm::DebugLoc::operator* ( ) const [inline]

Definition at line 68 of file DebugLoc.h.

MDLocation* llvm::DebugLoc::operator-> ( ) const [inline]

Definition at line 67 of file DebugLoc.h.

DebugLoc& llvm::DebugLoc::operator= ( DebugLoc &&  X) [inline]

Definition at line 41 of file DebugLoc.h.

References X.

DebugLoc& llvm::DebugLoc::operator= ( const DebugLoc X) [inline]

Definition at line 45 of file DebugLoc.h.

bool llvm::DebugLoc::operator== ( const DebugLoc DL) const [inline]

Definition at line 115 of file DebugLoc.h.

void DebugLoc::print ( raw_ostream OS) const

prints source location /path/to/file.exe:line:col @[inlined at]

Definition at line 86 of file DebugLoc.cpp.

References getCol(), getInlinedAt(), getLine(), and getScope().

Referenced by llvm::MachineInstr::print().


The documentation for this class was generated from the following files: