record TSourceLocation

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TSourceLocation = record

Description

Identifies a specific source location within a translation unit.

Overview

Methods

class operator Equal(const ALeft, ARight: TSourceLocation): Boolean; inline; static;
class operator NotEqual(const ALeft, ARight: TSourceLocation): Boolean; inline; static;
class function Null: TSourceLocation; inline; static;
procedure GetExpansionLocation(out AFile: TFile; out ALine, AColumn, AOffset: Integer); inline;
procedure GetPresumedLocation(out AFilename: String; out ALine, AColumn: Integer); inline;
procedure GetSpellingLocation(out AFile: TFile; out ALine, AColumn, AOffset: Integer); inline;
procedure GetFileLocation(out AFile: TFile; out ALine, AColumn, AOffset: Integer); inline;

Properties

property IsInSystemHeader: Boolean read GetIsInSystemHeader;
property IsFromMainFile: Boolean read GetIsFromMainFile;
property Handle: TCXSourceLocation read FHandle;

Description

Methods

class operator Equal(const ALeft, ARight: TSourceLocation): Boolean; inline; static;

Equality operators. Determine whether two source locations, which must refer into the same translation unit, refer to exactly the same point in the source code.

class operator NotEqual(const ALeft, ARight: TSourceLocation): Boolean; inline; static;
 
class function Null: TSourceLocation; inline; static;

A Null (invalid) source location

procedure GetExpansionLocation(out AFile: TFile; out ALine, AColumn, AOffset: Integer); inline;

Retrieve the file, line, column, and offset represented by the source location.

If the location refers into a macro expansion, retrieves the location of the macro expansion.

Parameters
AFile
will be set to the file to which the given source location points.
ALine
will be set to the line to which the given source location points.
AColumn
will be set to the column to which the given source location points.
AOffset
will be set to the offset into the buffer to which the given source location points.
procedure GetPresumedLocation(out AFilename: String; out ALine, AColumn: Integer); inline;

Retrieve the file, line and column represented by the source location, as specified in a #line directive.

Example: given the following source code in a file somefile.c

        #123 "dummy.c" 1

        static int func(void)
        {
            return 0;
        }
      

the location information returned by this function would be

File: dummy.c Line: 124 Column: 12

whereas GetExpansionLocation would have returned

File: somefile.c Line: 3 Column: 12

Parameters
AFilename
will be set to the filename of the source location. Note that filenames returned will be for "virtual" files, which don't necessarily exist on the machine running clang - e.g. when parsing preprocessed output obtained from a different environment. For an invalid source location, an empty string is returned.
ALine
will be set to the line number of the source location. For an invalid source location, zero is returned.
AColumn
will be set to the column number of the source location. For an invalid source location, zero is returned.
procedure GetSpellingLocation(out AFile: TFile; out ALine, AColumn, AOffset: Integer); inline;

Retrieve the file, line, column, and offset represented by the source location.

If the location refers into a macro instantiation, return where the location was originally spelled in the source file.

Parameters
AFile
will be set to the file to which the given source location points.
ALine
will be set to the line to which the given source location points.
AColumn
will be set to the column to which the given source location points.
AOffset
will be set to the offset into the buffer to which the given source location points.
procedure GetFileLocation(out AFile: TFile; out ALine, AColumn, AOffset: Integer); inline;

Retrieve the file, line, column, and offset represented by the source location.

If the location refers into a macro expansion, return where the macro was expanded or where the macro argument was written, if the location points at a macro argument.

Parameters
AFile
will be set to the file to which the given source location points.
ALine
will be set to the line to which the given source location points.
AColumn
will be set to the column to which the given source location points.
AOffset
will be set to the offset into the buffer to which the given source location points.

Properties

property IsInSystemHeader: Boolean read GetIsInSystemHeader;

Whether the source location is in a system header.

property IsFromMainFile: Boolean read GetIsFromMainFile;

Whether the source location is in the main file of the corresponding translation unit.

property Handle: TCXSourceLocation read FHandle;

Internal handle to C API


Generated by PasDocEx, based on PasDoc 0.14.0.