clang 23.0.0git
USRGeneration.cpp File Reference
#include "clang/UnifiedSymbolResolution/USRGeneration.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Attr.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/DeclVisitor.h"
#include "clang/AST/ODRHash.h"
#include "clang/Lex/PreprocessingRecord.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
#include "clang/Basic/OpenCLImageTypes.def"
#include "clang/Basic/OpenCLExtensionTypes.def"
#include "clang/Basic/AArch64ACLETypes.def"
#include "clang/Basic/PPCTypes.def"
#include "clang/Basic/RISCVVTypes.def"
#include "clang/Basic/WebAssemblyReferenceTypes.def"
#include "clang/Basic/AMDGPUTypes.def"
#include "clang/Basic/HLSLIntangibleTypes.def"
#include "clang/AST/BuiltinTypes.def"

Go to the source code of this file.

Macros

#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix)
#define EXT_OPAQUE_TYPE(ExtType, Id, Ext)
#define SVE_TYPE(Name, Id, SingletonId)
#define PPC_VECTOR_TYPE(Name, Id, Size)
#define RVV_TYPE(Name, Id, SingletonId)
#define WASM_TYPE(Name, Id, SingletonId)
#define AMDGPU_TYPE(Name, Id, SingletonId, Width, Align)
#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId)
#define BUILTIN_TYPE(Id, SingletonId)
#define PLACEHOLDER_TYPE(Id, SingletonId)

Functions

static bool printLocOffset (llvm::raw_ostream &OS, SourceLocation Loc, const SourceManager &SM)
 Print only the offset part of Loc.
static bool printLoc (llvm::raw_ostream &OS, SourceLocation Loc, const SourceManager &SM, bool IncludeOffset)
 Print Loc including both the file and offset, if IncludeOffset is true.
static StringRef GetExternalSourceContainer (const NamedDecl *D)
static const ObjCCategoryDeclgetCategoryContext (const NamedDecl *D)
static void printQualifier (llvm::raw_ostream &Out, const LangOptions &LangOpts, NestedNameSpecifier NNS)
static void combineClassAndCategoryExtContainers (StringRef ClsSymDefinedIn, StringRef CatSymDefinedIn, raw_ostream &OS)

Macro Definition Documentation

◆ AMDGPU_TYPE

#define AMDGPU_TYPE ( Name,
Id,
SingletonId,
Width,
Align )
Value:
case BuiltinType::Id: \
Out << "@BT@" << #Name; \
break;

◆ BUILTIN_TYPE

#define BUILTIN_TYPE ( Id,
SingletonId )

◆ EXT_OPAQUE_TYPE

#define EXT_OPAQUE_TYPE ( ExtType,
Id,
Ext )
Value:
case BuiltinType::Id: \
Out << "@BT@" << #ExtType; \
break;

◆ HLSL_INTANGIBLE_TYPE

#define HLSL_INTANGIBLE_TYPE ( Name,
Id,
SingletonId )
Value:
case BuiltinType::Id: \
Out << "@BT@" << #Name; \
break;

◆ IMAGE_TYPE

#define IMAGE_TYPE ( ImgType,
Id,
SingletonId,
Access,
Suffix )
Value:
case BuiltinType::Id: \
Out << "@BT@" << #Suffix << "_" << #ImgType; \
break;

◆ PLACEHOLDER_TYPE

#define PLACEHOLDER_TYPE ( Id,
SingletonId )
Value:
case BuiltinType::Id:

◆ PPC_VECTOR_TYPE

#define PPC_VECTOR_TYPE ( Name,
Id,
Size )
Value:
case BuiltinType::Id: \
Out << "@BT@" << #Name; \
break;

◆ RVV_TYPE

#define RVV_TYPE ( Name,
Id,
SingletonId )
Value:
case BuiltinType::Id: \
Out << "@BT@" << Name; \
break;

◆ SVE_TYPE

#define SVE_TYPE ( Name,
Id,
SingletonId )
Value:
case BuiltinType::Id: \
Out << "@BT@" << #Name; \
break;

◆ WASM_TYPE

#define WASM_TYPE ( Name,
Id,
SingletonId )
Value:
case BuiltinType::Id:

Function Documentation

◆ combineClassAndCategoryExtContainers()

void combineClassAndCategoryExtContainers ( StringRef ClsSymDefinedIn,
StringRef CatSymDefinedIn,
raw_ostream & OS )
static

◆ getCategoryContext()

const ObjCCategoryDecl * getCategoryContext ( const NamedDecl * D)
static

Definition at line 434 of file USRGeneration.cpp.

References clang::Decl::getDeclContext().

◆ GetExternalSourceContainer()

StringRef GetExternalSourceContainer ( const NamedDecl * D)
static

Definition at line 73 of file USRGeneration.cpp.

References clang::Decl::getExternalSourceSymbolAttr().

◆ printLoc()

bool printLoc ( llvm::raw_ostream & OS,
SourceLocation Loc,
const SourceManager & SM,
bool IncludeOffset )
static

Print Loc including both the file and offset, if IncludeOffset is true.

Print only the file of Loc otherwise.

Returns
true on error.

Definition at line 50 of file USRGeneration.cpp.

References clang::FileEntryRef::getName(), clang::SourceLocation::isInvalid(), printLocOffset(), and SM.

Referenced by clang::index::generateUSRForMacro().

◆ printLocOffset()

bool printLocOffset ( llvm::raw_ostream & OS,
SourceLocation Loc,
const SourceManager & SM )
static

Print only the offset part of Loc.

Returns
true on error.

Definition at line 29 of file USRGeneration.cpp.

References clang::SourceLocation::isInvalid(), and SM.

Referenced by printLoc().

◆ printQualifier()