clang 20.0.0git
Public Member Functions | List of all members
clang::InBeforeInTUCacheEntry Class Reference

Holds the cache used by isBeforeInTranslationUnit. More...

#include "clang/Basic/SourceManager.h"

Public Member Functions

 InBeforeInTUCacheEntry ()=default
 
 InBeforeInTUCacheEntry (FileID L, FileID R)
 
bool isCacheValid () const
 Return true if the currently cached values match up with the specified LHS/RHS query.
 
bool getCachedResult (unsigned LOffset, unsigned ROffset) const
 If the cache is valid, compute the result given the specified offsets in the LHS/RHS FileID's.
 
void setQueryFIDs (FileID LHS, FileID RHS)
 Set up a new query.
 
void setCommonLoc (FileID commonFID, unsigned lCommonOffset, unsigned rCommonOffset, bool LParentBeforeRParent)
 

Detailed Description

Holds the cache used by isBeforeInTranslationUnit.

The cache structure is complex enough to be worth breaking out of SourceManager.

Definition at line 571 of file SourceManager.h.

Constructor & Destructor Documentation

◆ InBeforeInTUCacheEntry() [1/2]

clang::InBeforeInTUCacheEntry::InBeforeInTUCacheEntry ( )
default

◆ InBeforeInTUCacheEntry() [2/2]

clang::InBeforeInTUCacheEntry::InBeforeInTUCacheEntry ( FileID  L,
FileID  R 
)
inline

Definition at line 595 of file SourceManager.h.

Member Function Documentation

◆ getCachedResult()

bool clang::InBeforeInTUCacheEntry::getCachedResult ( unsigned  LOffset,
unsigned  ROffset 
) const
inline

If the cache is valid, compute the result given the specified offsets in the LHS/RHS FileID's.

Definition at line 609 of file SourceManager.h.

Referenced by clang::SourceManager::isInTheSameTranslationUnit().

◆ isCacheValid()

bool clang::InBeforeInTUCacheEntry::isCacheValid ( ) const
inline

Return true if the currently cached values match up with the specified LHS/RHS query.

If not, we can't use the cache.

Definition at line 603 of file SourceManager.h.

References clang::FileID::isValid().

Referenced by clang::SourceManager::isInTheSameTranslationUnit().

◆ setCommonLoc()

void clang::InBeforeInTUCacheEntry::setCommonLoc ( FileID  commonFID,
unsigned  lCommonOffset,
unsigned  rCommonOffset,
bool  LParentBeforeRParent 
)
inline

Definition at line 637 of file SourceManager.h.

Referenced by clang::SourceManager::isInTheSameTranslationUnit().

◆ setQueryFIDs()

void clang::InBeforeInTUCacheEntry::setQueryFIDs ( FileID  LHS,
FileID  RHS 
)
inline

Set up a new query.

If it matches the old query, we can keep the cached answer.

Definition at line 628 of file SourceManager.h.


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