2727#include " mlir/Pass/Pass.h"
2828#include " mlir/Transforms/DialectConversion.h"
2929#include " mlir/Transforms/RegionUtils.h"
30+ #include " llvm/ADT/Twine.h"
3031
3132#define DEBUG_TYPE " lower-sim-to-sv"
3233
@@ -500,7 +501,7 @@ static LogicalResult appendIntegerSpecifier(SmallString<128> &formatString,
500501 return failure ();
501502
502503 if (width.has_value ())
503- formatString += std::to_string (width.value ());
504+ llvm::Twine (width.value ()). toVector (formatString );
504505
505506 formatString.push_back (spec);
506507 return success ();
@@ -514,9 +515,9 @@ static void appendFloatSpecifier(SmallString<128> &formatString,
514515 if (isLeftAligned)
515516 formatString.push_back (' -' );
516517 if (fieldWidth.has_value ())
517- formatString += std::to_string (fieldWidth.value ());
518+ llvm::Twine (fieldWidth.value ()). toVector (formatString );
518519 formatString.push_back (' .' );
519- formatString += std::to_string (fracDigits);
520+ llvm::Twine (fracDigits). toVector (formatString );
520521 formatString.push_back (spec);
521522}
522523
@@ -702,9 +703,8 @@ struct SimToSVPass : public circt::impl::LowerSimToSVBase<SimToSVPass> {
702703
703704 std::atomic<bool > usedSynthesisMacro = false ;
704705 auto lowerModule = [&](hw::HWModuleOp module ) {
705- if (failed (lowerPrintFormattedProcToSV (module ))) {
706+ if (failed (lowerPrintFormattedProcToSV (module )))
706707 return failure ();
707- }
708708
709709 if (moveOpsIntoIfdefGuardsAndProcesses (module ))
710710 usedSynthesisMacro = true ;
0 commit comments