[clang] [llvm] Handle leading underscores in update_cc_test_checks.py (PR #121800)

Alexander Richardson via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 12 22:41:24 PST 2025


================
@@ -122,6 +122,14 @@ def parse_clang_ast_json(node, loc, search):
         if search is None:
             search = spell
         mangled = node.get("mangledName", spell)
+        # Clang's AST dump includes the globals prefix, but when Clang emits
+        # LLVM IR this is not included and instead added as part of the asm
+        # output. Strip it from the mangled name of globals when needed
+        # (see DataLayout::getGlobalPrefix()).
+        if globals_name_prefix:
+            storage = node.get("storageClass", None)
+            if storage != "static" and mangled[0] == globals_name_prefix:
----------------
arichardson wrote:

They are mangled, but only globals get the _ prefix.

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


More information about the llvm-commits mailing list