File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 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 }
You can’t perform that action at this time.
0 commit comments