File tree Expand file tree Collapse file tree 1 file changed +6
-19
lines changed
clang/lib/Driver/ToolChains Expand file tree Collapse file tree 1 file changed +6
-19
lines changed Original file line number Diff line number Diff line change @@ -100,27 +100,14 @@ std::string tryParseProfile(StringRef Profile) {
100100 if (Kind == Triple::EnvironmentType::UnknownEnvironment)
101101 return " " ;
102102
103- unsigned Major = StringSwitch<unsigned >(Parts[1 ])
104- .Case (" 4" , 4 )
105- .Case (" 5" , 5 )
106- .Case (" 6" , 6 )
107- .Default (0 );
108- if (Major == 0 )
103+ unsigned long long Major = 0 ;
104+ if (llvm::getAsUnsignedInteger (Parts[1 ], 0 , Major))
109105 return " " ;
110106
111- const unsigned InvalidMinor = -1 ;
112- unsigned Minor = StringSwitch<unsigned >(Parts[2 ])
113- .Case (" 0" , 0 )
114- .Case (" 1" , 1 )
115- .Case (" 2" , 2 )
116- .Case (" 3" , 3 )
117- .Case (" 4" , 4 )
118- .Case (" 5" , 5 )
119- .Case (" 6" , 6 )
120- .Case (" 7" , 7 )
121- .Case (" x" , OfflineLibMinor)
122- .Default (InvalidMinor);
123- if (Minor == InvalidMinor)
107+ unsigned long long Minor = 0 ;
108+ if (Parts[2 ] == " x" )
109+ Minor = OfflineLibMinor;
110+ else if (llvm::getAsUnsignedInteger (Parts[2 ], 0 , Minor))
124111 return " " ;
125112
126113 // dxil-unknown-shadermodel-hull
You can’t perform that action at this time.
0 commit comments