Skip to content

Commit 0eb9285

Browse files
committed
using TypeFinder to get structs
1 parent 2b30dc0 commit 0eb9285

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lib/DXIL/DxilModule.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "llvm/IR/Metadata.h"
3232
#include "llvm/IR/Module.h"
3333
#include "llvm/IR/Operator.h"
34+
#include "llvm/IR/TypeFinder.h"
3435
#include "llvm/Support/raw_ostream.h"
3536
#include <unordered_set>
3637

@@ -1831,18 +1832,18 @@ bool DxilModule::StripNamesSensitiveToDebug() {
18311832

18321833
if (!GetShaderModel()->IsLib()) {
18331834
// Strip struct names
1834-
std::vector<StructType *> structTypes =
1835-
m_pModule->getIdentifiedStructTypes();
18361835
unsigned nextStructId = 0;
1837-
for (StructType *structType : structTypes) {
1838-
if (!structType->hasName())
1836+
TypeFinder StructTypes;
1837+
StructTypes.run(*m_pModule, true);
1838+
for (StructType *STy : StructTypes) {
1839+
if (!STy->hasName())
18391840
continue;
18401841

1841-
StringRef Name = structType->getName();
1842+
StringRef Name = STy->getName();
18421843
if (Name.startswith("dx."))
18431844
continue;
18441845

1845-
structType->setName(
1846+
STy->setName(
18461847
(Twine("dx.strip.struct.") + Twine(nextStructId++)).str());
18471848
changed = true;
18481849
}

0 commit comments

Comments
 (0)