Skip to content

SagePreprocessorRecord

Synopsis

Declared in <Clang/clang-frontend-private.hpp>

class SagePreprocessorRecord
    : public clang::PPCallbacks
    , public clang::CommentHandler

Base Classes

Name Description
clang::PPCallbacks
clang::CommentHandler

Enums

Name
IncludeOwnership

Member Functions

Name Description
SagePreprocessorRecord
SagePreprocessorRecord( clang::SourceManager* source_manager, clang::Preprocessor* preprocessor, bool record_header_directives); [constructor]
~SagePreprocessorRecord
virtual ~SagePreprocessorRecord() override; [destructor] [virtual]
Destructor
Elif
virtual void Elif( clang::SourceLocation Loc, clang::SourceRange ConditionRange, clang::PPCallbacks::ConditionValueKind ConditionValue, clang::SourceLocation IfLoc) override; [virtual]
Elifdef
virtual void Elifdef( clang::SourceLocation Loc, clang::SourceRange ConditionRange, clang::SourceLocation IfLoc) override;
Elifndef
virtual void Elifndef( clang::SourceLocation Loc, clang::SourceRange ConditionRange, clang::SourceLocation IfLoc) override;
Else
virtual void Else( clang::SourceLocation Loc, clang::SourceLocation IfLoc) override; [virtual]
Endif
virtual void Endif( clang::SourceLocation Loc, clang::SourceLocation IfLoc) override; [virtual]
FileChanged
virtual void FileChanged( clang::SourceLocation Loc, FileChangeReason Reason, clang::SrcMgr::CharacteristicKind FileType, clang::FileID PrevFID) override; [virtual]
HandleComment
virtual bool HandleComment( clang::Preprocessor& PP, clang::SourceRange Comment) override; [virtual]
If
virtual void If( clang::SourceLocation Loc, clang::SourceRange ConditionRange, clang::PPCallbacks::ConditionValueKind ConditionValue) override; [virtual]
Ifdef
virtual void Ifdef( clang::SourceLocation Loc, clang::Token const& MacroNameTok, clang::MacroDefinition const& MD) override; [virtual]
Ifndef
virtual void Ifndef( clang::SourceLocation Loc, clang::Token const& MacroNameTok, clang::MacroDefinition const& MD) override; [virtual]
InclusionDirective
virtual void InclusionDirective( clang::SourceLocation HashLoc, clang::Token const& IncludeTok, llvm::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange, clang::OptionalFileEntryRef File, llvm::StringRef SearchPath, llvm::StringRef RelativePath, clang::Module const* SuggestedModule, bool ModuleImported, clang::SrcMgr::CharacteristicKind FileType) override; [virtual]
MacroDefined
virtual void MacroDefined( clang::Token const& MacroNameTok, clang::MacroDirective const* MD) override; [virtual]
MacroUndefined
virtual void MacroUndefined( clang::Token const& MacroNameTok, clang::MacroDefinition const& MD, clang::MacroDirective const* Undef) override; [virtual]
SourceRangeSkipped
virtual void SourceRangeSkipped( clang::SourceRange Range, clang::SourceLocation EndifLoc) override; [virtual]
consumeIncludeDirectiveInFlattenedSyntax
void consumeIncludeDirectiveInFlattenedSyntax( clang::SourceLocation include_location, SgLocatedNode* source_interval_owner, char const* contract);
containsConditionalDirective
bool containsConditionalDirective( clang::FileID file_id, unsigned int begin_offset, unsigned int end_offset) const;
getPhysicalFilename
std::string getPhysicalFilename(clang::FileEntryRef file) const;
includeDirectiveLocationsAtStartOrStrictlyInside
std::vector<clang::SourceLocation> includeDirectiveLocationsAtStartOrStrictlyInside(clang::SourceRange source_range) const;
includeDirectiveLocationsStrictlyInside
std::vector<clang::SourceLocation> includeDirectiveLocationsStrictlyInside(clang::SourceRange source_range) const;
includeOwnershipForLocation
IncludeOwnership includeOwnershipForLocation(clang::SourceLocation location) const;
includeOwnershipForPath
IncludeOwnership includeOwnershipForPath(std::string const& path) const;
isInsideConditionalRegion
bool isInsideConditionalRegion( clang::FileID file_id, unsigned int offset) const;
markAttached
void markAttached(PreprocessingInfo* preprocessing_info);
moduleImport
virtual void moduleImport( clang::SourceLocation ImportLoc, clang::ModuleIdPath Path, clang::Module const* Imported) override; [virtual]
pop
bool pop();
publishIncludeOwnership
void publishIncludeOwnership(SgSourceFile* source_file) const;
recordExternalOwnershipPath
void recordExternalOwnershipPath( std::string const& path, char const* context);
recordFrontendSupportOwnershipPath
void recordFrontendSupportOwnershipPath( std::string const& path, char const* context);
recordImportedModuleOwnership
void recordImportedModuleOwnership( clang::Module const* imported_module, char const* context);
recordSourceDirective
void recordSourceDirective( clang::SourceLocation loc, PreprocessingInfo::DirectiveType directive_type);
remainingRecords
std::vector<std::pair<Sg_File_Info*, PreprocessingInfo*>> remainingRecords() const;
requirePhysicalFileOccurrence
unsigned int requirePhysicalFileOccurrence( clang::FileID file_id, char const* context);
size
size_t size() const;
sortRecordedDirectives
void sortRecordedDirectives();
sourceRangeContainsSkippedTokens
bool sourceRangeContainsSkippedTokens(clang::SourceRange source_range) const;
top
std::pair<Sg_File_Info*, PreprocessingInfo*> top();
transferDirectivesToDeclarationGroupBoundary
void transferDirectivesToDeclarationGroupBoundary( clang::SourceRange source_range, SgDeclarationGroupStatement* declaration_group, SgDeclarationStatement* following_member);
transferDirectivesToDeclarationGroupTerminator
void transferDirectivesToDeclarationGroupTerminator( clang::SourceRange source_range, SgDeclarationGroupStatement* declaration_group, SgDeclarationStatement* final_member);
transferDirectivesToExternalEnumBoundaries
void transferDirectivesToExternalEnumBoundaries( clang::SourceRange source_range, SgEnumDeclaration* enum_declaration, std::vector<std::pair<clang::SourceLocation, SgInitializedName*>> const& source_body_enumerators);
transferDirectivesToFunctionBodyBoundary
void transferDirectivesToFunctionBodyBoundary( clang::SourceRange source_range, SgFunctionDeclaration* function_declaration, SgFunctionDefinition* function_definition);
transferIncludeDirectiveToAssignmentInitializer
void transferIncludeDirectiveToAssignmentInitializer( clang::SourceLocation include_location, SgAssignInitializer* assignment_initializer);
transferIncludeDirectiveToClassBoundary
void transferIncludeDirectiveToClassBoundary( clang::SourceLocation include_location, SgClassDefinition* class_definition, SgDeclarationStatement* following_member);
transferIncludeDirectiveToInitializerBoundary
void transferIncludeDirectiveToInitializerBoundary( clang::SourceLocation include_location, SgAggregateInitializer* aggregate_initializer, SgExpression* following_initializer_element);

