unsigned NumTSRecords;
public:
Context() : TSRecords(0), NumTSRecords(0) {}
-
+
+ /// \brief Load all of the target builtins. This should be called
+ /// prior to initializing the builtin identifiers.
+ void InitializeTargetBuiltins(const TargetInfo &Target);
+
/// InitializeBuiltins - Mark the identifiers for all the builtins with their
/// appropriate builtin ID # and mark any non-portable builtin identifiers as
/// such.
- void InitializeBuiltins(IdentifierTable &Table, const TargetInfo &Target,
- bool NoBuiltins = false);
+ void InitializeBuiltins(IdentifierTable &Table, bool NoBuiltins = false);
/// Builtin::GetName - Return the identifier name for the specified builtin,
/// e.g. "__builtin_abs".
ExternalSource(0) {
if (size_reserve > 0) Types.reserve(size_reserve);
InitBuiltinTypes();
- BuiltinInfo.InitializeBuiltins(idents, Target, LangOpts.NoBuiltin);
+ BuiltinInfo.InitializeTargetBuiltins(Target);
+ BuiltinInfo.InitializeBuiltins(idents, LangOpts.NoBuiltin);
TUDecl = TranslationUnitDecl::Create(*this);
}
return TSRecords[ID - Builtin::FirstTSBuiltin];
}
+/// \brief Load all of the target builtins. This must be called
+/// prior to initializing the builtin identifiers.
+void Builtin::Context::InitializeTargetBuiltins(const TargetInfo &Target) {
+ Target.getTargetBuiltins(TSRecords, NumTSRecords);
+}
/// InitializeBuiltins - Mark the identifiers for all the builtins with their
/// appropriate builtin ID # and mark any non-portable builtin identifiers as
/// such.
void Builtin::Context::InitializeBuiltins(IdentifierTable &Table,
- const TargetInfo &Target,
bool NoBuiltins) {
// Step #1: mark all target-independent builtins with their ID's.
for (unsigned i = Builtin::NotBuiltin+1; i != Builtin::FirstTSBuiltin; ++i)
(!NoBuiltins || !strchr(BuiltinInfo[i].Attributes, 'f')))
Table.get(BuiltinInfo[i].Name).setBuiltinID(i);
- // Step #2: Get target builtins.
- Target.getTargetBuiltins(TSRecords, NumTSRecords);
-
- // Step #3: Register target-specific builtins.
+ // Step #2: Register target-specific builtins.
for (unsigned i = 0, e = NumTSRecords; i != e; ++i)
if (!TSRecords[i].Suppressed &&
(!NoBuiltins ||
if (Pos == IdTable->end())
continue;
+ fprintf(stderr, "Looked up pre-allocated IdentifierInfo \"%s\"\n",
+ II->getName());
+
// Dereferencing the iterator has the effect of populating the
// IdentifierInfo node with the various declarations it needs.
(void)*Pos;