summaryrefslogtreecommitdiffstats
path: root/source/slang/emit.cpp
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2017-08-07 15:44:00 -0700
committerGitHub <noreply@github.com>2017-08-07 15:44:00 -0700
commit9ad2b40b79907c847451891ce2716fcbcdd2e916 (patch)
treee492a82b13334955c1c56f6e3f9d25e8165de82c /source/slang/emit.cpp
parentca8eea98c89c632dd7b5a6a8b84d379d1e9e59cf (diff)
parent7b54f43fb1b123f451460edb0add218a0428fe95 (diff)
Merge pull request #153 from tfoleyNV/remove-globals
Remove uses of global variables
Diffstat (limited to 'source/slang/emit.cpp')
-rw-r--r--source/slang/emit.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/source/slang/emit.cpp b/source/slang/emit.cpp
index 5a59674f5..d2f932ebf 100644
--- a/source/slang/emit.cpp
+++ b/source/slang/emit.cpp
@@ -375,6 +375,11 @@ struct EmitVisitor
: context(context)
{}
+ Session* getSession()
+ {
+ return context->shared->entryPoint->compileRequest->mSession;
+ }
+
// Low-level emit logic
void emitRawTextSpan(char const* textBegin, char const* textEnd)
@@ -2308,9 +2313,9 @@ struct EmitVisitor
emitTokenWithLocation(litExpr->token);
break;
}
- if(type->Equals(ExpressionType::GetInt()))
+ if(type->Equals(getSession()->getIntType()))
{}
- else if(type->Equals(ExpressionType::GetUInt()))
+ else if(type->Equals(getSession()->getUIntType()))
{
suffix = "u";
}
@@ -2330,9 +2335,9 @@ struct EmitVisitor
emitTokenWithLocation(litExpr->token);
break;
}
- if(type->Equals(ExpressionType::GetFloat()))
+ if(type->Equals(getSession()->getFloatType()))
{}
- else if(type->Equals(ExpressionType::getDoubleType()))
+ else if(type->Equals(getSession()->getDoubleType()))
{
suffix = "l";
}