nixd
Toggle main menu visibility
Loading...
Searching...
No Matches
libnixf
src
Sema
PrimOpLookup.cpp
Go to the documentation of this file.
1
#include "
nixf/Sema/PrimOpInfo.h
"
2
3
using namespace
nixf
;
4
5
PrimopLookupResult
nixf::lookupGlobalPrimOpInfo
(
const
std::string &Name) {
6
if
(
PrimOpsInfo
.contains(Name)) {
7
return
PrimopLookupResult::Found
;
8
}
9
10
// Prefix the name with "__", and check again.
11
std::string PrefixedName =
"__"
+ Name;
12
if
(
PrimOpsInfo
.contains(PrefixedName)) {
13
return
PrimopLookupResult::PrefixedFound
;
14
}
15
16
return
PrimopLookupResult::NotFound
;
17
}
PrimOpInfo.h
nixf
Definition
Diagnostic.h:19
nixf::lookupGlobalPrimOpInfo
PrimopLookupResult lookupGlobalPrimOpInfo(const std::string &Name)
Look up information about a global primop by name.
Definition
PrimOpLookup.cpp:5
nixf::PrimOpsInfo
std::map< std::string, nixf::PrimOpInfo > PrimOpsInfo
nixf::PrimopLookupResult
PrimopLookupResult
Result of looking up a primop by name.
Definition
PrimOpInfo.h:40
nixf::PrimopLookupResult::PrefixedFound
@ PrefixedFound
The primop was found, but needs "builtin." prefix.
Definition
PrimOpInfo.h:44
nixf::PrimopLookupResult::NotFound
@ NotFound
The primop was not found.
Definition
PrimOpInfo.h:46
nixf::PrimopLookupResult::Found
@ Found
The primop was found with an exact match.
Definition
PrimOpInfo.h:42
Generated by
1.17.0