[Lldb-commits] [lldb] [lldb] Use Python script to generate SBLanguages.h (PR #90753)

Dave Lee via lldb-commits lldb-commits at lists.llvm.org
Wed May 1 11:22:27 PDT 2024


================
@@ -0,0 +1,67 @@
+#!/usr/bin/env python3
+
+import argparse
+import re
+
+HEADER = """\
+//===-- SBLanguages.h -----------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_API_SBLANGUAGE_H
+#define LLDB_API_SBLANGUAGE_H
+/// Used by \\ref SBExpressionOptions.
+/// These enumerations use the same language enumerations as the DWARF
+/// specification for ease of use and consistency.
+enum SBSourceLanguageName : uint16_t {
+"""
+
+FOOTER = """\
+};
+
+#endif
+"""
+
+REGEX = re.compile(
+    r'^ *HANDLE_DW_LNAME *\( *(?P<value>[^,]+), (?P<comment>[^,]+), "(?P<name>.*)",.*\)'
----------------
kastiglione wrote:

looks like you have comment and name swapped

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


More information about the lldb-commits mailing list