16 #ifndef LLVM_CLANG_BASIC_BUILTINS_H 17 #define LLVM_CLANG_BASIC_BUILTINS_H 19 #include "llvm/ADT/ArrayRef.h" 28 class IdentifierTable;
51 #define BUILTIN(ID, TYPE, ATTRS) BI##ID, 52 #include "clang/Basic/Builtins.def" 87 return getRecord(ID).Name;
92 return getRecord(ID).Type;
102 return strchr(getRecord(ID).
Attributes,
'U') !=
nullptr;
108 return strchr(getRecord(ID).
Attributes,
'c') !=
nullptr;
113 return strchr(getRecord(ID).
Attributes,
'n') !=
nullptr;
118 return strchr(getRecord(ID).
Attributes,
'r') !=
nullptr;
123 return strchr(getRecord(ID).
Attributes,
'j') !=
nullptr;
129 return strchr(getRecord(ID).
Attributes,
'u') !=
nullptr;
135 return strchr(getRecord(ID).
Attributes,
'F') !=
nullptr;
142 return strchr(getRecord(ID).
Attributes,
'f') !=
nullptr;
149 return strchr(getRecord(ID).
Attributes,
'h') !=
nullptr;
156 return strchr(getRecord(ID).
Attributes,
'i') !=
nullptr;
161 return strchr(getRecord(ID).
Attributes,
't') !=
nullptr;
167 return strchr(getRecord(ID).
Type,
'*') !=
nullptr;
173 return strchr(getRecord(ID).
Type,
'&') !=
nullptr ||
174 strchr(getRecord(ID).Type,
'A') !=
nullptr;
184 return getRecord(ID).HeaderName;
190 bool isPrintfLike(
unsigned ID,
unsigned &FormatIdx,
bool &HasVAListArg);
195 bool isScanfLike(
unsigned ID,
unsigned &FormatIdx,
bool &HasVAListArg);
202 return strchr(getRecord(ID).
Attributes,
'e') !=
nullptr;
206 return getRecord(ID).Features;
209 unsigned getRequiredVectorWidth(
unsigned ID)
const;
222 static bool isBuiltinFunc(
const char *
Name);
226 bool canBeRedeclared(
unsigned ID)
const;
229 const Info &getRecord(
unsigned ID)
const;
236 bool isLike(
unsigned ID,
unsigned &FormatIdx,
bool &HasVAListArg,
237 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.