summaryrefslogtreecommitdiffstats
path: root/source/core
diff options
context:
space:
mode:
authorTheresa Foley <10618364+tangent-vector@users.noreply.github.com>2025-07-24 12:59:58 -0700
committerGitHub <noreply@github.com>2025-07-24 19:59:58 +0000
commit8ccd495d5eaa82cb831378c28dd190e657b6c999 (patch)
treec39dc364d95f78984fd4ba2776d259ff944d2596 /source/core
parent2d23a962766a97cbb11bcee5483a66aec923da49 (diff)
Organize code better by splitting some big files (#7890)
* Organize code better by splitting some big files The basic change here is that the majority of the declarations in `slang-compiler.h` have been split out into a set of smaller and more focused files. As a result, the implement of those declarations have been moved from `slang-compiler.cpp` and `slang.cpp` over to those new files when the proper home for code is obvious. I have tried as much as possible to *not* make any edits to the code along the way, and just copy-paste declarations from one place to another as-is. The exceptions I am aware of are: * In some cases a function that used to be file-scope `static` was used by code that landed in two or more different `.cpp` files. In these cases, I changed the function to be non-`static` (removing the `_` prefix from its name, if it had one, per our naming conventions), and put a declaration for the function into the most appropriate header I could identify. * I added a few comments in places where I saw ugly or unfortunate things in the code I was moving, and wanted to tag them with `TODO`s so we can hopefully get to them in the fullness of time. * I added top-level comments to each of the new `.h` files that was introduced to try to explain the logic for what goes into that file. * In cases where one of the new header files mostly existed to declare a single type, I sometimes added more detail to the doc comment on that type, to better explain the type and its role in the compiler (this is text that otherwise might have gone into the comment at the top leve lof the file, but I figured that the doc comment would have higher discoverability). I expect that the most contentious choice here is that the `Session` class lands in `slang-global-session.h` while `slang-session.h` holds the `Linkage` class. The names used in this change are consistent with how the relevant concepts in the public Slang API are named, and are consistent with how we *intend* to rename the classes themselves in time. * format code * fixup --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Diffstat (limited to 'source/core')
-rw-r--r--source/core/slang-type-convert-util.h8
-rw-r--r--source/core/slang-type-text-util.h8
2 files changed, 16 insertions, 0 deletions
diff --git a/source/core/slang-type-convert-util.h b/source/core/slang-type-convert-util.h
index d4c80abf8..45cb4b82c 100644
--- a/source/core/slang-type-convert-util.h
+++ b/source/core/slang-type-convert-util.h
@@ -1,6 +1,14 @@
#ifndef SLANG_CORE_TYPE_CONVERT_UTIL_H
#define SLANG_CORE_TYPE_CONVERT_UTIL_H
+// TODO: This file's name is not obvious for what it contains.
+// Either the file should be renamed to be more obviously related
+// to what it does, or (better yet) the functionality should be
+// moved to reside in places that are more logically related
+// to each of the given types.
+//
+// Also: this doesn't belong in `core` for a bunch of reasons.
+
#include "slang.h"
namespace Slang
diff --git a/source/core/slang-type-text-util.h b/source/core/slang-type-text-util.h
index 684d109c3..075b9e2a0 100644
--- a/source/core/slang-type-text-util.h
+++ b/source/core/slang-type-text-util.h
@@ -1,6 +1,14 @@
#ifndef SLANG_CORE_TYPE_TEXT_UTIL_H
#define SLANG_CORE_TYPE_TEXT_UTIL_H
+// TODO: This file's name is not obvious for what it contains.
+// Either the file should be renamed to be more obviously related
+// to what it does, or (better yet) the functionality should be
+// moved to reside in places that are more logically related
+// to each of the given types.
+//
+// Also: this doesn't belong in `core` for a bunch of reasons.
+
#include "slang-array-view.h"
#include "slang-name-value.h"
#include "slang-string.h"