15 #ifndef LLVM_CLANG_BASIC_BUILTINS_H 16 #define LLVM_CLANG_BASIC_BUILTINS_H 18 #include "llvm/ADT/ArrayRef.h" 27 class IdentifierTable;
48 #define BUILTIN(ID, TYPE, ATTRS) BI##ID, 49 #include "clang/Basic/Builtins.def" 84 return getRecord(ID).Name;
89 return getRecord(ID).Type;
99 return strchr(getRecord(ID).
Attributes,
'U') !=
nullptr;
105 return strchr(getRecord(ID).
Attributes,
'c') !=
nullptr;
110 return strchr(getRecord(ID).
Attributes,
'n') !=
nullptr;
115 return strchr(getRecord(ID).
Attributes,
'r') !=
nullptr;
120 return strchr(getRecord(ID).
Attributes,
'j') !=
nullptr;
126 return strchr(getRecord(ID).
Attributes,
'u') !=
nullptr;
132 return strchr(getRecord(ID).
Attributes,
'F') !=
nullptr;
139 return strchr(getRecord(ID).
Attributes,
'f') !=
nullptr;
146 return strchr(getRecord(ID).
Attributes,
'h') !=
nullptr;
153 return strchr(getRecord(ID).
Attributes,
'i') !=
nullptr;
158 return strchr(getRecord(ID).
Attributes,
't') !=
nullptr;
164 return strchr(getRecord(ID).
Type,
'*') !=
nullptr;
170 return strchr(getRecord(ID).
Type,
'&') !=
nullptr ||
171 strchr(getRecord(ID).Type,
'A') !=
nullptr;
181 return getRecord(ID).HeaderName;
187 bool isPrintfLike(
unsigned ID,
unsigned &FormatIdx,
bool &HasVAListArg);
192 bool isScanfLike(
unsigned ID,
unsigned &FormatIdx,
bool &HasVAListArg);
197 bool performsCallback(
unsigned ID,
205 return strchr(getRecord(ID).
Attributes,
'e') !=
nullptr;
209 return getRecord(ID).Features;
212 unsigned getRequiredVectorWidth(
unsigned ID)
const;
225 static bool isBuiltinFunc(llvm::StringRef
Name);
229 bool canBeRedeclared(
unsigned ID)
const;
232 const Info &getRecord(
unsigned ID)
const;
239 bool isLike(
unsigned ID,
unsigned &FormatIdx,
bool &HasVAListArg,
240 const char *Fmt)
const;
const char * getHeaderName(unsigned ID) const
If this is a library function that comes from a specific header, retrieve that header name...
bool isPure(unsigned ID) const
Return true if this function has no side effects.
bool hasReferenceArgsOrResult(unsigned ID) const
Return true if this builtin has a result or any arguments which are reference types.
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.
Holds information about both target-independent and target-specific builtins, allowing easy queries b...
static const Builtin::Info BuiltinInfo[]
The base class of the type hierarchy.
const char * getTypeString(unsigned ID) const
Get the type descriptor string for the specified builtin.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
bool isLibFunction(unsigned ID) const
Return true if this is a builtin for a libc/libm function, with a "__builtin_" prefix (e...
bool isConstWithoutErrno(unsigned ID) const
Return true if this function has no side effects and doesn't read memory, except for possibly errno...
unsigned getAuxBuiltinID(unsigned ID) const
Return real builtin ID (i.e.
bool isUnevaluated(unsigned ID) const
Returns true if this builtin does not perform the side-effects of its arguments.
const char * getName(unsigned ID) const
Return the identifier name for the specified builtin, e.g.
Exposes information about the current target.
bool isNoReturn(unsigned ID) const
Return true if we know this builtin never returns.
Implements an efficient mapping from strings to IdentifierInfo nodes.
bool isPredefinedRuntimeFunction(unsigned ID) const
Determines whether this builtin is a predefined compiler-rt/libgcc function, such as "__clear_cache"...
const char * getRequiredFeatures(unsigned ID) const
bool hasPtrArgsOrResult(unsigned ID) const
Determines whether this builtin has a result or any arguments which are pointer types.
bool isAuxBuiltinID(unsigned ID) const
Return true if builtin ID belongs to AuxTarget.
This names the __make_integer_seq BuiltinTemplateDecl.
bool isConst(unsigned ID) const
Return true if this function has no side effects and doesn't read memory.
BuiltinTemplateKind
Kinds of BuiltinTemplateDecl.
bool isHeaderDependentFunction(unsigned ID) const
Returns true if this builtin requires appropriate header in other compilers.
Dataflow Directional Tag Classes.
This names the __type_pack_element BuiltinTemplateDecl.
bool isNoThrow(unsigned ID) const
Return true if we know this builtin never throws an exception.
bool isTSBuiltin(unsigned ID) const
Return true if this function is a target-specific builtin.
bool hasCustomTypechecking(unsigned ID) const
Determines whether this builtin has custom typechecking.
bool isReturnsTwice(unsigned ID) const
Return true if we know this builtin can return twice.