-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#72) CodeGen: support variables of typedef'd type
- Loading branch information
Showing
7 changed files
with
39 additions
and
6 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
Cesium.CodeGen.Tests/CodeGenTypeTests.TypeDefStructUsage.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Module: Primary | ||
Type: <Module> | ||
Methods: | ||
System.Int32 <Module>::main() | ||
Locals: | ||
foo V_0 | ||
IL_0000: ldc.i4 0 | ||
IL_0005: ret | ||
|
||
Type: foo | ||
Fields: | ||
System.Int32 foo::x | ||
Init with: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using Cesium.CodeGen.Contexts; | ||
using Mono.Cecil; | ||
|
||
namespace Cesium.CodeGen.Ir.Types; | ||
|
||
public record NamedType(string TypeName) : IType | ||
{ | ||
public TypeReference Resolve(TranslationUnitContext context) => | ||
context.GetTypeReference(TypeName) ?? throw new NotSupportedException($"Type not found: {TypeName}."); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters