clang API Documentation

Public Member Functions
clang::Builtin::Context Class Reference

#include <Builtins.h>

List of all members.

Public Member Functions

 Context ()
void InitializeTarget (const TargetInfo &Target)
 Perform target-specific initialization.
void InitializeBuiltins (IdentifierTable &Table, const LangOptions &LangOpts)
void GetBuiltinNames (SmallVectorImpl< const char * > &Names, bool NoBuiltins)
 Popular the vector with the names of all of the builtins.
const char * GetName (unsigned ID) const
const char * GetTypeString (unsigned ID) const
 GetTypeString - Get the type descriptor string for the specified builtin.
bool isConst (unsigned ID) const
bool isNoThrow (unsigned ID) const
 isNoThrow - Return true if we know this builtin never throws an exception.
bool isNoReturn (unsigned ID) const
 isNoReturn - Return true if we know this builtin never returns.
bool isReturnsTwice (unsigned ID) const
 isReturnsTwice - Return true if we know this builtin can return twice.
bool isLibFunction (unsigned ID) const
bool isPredefinedLibFunction (unsigned ID) const
 Determines whether this builtin is a predefined libc/libm function, such as "malloc", where we know the signature a priori.
bool hasCustomTypechecking (unsigned ID) const
 Determines whether this builtin has custom typechecking.
void ForgetBuiltin (unsigned ID, IdentifierTable &Table)
 Completely forget that the given ID was ever considered a builtin, e.g., because the user provided a conflicting signature.
const char * getHeaderName (unsigned ID) const
 If this is a library function that comes from a specific header, retrieve that header name.
bool isPrintfLike (unsigned ID, unsigned &FormatIdx, bool &HasVAListArg)
 Determine whether this builtin is like printf in its formatting rules and, if so, set the index to the format string argument and whether this function as a va_list argument.
bool isScanfLike (unsigned ID, unsigned &FormatIdx, bool &HasVAListArg)
 Determine whether this builtin is like scanf in its formatting rules and, if so, set the index to the format string argument and whether this function as a va_list argument.
bool isConstWithoutErrno (unsigned ID) const

Detailed Description

Builtin::Context - This holds information about target-independent and target-specific builtins, allowing easy queries by clients.

Definition at line 61 of file Builtins.h.


Constructor & Destructor Documentation

Builtin::Context::Context ( )

Definition at line 36 of file Builtins.cpp.


Member Function Documentation

void Builtin::Context::ForgetBuiltin ( unsigned  ID,
IdentifierTable Table 
)

Completely forget that the given ID was ever considered a builtin, e.g., because the user provided a conflicting signature.

Definition at line 80 of file Builtins.cpp.

References clang::IdentifierTable::get(), and clang::IdentifierInfo::setBuiltinID().

Referenced by LookupBuiltin().

void Builtin::Context::GetBuiltinNames ( SmallVectorImpl< const char * > &  Names,
bool  NoBuiltins 
)

Popular the vector with the names of all of the builtins.

Definition at line 67 of file Builtins.cpp.

References BuiltinInfo, and clang::Builtin::NotBuiltin.

const char* clang::Builtin::Context::getHeaderName ( unsigned  ID) const [inline]

If this is a library function that comes from a specific header, retrieve that header name.

Definition at line 135 of file Builtins.h.

References clang::Builtin::Info::HeaderName.

const char* clang::Builtin::Context::GetName ( unsigned  ID) const [inline]

Builtin::GetName - Return the identifier name for the specified builtin, e.g. "__builtin_abs".

Definition at line 81 of file Builtins.h.

References clang::Builtin::Info::Name.

Referenced by clang::ento::CheckerContext::isCLibraryFunction().

const char* clang::Builtin::Context::GetTypeString ( unsigned  ID) const [inline]

GetTypeString - Get the type descriptor string for the specified builtin.

Definition at line 86 of file Builtins.h.

References clang::Builtin::Info::Type.

Referenced by clang::ASTContext::GetBuiltinType().

bool clang::Builtin::Context::hasCustomTypechecking ( unsigned  ID) const [inline]

Determines whether this builtin has custom typechecking.

Definition at line 125 of file Builtins.h.

void Builtin::Context::InitializeBuiltins ( IdentifierTable Table,
const LangOptions LangOpts 
)

InitializeBuiltins - Mark the identifiers for all the builtins with their appropriate builtin ID # and mark any non-portable builtin identifiers as such.

Definition at line 50 of file Builtins.cpp.

References clang::Builtin::Info::builtin_lang, BuiltinInfo, clang::IdentifierTable::get(), clang::Builtin::NotBuiltin, clang::OBJC_LANG, and clang::IdentifierInfo::setBuiltinID().

Referenced by clang::FrontendAction::BeginSourceFile(), and clang::ChainedIncludesSource::create().

void Builtin::Context::InitializeTarget ( const TargetInfo Target)

Perform target-specific initialization.

Definition at line 42 of file Builtins.cpp.

References clang::TargetInfo::getTargetBuiltins().

bool clang::Builtin::Context::isConst ( unsigned  ID) const [inline]

isConst - Return true if this function has no side effects and doesn't read memory.

Definition at line 92 of file Builtins.h.

bool clang::Builtin::Context::isConstWithoutErrno ( unsigned  ID) const [inline]

isConstWithoutErrno - Return true if this function has no side effects and doesn't read memory, except for possibly errno. Such functions can be const when the MathErrno lang option is disabled.

Definition at line 153 of file Builtins.h.

bool clang::Builtin::Context::isLibFunction ( unsigned  ID) const [inline]

isLibFunction - Return true if this is a builtin for a libc/libm function, with a "__builtin_" prefix (e.g. __builtin_abs).

Definition at line 113 of file Builtins.h.

bool clang::Builtin::Context::isNoReturn ( unsigned  ID) const [inline]

isNoReturn - Return true if we know this builtin never returns.

Definition at line 102 of file Builtins.h.

Referenced by clang::ASTContext::GetBuiltinType().

bool clang::Builtin::Context::isNoThrow ( unsigned  ID) const [inline]

isNoThrow - Return true if we know this builtin never throws an exception.

Definition at line 97 of file Builtins.h.

bool clang::Builtin::Context::isPredefinedLibFunction ( unsigned  ID) const [inline]

Determines whether this builtin is a predefined libc/libm function, such as "malloc", where we know the signature a priori.

Definition at line 120 of file Builtins.h.

Referenced by clang::FunctionDecl::getBuiltinID(), and LookupBuiltin().

bool Builtin::Context::isPrintfLike ( unsigned  ID,
unsigned &  FormatIdx,
bool &  HasVAListArg 
)

Determine whether this builtin is like printf in its formatting rules and, if so, set the index to the format string argument and whether this function as a va_list argument.

Definition at line 85 of file Builtins.cpp.

bool clang::Builtin::Context::isReturnsTwice ( unsigned  ID) const [inline]

isReturnsTwice - Return true if we know this builtin can return twice.

Definition at line 107 of file Builtins.h.

bool Builtin::Context::isScanfLike ( unsigned  ID,
unsigned &  FormatIdx,
bool &  HasVAListArg 
)

Determine whether this builtin is like scanf in its formatting rules and, if so, set the index to the format string argument and whether this function as a va_list argument.

Definition at line 104 of file Builtins.cpp.


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