[Lldb-commits] [lldb] [LLDB] Add `ScalarLiteralNode` and literal parsing in DIL (PR #152308)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 14 06:06:25 PDT 2025


================
@@ -370,6 +374,76 @@ std::optional<int64_t> DILParser::ParseIntegerConstant() {
   return std::nullopt;
 }
 
+// Parse a numeric_literal.
+//
+//  numeric_literal:
+//    ? Token::integer_constant ?
+//    ? Token::floating_constant ?
+//
+ASTNodeUP DILParser::ParseNumericLiteral() {
+  ASTNodeUP numeric_constant;
+  if (CurToken().Is(Token::integer_constant))
+    numeric_constant = ParseIntegerLiteral();
+  else
+    numeric_constant = ParseFloatingPointLiteral();
+  if (numeric_constant->GetKind() == NodeKind::eErrorNode) {
----------------
labath wrote:

You're not using anything from the node object in the error case. Could failure be signalled by a nullptr. Or should this maybe forward the error node?

https://github.com/llvm/llvm-project/pull/152308


More information about the lldb-commits mailing list