-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIdentifierName.cs
More file actions
38 lines (34 loc) · 1.13 KB
/
IdentifierName.cs
File metadata and controls
38 lines (34 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
namespace MiniSharpCompiler
{
using System;
using LLVMSharp;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Syntax;
public partial class LLVMIRGenerationVisitor
{
/// <summary>
/// Variables, fields, method names
/// </summary>
public override void VisitIdentifierName(IdentifierNameSyntax node)
{
SyntaxNode syntaxNode = node.DeclaringSyntaxNode(this.semanticModel);
if (syntaxNode != null)
{
LLVMValueRef operand;
// if we call a method we've not yet seen ...
if (!this.symbolTable.TryGetValue(syntaxNode, out operand))
{
throw new NotImplementedException("methods and classes not implemented yet");
}
if (node.Parent is AssignmentExpressionSyntax)
{
this.valueStack.Push(operand);
}
else
{
this.Push(node, LLVM.BuildLoad(this.builder, operand, string.Empty));
}
}
}
}
}