https://github.com/smurfd created 
https://github.com/llvm/llvm-project/pull/91128

Create API folder if it does not exist, before creating SBLanguages.h

>From afc16cb8b3c2e5e804287f7cf5f2be1b2a8b3c46 Mon Sep 17 00:00:00 2001
From: Nicklas Boman <smu...@gmail.com>
Date: Sun, 5 May 2024 17:40:51 +0200
Subject: [PATCH] lldb create API folder if it does not exist, before creating
 SBLanguages.h

---
 lldb/scripts/generate-sbapi-dwarf-enum.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lldb/scripts/generate-sbapi-dwarf-enum.py 
b/lldb/scripts/generate-sbapi-dwarf-enum.py
index 464eb2afff7d6f..162f76e77ec24a 100755
--- a/lldb/scripts/generate-sbapi-dwarf-enum.py
+++ b/lldb/scripts/generate-sbapi-dwarf-enum.py
@@ -2,6 +2,7 @@
 
 import argparse
 import re
+import os
 
 HEADER = """\
 //===-- SBLanguages.h -----------------------------------------*- C++ -*-===//
@@ -37,6 +38,10 @@ def emit_enum(input, output):
     with open(input, "r") as f:
         lines = f.readlines()
 
+    # Create output folder if it does not exist
+    if not os.path.isdir(os.path.dirname(output)):
+        os.makedirs(os.path.dirname(output))
+
     # Write the output.
     with open(output, "w") as f:
         # Emit the header.

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to