Add parsing for attributes and attibutes on operations. Add IR representation
for attributes on operations. Split Operation out from OperationInst so it
can be shared with OperationStmt one day.
PiperOrigin-RevId: 203325366
diff --git a/lib/Parser/Token.h b/lib/Parser/Token.h
index bc9e8e4..73baaac 100644
--- a/lib/Parser/Token.h
+++ b/lib/Parser/Token.h
@@ -67,12 +67,19 @@
return !isAny(k1, k2, others...);
}
+ /// Return true if this is one of the keyword token kinds (e.g. kw_if).
+ bool isKeyword() const;
+
// Helpers to decode specific sorts of tokens.
/// For an integer token, return its value as an unsigned. If it doesn't fit,
/// return None.
Optional<unsigned> getUnsignedIntegerValue() const;
+ /// For an integer token, return its value as an int64_t. If it doesn't fit,
+ /// return None.
+ Optional<uint64_t> getUInt64IntegerValue() const;
+
/// For an inttype token, return its bitwidth.
Optional<unsigned> getIntTypeBitwidth() const;