Protected Types

Name
RecordedDirectiveLineKey
RecordedDirectiveLineKeyHash
RecordedDirectiveLineState
RecordedDirectiveLocationKey
RecordedDirectiveLocationKeyHash
RecordedDirectiveRef
RecordedDirectiveSourcePosition
SkippedFileRange

Protected Member Functions

Name
compactRemovedRecordedDirectives
void compactRemovedRecordedDirectives();
getFilenameForLocation
std::string getFilenameForLocation(clang::SourceLocation loc) const;
includeDirectiveLocationsWithin
std::vector<clang::SourceLocation> includeDirectiveLocationsWithin( clang::SourceRange source_range, bool allow_at_interval_start) const;
markRecordedDirectiveRemoved
void markRecordedDirectiveRemoved( Sg_File_Info* file_info, PreprocessingInfo* preprocessing_info);
recordDirective
PreprocessingInfo* recordDirective( clang::SourceLocation loc, PreprocessingInfo::DirectiveType directive_type, std::string const& text);
recordIncludeOwnershipPath
void recordIncludeOwnershipPath( std::string const& path, IncludeOwnership ownership, char const* context);
recordedDirectivesWithin
std::vector<RecordedDirectiveRef> recordedDirectivesWithin( clang::SourceRange source_range, bool allow_at_interval_start, char const* contract) const;
registerRecordedDirective
void registerRecordedDirective( Sg_File_Info* file_info, PreprocessingInfo* preprocessing_info, clang::SourceLocation file_location);
releaseRecordedDirective
void releaseRecordedDirective(std::pair<Sg_File_Info*, PreprocessingInfo*>& record);
shouldRecordDirective
bool shouldRecordDirective(clang::SourceLocation loc) const;
transferIncludeDirectiveToBoundary
void transferIncludeDirectiveToBoundary( clang::SourceLocation include_location, SgLocatedNode* source_interval_owner, SgLocatedNode* boundary_owner, PreprocessingInfo::RelativePositionType relative_position, bool allow_at_interval_start, char const* contract);
transferRecordedDirectiveToBoundary
void transferRecordedDirectiveToBoundary( RecordedDirectiveRef directive, SgLocatedNode* source_interval_owner, SgLocatedNode* boundary_owner, PreprocessingInfo::RelativePositionType relative_position, bool allow_at_interval_start, char const* contract);
unregisterRecordedDirective
void unregisterRecordedDirective( Sg_File_Info* file_info, PreprocessingInfo* preprocessing_info);

Protected Data Members

Name
p_attached_preprocessor_records
p_conditional_directives_by_file_offset
p_include_ownership_paths
p_include_records_by_file_offset
p_normalized_include_ownership_paths
p_normalized_physical_paths_by_file_id
p_pending_module_import_names
p_physical_occurrences_by_clang_file_id
p_preprocessor
p_preprocessor_record_cursor
p_preprocessor_record_list
p_preprocessor_record_list_sorted
p_preprocessor_record_positions
p_preprocessor_records_by_file_offset
p_preprocessor_records_by_line
p_preprocessor_records_by_location
p_record_header_directives
p_removed_preprocessor_records
p_resolved_include_directives
p_skipped_ranges
p_source_manager

Created with MrDocs