[Lldb-commits] [PATCH] D152569: [lldb] Introduce a tool to quickly generate projects with an arbitrary number of sources
Greg Clayton via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Thu Jun 15 16:02:04 PDT 2023
clayborg added inline comments.
================
Comment at: lldb/scripts/generate-project.py:21
+def generate_c_header(directory: str, index: int) -> None:
+ header_path = f"{directory}/obj{index}.h"
+ with open(header_path, "w") as f:
----------------
kastiglione wrote:
> kastiglione wrote:
> > os.path.join to be windows friendly?
> I just noticed the contents of the makefiles also have forward slashes, so I retract my comment.
I would vote to use os.path.join() instead of manually formatting strings
================
Comment at: lldb/scripts/generate-project.py:50
+ f.write(
+ f"#ifndef _OBJ{index}_H\n"
+ f"#define _OBJ{index}_H\n"
----------------
Add a "PP" to differentiate from c?
================
Comment at: lldb/scripts/generate-project.py:297-301
+ supported_languages = ["c", "cpp", "swift"]
+ if language not in supported_languages:
+ print(f"Unrecognized language: {language}")
+ print(f"Supported languages: {supported_languages}")
+ sys.exit(1)
----------------
move into generate_sources(...)?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152569/new/
https://reviews.llvm.org/D152569
More information about the lldb-commits
mailing list