File tree 1 file changed +7
-7
lines changed 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -26,15 +26,15 @@ namespace {
26
26
void addDxilValVersion (StringRef ValVersionStr, llvm::Module &M) {
27
27
// The validation of ValVersionStr is done at HLSLToolChain::TranslateArgs.
28
28
// Assume ValVersionStr is legal here.
29
- auto VerPair = ValVersionStr.split (" ." );
30
- llvm::APInt APMajor, APMinor;
31
-
32
- if (VerPair.first .getAsInteger (0 , APMajor) ||
33
- VerPair.second .getAsInteger (0 , APMinor)) {
29
+ VersionTuple Version;
30
+ if (Version.tryParse (ValVersionStr) || Version.getBuild () ||
31
+ Version.getSubminor () || !Version.getMinor ()) {
34
32
return ;
35
33
}
36
- uint64_t Major = APMajor.getLimitedValue ();
37
- uint64_t Minor = APMinor.getLimitedValue ();
34
+
35
+ uint64_t Major = Version.getMajor ();
36
+ uint64_t Minor = Version.getMinor ().getValue ();
37
+
38
38
auto &Ctx = M.getContext ();
39
39
IRBuilder<> B (M.getContext ());
40
40
MDNode *Val = MDNode::get (Ctx, {ConstantAsMetadata::get (B.getInt32 (Major)),
You can’t perform that action at this time.
0 commit comments