[Lldb-commits] [lldb] lldb create API folder if it does not exist, before creating SBLangua… (PR #91128)

via lldb-commits lldb-commits at lists.llvm.org
Sun May 5 08:43:56 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Nicklas Boman (smurfd)

<details>
<summary>Changes</summary>

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

---
Full diff: https://github.com/llvm/llvm-project/pull/91128.diff


1 Files Affected:

- (modified) lldb/scripts/generate-sbapi-dwarf-enum.py (+5) 


``````````diff
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.

``````````

</details>


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


More information about the lldb-commits mailing list