@@ -1827,52 +1827,51 @@ bool DxilModule::StripReflection() {
18271827}
18281828
18291829bool DxilModule::StripNamesSensitiveToDebug () {
1830- bool bChanged = false ;
1831- bool bIsLib = GetShaderModel ()->IsLib ();
1830+ bool changed = false ;
18321831
1833- if (!bIsLib ) {
1832+ if (!GetShaderModel ()-> IsLib () ) {
18341833 // Strip struct names
18351834 vector<StructType *> structTypes = m_pModule->getIdentifiedStructTypes ();
1836- unsigned NextStructId = 0 ;
1837- for (StructType *ST : structTypes) {
1838- if (!ST ->hasName ())
1835+ unsigned nextStructId = 0 ;
1836+ for (StructType *structType : structTypes) {
1837+ if (!structType ->hasName ())
18391838 continue ;
18401839
1841- StringRef Name = ST ->getName ();
1840+ StringRef Name = structType ->getName ();
18421841 if (Name.startswith (" dx." ))
18431842 continue ;
18441843
1845- ST ->setName ((Twine (" dx.strip.struct." ) + Twine (NextStructId ++)).str ());
1846- bChanged = true ;
1844+ structType ->setName ((Twine (" dx.strip.struct." ) + Twine (nextStructId ++)).str ());
1845+ changed = true ;
18471846 }
18481847
18491848 // Strip entry function name
18501849 if (m_pEntryFunc) {
18511850 SetEntryFunctionName (" dx.strip.entry." );
18521851 m_pEntryFunc->setName (" dx.strip.entry." );
1853- bChanged = true ;
1852+ changed = true ;
18541853 }
18551854
18561855 // Strip groupshared variable names
1857- unsigned NextGroupSharedId = 0 ;
1858- for (GlobalVariable &GV : m_pModule->globals ()) {
1859- if (GV .getType ()->getPointerAddressSpace () == DXIL::kTGSMAddrSpace &&
1860- GV .hasName ()) {
1861- StringRef Name = GV .getName ();
1856+ unsigned nextGroupSharedId = 0 ;
1857+ for (GlobalVariable &globalVar : m_pModule->globals ()) {
1858+ if (globalVar .getType ()->getPointerAddressSpace () == DXIL::kTGSMAddrSpace &&
1859+ globalVar .hasName ()) {
1860+ StringRef Name = globalVar .getName ();
18621861 if (Name.startswith (" dx." ) || Name.startswith (" llvm." ))
18631862 continue ;
1864- GV .setName (
1865- (Twine (" dx.strip.tgsm." ) + Twine (NextGroupSharedId ++)).str ());
1866- bChanged = true ;
1863+ globalVar .setName (
1864+ (Twine (" dx.strip.tgsm." ) + Twine (nextGroupSharedId ++)).str ());
1865+ changed = true ;
18671866 }
18681867 }
18691868
18701869 // ReEmit meta.
1871- if (bChanged )
1870+ if (changed )
18721871 ReEmitDxilResources ();
18731872 }
18741873
1875- return bChanged ;
1874+ return changed ;
18761875}
18771876
18781877static void RemoveTypesFromSet (Type *Ty,
0 commit comments