clang  6.0.0svn
Public Member Functions | Static Public Member Functions | List of all members
clang::CodeGen::ApplyDebugLocation Class Reference

A scoped helper to set the current debug location to the specified location or preferred location of the specified Expr. More...

#include "/opt/doxygen-docs/src/llvm/tools/clang/lib/CodeGen/CGDebugInfo.h"

Public Member Functions

 ApplyDebugLocation (CodeGenFunction &CGF, SourceLocation TemporaryLocation)
 Set the location to the (valid) TemporaryLocation. More...
 
 ApplyDebugLocation (CodeGenFunction &CGF, const Expr *E)
 
 ApplyDebugLocation (CodeGenFunction &CGF, llvm::DebugLoc Loc)
 
 ApplyDebugLocation (ApplyDebugLocation &&Other)
 
 ~ApplyDebugLocation ()
 

Static Public Member Functions

static ApplyDebugLocation CreateArtificial (CodeGenFunction &CGF)
 Apply TemporaryLocation if it is valid. More...
 
static ApplyDebugLocation CreateDefaultArtificial (CodeGenFunction &CGF, SourceLocation TemporaryLocation)
 Apply TemporaryLocation if it is valid. More...
 
static ApplyDebugLocation CreateEmpty (CodeGenFunction &CGF)
 Set the IRBuilder to not attach debug locations. More...
 

Detailed Description

A scoped helper to set the current debug location to the specified location or preferred location of the specified Expr.

Definition at line 620 of file CGDebugInfo.h.

Constructor & Destructor Documentation

◆ ApplyDebugLocation() [1/4]

ApplyDebugLocation::ApplyDebugLocation ( CodeGenFunction CGF,
SourceLocation  TemporaryLocation 
)

Set the location to the (valid) TemporaryLocation.

Definition at line 78 of file CGDebugInfo.cpp.

References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::getDebugInfo(), and clang::SourceLocation::isValid().

◆ ApplyDebugLocation() [2/4]

ApplyDebugLocation::ApplyDebugLocation ( CodeGenFunction CGF,
const Expr E 
)

Definition at line 120 of file CGDebugInfo.cpp.

◆ ApplyDebugLocation() [3/4]

ApplyDebugLocation::ApplyDebugLocation ( CodeGenFunction CGF,
llvm::DebugLoc  Loc 
)

◆ ApplyDebugLocation() [4/4]

clang::CodeGen::ApplyDebugLocation::ApplyDebugLocation ( ApplyDebugLocation &&  Other)
inline

Definition at line 634 of file CGDebugInfo.h.

◆ ~ApplyDebugLocation()

ApplyDebugLocation::~ApplyDebugLocation ( )

Definition at line 136 of file CGDebugInfo.cpp.

References clang::CodeGen::CodeGenFunction::Builder.

Member Function Documentation

◆ CreateArtificial()

static ApplyDebugLocation clang::CodeGen::ApplyDebugLocation::CreateArtificial ( CodeGenFunction CGF)
inlinestatic

Apply TemporaryLocation if it is valid.

Otherwise switch to an artificial debug location that has a valid scope, but no line information.

Artificial locations are useful when emitting compiler-generated helper functions that have no source location associated with them. The DWARF specification allows the compiler to use the special line number 0 to indicate code that can not be attributed to any source location. Note that passing an empty SourceLocation to CGDebugInfo::setLocation() will result in the last valid location being reused.

Definition at line 651 of file CGDebugInfo.h.

Referenced by emitCXXDestructor(), clang::CodeGen::CodeGenFunction::EmitFunctionInstrumentation(), clang::CodeGen::emitThreadPrivateVarDefinition(), clang::CodeGen::CodeGenFunction::GenerateCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateCXXGlobalDtorsFunc(), clang::CodeGen::CodeGenFunction::GenerateCXXGlobalInitFunc(), clang::CodeGen::CodeGenFunction::GenerateDestroyHelperFunction(), clang::CodeGen::CodeGenFunction::generateThunk(), and clang::CodeGen::CodeGenFunction::StartThunk().

◆ CreateDefaultArtificial()

static ApplyDebugLocation clang::CodeGen::ApplyDebugLocation::CreateDefaultArtificial ( CodeGenFunction CGF,
SourceLocation  TemporaryLocation 
)
inlinestatic

Apply TemporaryLocation if it is valid.

Otherwise switch to an artificial debug location that has a valid scope, but no line information.

Definition at line 658 of file CGDebugInfo.h.

Referenced by clang::CodeGen::CodeGenFunction::EmitAutoVarInit(), and clang::CodeGen::CGOpenMPRuntime::emitCall().

◆ CreateEmpty()

static ApplyDebugLocation clang::CodeGen::ApplyDebugLocation::CreateEmpty ( CodeGenFunction CGF)
inlinestatic

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