Move atomic intrinsics to the new built-in package intrinsics

This commit is contained in:
gingerBill
2018-10-20 10:44:02 +01:00
parent 4ac1218bf8
commit 3742d9e7e9
8 changed files with 209 additions and 174 deletions

View File

@@ -153,9 +153,10 @@ struct Entity {
};
};
bool is_entity_kind_exported(EntityKind kind) {
bool is_entity_kind_exported(EntityKind kind, bool allow_builtin = false) {
switch (kind) {
case Entity_Builtin:
return allow_builtin;
case Entity_ImportName:
case Entity_LibraryName:
case Entity_Nil:
@@ -164,10 +165,10 @@ bool is_entity_kind_exported(EntityKind kind) {
return true;
}
bool is_entity_exported(Entity *e) {
bool is_entity_exported(Entity *e, bool allow_builtin = false) {
// TODO(bill): Determine the actual exportation rules for imports of entities
GB_ASSERT(e != nullptr);
if (!is_entity_kind_exported(e->kind)) {
if (!is_entity_kind_exported(e->kind, allow_builtin)) {
return false;
}