summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-ir-com-interface.cpp
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2024-10-29 14:49:26 +0800
committerGitHub <noreply@github.com>2024-10-29 14:49:26 +0800
commitf65d756bff8d4c5cbc15bd0322a2ae8e6b896a21 (patch)
treeea1d61342cd29368e19135000ec2948813096205 /source/slang/slang-ir-com-interface.cpp
parenta729c15e9dce9f5116a38afc66329ab2ca4cea54 (diff)
format
* format * Minor test fixes * enable checking cpp format in ci
Diffstat (limited to 'source/slang/slang-ir-com-interface.cpp')
-rw-r--r--source/slang/slang-ir-com-interface.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/source/slang/slang-ir-com-interface.cpp b/source/slang/slang-ir-com-interface.cpp
index 0c8977aa0..ed4c4a17a 100644
--- a/source/slang/slang-ir-com-interface.cpp
+++ b/source/slang/slang-ir-com-interface.cpp
@@ -1,9 +1,9 @@
// slang-ir-com-interface.cpp
#include "slang-ir-com-interface.h"
-#include "slang-ir.h"
#include "slang-ir-insts.h"
#include "slang-ir-lower-com-methods.h"
+#include "slang-ir.h"
namespace Slang
{
@@ -12,28 +12,28 @@ static bool _canReplace(IRUse* use)
{
switch (use->getUser()->getOp())
{
- case kIROp_WitnessTableIDType:
- case kIROp_WitnessTableType:
- case kIROp_RTTIPointerType:
- case kIROp_RTTIHandleType:
- case kIROp_ComPtrType:
- case kIROp_NativePtrType:
+ case kIROp_WitnessTableIDType:
+ case kIROp_WitnessTableType:
+ case kIROp_RTTIPointerType:
+ case kIROp_RTTIHandleType:
+ case kIROp_ComPtrType:
+ case kIROp_NativePtrType:
{
// Don't replace
return false;
}
- case kIROp_ThisType:
+ case kIROp_ThisType:
{
// Appears replacable.
break;
}
- case kIROp_PtrType:
+ case kIROp_PtrType:
{
// We can have ** and ComPtr<T>*.
// If it's a pointer type it could be because it is a global.
break;
}
- default: break;
+ default: break;
}
return true;
}
@@ -66,7 +66,7 @@ void lowerComInterfaces(IRModule* module, ArtifactStyle artifactStyle, Diagnosti
uses.clear();
// Find all of the uses *before* doing any replacement
- // Otherwise we end up replacing the replacement leading
+ // Otherwise we end up replacing the replacement leading
// to it pointing to itself.
for (auto use = comIntf->firstUse; use; use = use->nextUse)
{
@@ -85,18 +85,18 @@ void lowerComInterfaces(IRModule* module, ArtifactStyle artifactStyle, Diagnosti
}
// NOTE! The following code relies on the fact that the builder
- // *doesn't* dedup in general, and in particular doesn't ptr types.
- // This allows the creation a 'new' pointer type, and subsequent replacment all old uses,
- // leading to a `IInterface*` becoming `IInterface**`.
- //
+ // *doesn't* dedup in general, and in particular doesn't ptr types.
+ // This allows the creation a 'new' pointer type, and subsequent replacment all old
+ // uses, leading to a `IInterface*` becoming `IInterface**`.
+ //
- // TODO(JS): This is a temporary fix, in that whether kernel or not
+ // TODO(JS): This is a temporary fix, in that whether kernel or not
// shouldn't control the ptr type in general
// It's necessary here though because Kernel doesn't have ComPtr<>
// so has to be a raw pointer
- IRType* result = (artifactStyle == ArtifactStyle::Host) ?
- static_cast<IRType*>(builder.getComPtrType(comIntf)) :
- static_cast<IRType*>(builder.getNativePtrType(comIntf));
+ IRType* result = (artifactStyle == ArtifactStyle::Host)
+ ? static_cast<IRType*>(builder.getComPtrType(comIntf))
+ : static_cast<IRType*>(builder.getNativePtrType(comIntf));
// Go through replacing all of the replacable uses
for (auto use : uses)
@@ -108,4 +108,4 @@ void lowerComInterfaces(IRModule* module, ArtifactStyle artifactStyle, Diagnosti
}
}
-}
+} // namespace Slang