File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -26,15 +26,15 @@ namespace {
2626void addDxilValVersion (StringRef ValVersionStr, llvm::Module &M) {
2727 // The validation of ValVersionStr is done at HLSLToolChain::TranslateArgs.
2828 // 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 ()) {
3432 return ;
3533 }
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+
3838 auto &Ctx = M.getContext ();
3939 IRBuilder<> B (M.getContext ());
4040 MDNode *Val = MDNode::get (Ctx, {ConstantAsMetadata::get (B.getInt32 (Major)),
You can’t perform that action at this time.
0 commit comments