class ApplyDebugLocation

Declaration

class ApplyDebugLocation { /* full declaration omitted */ };

Description

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

Declared at: clang/lib/CodeGen/CGDebugInfo.h:798

Member Variables

private llvm::DebugLoc OriginalLocation
private clang::CodeGen::CodeGenFunction* CGF

Method Overview

  • private ApplyDebugLocation(clang::CodeGen::CodeGenFunction & CGF, bool DefaultToEmpty, clang::SourceLocation TemporaryLocation)
  • public ApplyDebugLocation(clang::CodeGen::CodeGenFunction & CGF, clang::SourceLocation TemporaryLocation)
  • public ApplyDebugLocation(clang::CodeGen::CodeGenFunction & CGF, const clang::Expr * E)
  • public ApplyDebugLocation(clang::CodeGen::CodeGenFunction & CGF, llvm::DebugLoc Loc)
  • public ApplyDebugLocation(clang::CodeGen::ApplyDebugLocation && Other)
  • public static clang::CodeGen::ApplyDebugLocation CreateArtificial(clang::CodeGen::CodeGenFunction & CGF)
  • public static clang::CodeGen::ApplyDebugLocation CreateDefaultArtificial(clang::CodeGen::CodeGenFunction & CGF, clang::SourceLocation TemporaryLocation)
  • public static clang::CodeGen::ApplyDebugLocation CreateEmpty(clang::CodeGen::CodeGenFunction & CGF)
  • private void init(clang::SourceLocation TemporaryLocation, bool DefaultToEmpty = false)
  • public ~ApplyDebugLocation()

Methods

ApplyDebugLocation(
    clang::CodeGen::CodeGenFunction& CGF,
    bool DefaultToEmpty,
    clang::SourceLocation TemporaryLocation)

Declared at: clang/lib/CodeGen/CGDebugInfo.h:801

Parameters

clang::CodeGen::CodeGenFunction& CGF
bool DefaultToEmpty
clang::SourceLocation TemporaryLocation

ApplyDebugLocation(
    clang::CodeGen::CodeGenFunction& CGF,
    clang::SourceLocation TemporaryLocation)

Description

Set the location to the (valid) TemporaryLocation.

Declared at: clang/lib/CodeGen/CGDebugInfo.h:809

Parameters

clang::CodeGen::CodeGenFunction& CGF
clang::SourceLocation TemporaryLocation

ApplyDebugLocation(
    clang::CodeGen::CodeGenFunction& CGF,
    const clang::Expr* E)

Declared at: clang/lib/CodeGen/CGDebugInfo.h:810

Parameters

clang::CodeGen::CodeGenFunction& CGF
const clang::Expr* E

ApplyDebugLocation(
    clang::CodeGen::CodeGenFunction& CGF,
    llvm::DebugLoc Loc)

Declared at: clang/lib/CodeGen/CGDebugInfo.h:811

Parameters

clang::CodeGen::CodeGenFunction& CGF
llvm::DebugLoc Loc

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

Declared at: clang/lib/CodeGen/CGDebugInfo.h:812

Parameters

clang::CodeGen::ApplyDebugLocation&& Other

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

Description

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.

Declared at: clang/lib/CodeGen/CGDebugInfo.h:830

Parameters

clang::CodeGen::CodeGenFunction& CGF

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

Description

Apply TemporaryLocation if it is valid. Otherwise switch to an artificial debug location that has a valid scope, but no line information.

Declared at: clang/lib/CodeGen/CGDebugInfo.h:837

Parameters

clang::CodeGen::CodeGenFunction& CGF
clang::SourceLocation TemporaryLocation

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

Description

Set the IRBuilder to not attach debug locations. Note that passing an empty SourceLocation to \a CGDebugInfo::setLocation() will result in the last valid location being reused. Note that all instructions that do not have a location at the beginning of a function are counted towards to function prologue.

Declared at: clang/lib/CodeGen/CGDebugInfo.h:847

Parameters

clang::CodeGen::CodeGenFunction& CGF

void init(clang::SourceLocation TemporaryLocation,
          bool DefaultToEmpty = false)

Declared at: clang/lib/CodeGen/CGDebugInfo.h:800

Parameters

clang::SourceLocation TemporaryLocation
bool DefaultToEmpty = false

~ApplyDebugLocation()

Declared at: clang/lib/CodeGen/CGDebugInfo.h:817