Commit 492cfab2 by Olli Etuaho Committed by Commit Bot

Use GetOperatorString when initializing symbol table

This will make it easier to add more built-in functions. BUG=angleproject:1730 TEST=angle_unittests Change-Id: I5219a83e964b6ee15c690e108313960a873dd8e5 Reviewed-on: https://chromium-review.googlesource.com/431031Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
parent 1d9dcc24
......@@ -393,6 +393,36 @@ void TSymbolTable::insertBuiltIn(ESymbolLevel level,
}
}
void TSymbolTable::insertBuiltInOp(ESymbolLevel level,
TOperator op,
const TType *rvalue,
const TType *ptype1,
const TType *ptype2,
const TType *ptype3,
const TType *ptype4,
const TType *ptype5)
{
const char *name = GetOperatorString(op);
ASSERT(strlen(name) > 0);
insertUnmangledBuiltInName(name, level);
insertBuiltIn(level, op, "", rvalue, name, ptype1, ptype2, ptype3, ptype4, ptype5);
}
void TSymbolTable::insertBuiltInOp(ESymbolLevel level,
TOperator op,
const char *ext,
const TType *rvalue,
const TType *ptype1,
const TType *ptype2,
const TType *ptype3,
const TType *ptype4,
const TType *ptype5)
{
const char *name = GetOperatorString(op);
insertUnmangledBuiltInName(name, level);
insertBuiltIn(level, op, ext, rvalue, name, ptype1, ptype2, ptype3, ptype4, ptype5);
}
void TSymbolTable::insertBuiltInFunctionNoParameters(ESymbolLevel level,
TOperator op,
const TType *rvalue,
......
......@@ -391,19 +391,24 @@ class TSymbolTable : angle::NonCopyable
insertBuiltIn(level, EOpNull, ext, rvalue, name, ptype1, ptype2, ptype3, ptype4, ptype5);
}
void insertBuiltIn(ESymbolLevel level,
TOperator op,
const TType *rvalue,
const char *name,
const TType *ptype1,
const TType *ptype2 = 0,
const TType *ptype3 = 0,
const TType *ptype4 = 0,
const TType *ptype5 = 0)
{
insertUnmangledBuiltInName(name, level);
insertBuiltIn(level, op, "", rvalue, name, ptype1, ptype2, ptype3, ptype4, ptype5);
}
void insertBuiltInOp(ESymbolLevel level,
TOperator op,
const TType *rvalue,
const TType *ptype1,
const TType *ptype2 = 0,
const TType *ptype3 = 0,
const TType *ptype4 = 0,
const TType *ptype5 = 0);
void insertBuiltInOp(ESymbolLevel level,
TOperator op,
const char *ext,
const TType *rvalue,
const TType *ptype1,
const TType *ptype2 = 0,
const TType *ptype3 = 0,
const TType *ptype4 = 0,
const TType *ptype5 = 0);
void insertBuiltInFunctionNoParameters(ESymbolLevel level,
TOperator op,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment