summaryrefslogtreecommitdiff
path: root/source/slang/lower.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/lower.h')
-rw-r--r--source/slang/lower.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/source/slang/lower.h b/source/slang/lower.h
new file mode 100644
index 000000000..c690ea025
--- /dev/null
+++ b/source/slang/lower.h
@@ -0,0 +1,38 @@
+// lower.h
+#ifndef SLANG_LOWER_H_INCLUDED
+#define SLANG_LOWER_H_INCLUDED
+
+// The "lowering" step takes an input AST written in the complete Slang
+// language and turns it into a more minimal format (still using the
+// same AST) suitable for emission into lower-level languages.
+
+#include "../core/basic.h"
+
+#include "compiler.h"
+#include "syntax.h"
+
+namespace Slang
+{
+ class EntryPointRequest;
+ class ProgramLayout;
+ class TranslationUnitRequest;
+
+ struct LoweredEntryPoint
+ {
+ // The actual lowered entry point
+ RefPtr<FunctionSyntaxNode> entryPoint;
+
+ // The generated program AST that
+ // contains the entry point and any
+ // other declarations it uses
+ RefPtr<ProgramSyntaxNode> program;
+ };
+
+ // Emit code for a single entry point, based on
+ // the input translation unit.
+ LoweredEntryPoint lowerEntryPoint(
+ EntryPointRequest* entryPoint,
+ ProgramLayout* programLayout,
+ CodeGenTarget target);
+}
+#endif