summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-link.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-ir-link.cpp')
-rw-r--r--source/slang/slang-ir-link.cpp27
1 files changed, 2 insertions, 25 deletions
diff --git a/source/slang/slang-ir-link.cpp b/source/slang/slang-ir-link.cpp
index e556fd738..f80f97aff 100644
--- a/source/slang/slang-ir-link.cpp
+++ b/source/slang/slang-ir-link.cpp
@@ -89,25 +89,6 @@ struct IRSpecContextBase
}
};
-enum class GlobalValueClass
-{
- StructKey,
- Other
-};
-
-// Get the "class" of a global value. If there are more than one value of the same class,
-// only one value in each class will be selected during linking.
-GlobalValueClass getGlobalValueClass(IRInst* value)
-{
- switch (value->op)
- {
- case kIROp_StructKey:
- return GlobalValueClass::StructKey;
- default:
- return GlobalValueClass::Other;
- }
-}
-
void registerClonedValue(
IRSpecContextBase* context,
IRInst* clonedValue,
@@ -147,11 +128,9 @@ void registerClonedValue(
IROriginalValuesForClone const& originalValues)
{
registerClonedValue(context, clonedValue, originalValues.originalVal);
- auto valueClass = getGlobalValueClass(clonedValue);
for( auto s = originalValues.sym; s; s = s->nextWithSameName )
{
- if (getGlobalValueClass(s->irGlobalValue) == valueClass)
- registerClonedValue(context, clonedValue, s->irGlobalValue);
+ registerClonedValue(context, clonedValue, s->irGlobalValue);
}
}
@@ -1234,12 +1213,10 @@ IRInst* cloneGlobalValueWithLinkage(
// definitions over declarations.
//
IRInst* bestVal = nullptr;
- auto valueClass = getGlobalValueClass(originalVal);
for(IRSpecSymbol* ss = sym; ss; ss = ss->nextWithSameName )
{
IRInst* newVal = ss->irGlobalValue;
- if (getGlobalValueClass(newVal) == valueClass &&
- isBetterForTarget(context, newVal, bestVal))
+ if (isBetterForTarget(context, newVal, bestVal))
bestVal = newVal;
}