File_Contents¶
- class File_Contents (concrete, physical)¶
“variants” of a file - different versions of the file’s body parent always points to a file node children can be empty, if contents form a part of a statement, etc. or if this represents an irregular include
- Implemented interfaces:
implements End_Information
implements Declaration_Container
- Direct parents:
inherits Toplevel_Node
- Ancestor classes and implemented interfaces:
Declaration_Container, End_Information, Operation_Container, Physical_IR_Root, Toplevel_Node
Field
Kind
Type
Description
Parent (from Physical_IR_Root)
semantic
class File
Scope
semantic to logical
class Symbol
Points to the scope that contains this file. For example, if the include directive including this file was surrounded by a namespace definition, this edge points to that namespace. For usual includes at top-level, this attribute will point to the Global_Scope. For (irregular) includes in unusual places, this attribute may be
NoNode. ‘summary’ information on things not integrated syntactically:Irregular_Includes
syntactic
set of class Irregular_Include
Macro_Invocations
syntactic
list of class Macro_Use
Line_Directives
syntactic
list of class Line_Directive
in order of physical lines (source order)
Macros_In_Templates
syntactic
set of interface Named_Entity_Interface
macro definitions and
#undefsinside special blocks like templates (these are not syntactically integrated at the moment)Sorted_Includes
semantic
list of interface Include_Interface
all regular and irregular local includes sorted by physical line helps to extract the include graph and to determine linear lines
Irregular_Ifs
syntactic
list of class Irregular_Conditional_Compilation
plain collection of
#ifsthat could not be integrated syntacticallyNo_Bodies
attribute
builtin Boolean
Whether this file was affected by
--no_bodies_for_pathand thus has no bodies.No_Macros
attribute
builtin Boolean
Whether this file was affected by
--no_macros_for_pathand thus has no macro invocations or preprocessor#if.Preprocessor_Hash
attribute
builtin UInt64
A hash value that is computed from all the evaluated preprocessor conditions and macro expansions. This is used by the linker to determine whether two File_Contents from different units can be linked together. (the linker cannot look at Irregular_Ifs in case this unit was built with No_Macros)
C_Plus_Plus
attribute
builtin Boolean
Whether this file was compiled as C++ (or one of its variants such as C++/CLI). This attribute is used by the linker to keep C file contents separate from C++ file contents (necessary because expressions like
i < 10have a different type across languages)In_C_Linkage_Block
attribute
builtin Boolean
Whether this file lives inside an
extern "C"linkage block. Always true for files compiled as C. In C++, only true for headers for which the#includedirective is surrounded by anextern "C"block. This attribute is used by the linker to keep separate variants of a file that are included with different linkage.Cuda_Architecture
attribute
builtin Byte
If non-zero, the CUDA device architecture for which the file was compiled. E.g., a
__device__function compiled with-arch=compute_70has Cuda_Architecture=70. Host code has Cuda_Architecture=0. This attribute is used by the linker to keep separate the different device versions of a file. This helps avoid confusing cross-edges between PIR and LIR.Original_Position_Index (from Physical_IR_Root)
attribute
builtin SLoc_Index_Type
Internal source location info. If from macro expansion, this location is inside the macro body or macro argument
Original_Position (from Physical_IR_Root)
attribute
builtin SLoc
Source location. If from macro expansion, this location is inside the macro body or macro argument
Position (from Physical_IR_Root)
attribute
builtin SLoc
Source location. If from macro expansion, this location is that of the macro expansion
Artificial (from Physical_IR_Root)
attribute
builtin Boolean
Whether this node was compiler-generated
Parenthesized (from Physical_IR_Root)
attribute
builtin Boolean
Whether this node was enclosed in parentheses (used for expressions)
In_Template_Instance (from Physical_IR_Root)
attribute
builtin Boolean
Whether this node is inside a template instance
Enclosing_Template_Instance (from Physical_IR_Root)
semantic
class Physical_IR_Root
Innermost enclosing template instance if In_Template_Instance is true
Original_End_Position_Index (from End_Information)
attribute
builtin SLoc_Index_Type
Internal source location info of the end of the construct. If from macro expansion, this location is inside the macro body or macro argument
Original_End_Position (from End_Information)
attribute
builtin SLoc
Source location of the end of the construct. If from macro expansion, this location is inside the macro body or macro argument
End_Position (from End_Information)
attribute
builtin SLoc
Source location of the end of the construct. If from macro expansion, this location is that of the macro expansion
Children (from Operation_Container)
syntactic
set of class Physical_IR_Root