Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit 7f9df92

Browse files
committed
use llvm::to_string instead of std::to_string
1 parent 055978f commit 7f9df92

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/Target/JSBackend/CallHandlers.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
// which are reported as declared but not implemented symbols, so that
88
// JS linking brings them in.
99

10+
#include "llvm/Support/ScopedPrinter.h"
11+
1012
typedef std::string (JSWriter::*CallHandler)(const Instruction*, std::string Name, int NumArgs);
1113
typedef std::map<std::string, CallHandler> CallHandlerMap;
1214
CallHandlerMap CallHandlers;
@@ -1039,7 +1041,7 @@ DEF_BUILTIN_HANDLER(emscripten_float32x4_abs, SIMD_Float32x4_abs);
10391041
std::string castBoolVecToIntVec(int numElems, const std::string &str, bool signExtend)
10401042
{
10411043
int elemWidth = 128 / numElems;
1042-
std::string simdType = "SIMD_Int" + std::to_string(elemWidth) + "x" + std::to_string(numElems);
1044+
std::string simdType = "SIMD_Int" + llvm::to_string(elemWidth) + "x" + llvm::to_string(numElems);
10431045
return simdType + "_select(" + str + ", " + simdType + "_splat(" + (signExtend ? "-1" : "1") + "), " + simdType + "_splat(0))";
10441046
}
10451047
DEF_CALL_HANDLER(emscripten_float32x4_lessThan, {

lib/Target/JSBackend/JSBackend.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include "llvm/Support/ErrorHandling.h"
3939
#include "llvm/IR/GetElementPtrTypeIterator.h"
4040
#include "llvm/Support/MathExtras.h"
41+
#include "llvm/Support/ScopedPrinter.h"
4142
#include "llvm/Support/TargetRegistry.h"
4243
#include "llvm/IR/DebugInfo.h"
4344
#include "llvm/Transforms/IPO.h"
@@ -1924,7 +1925,7 @@ void JSWriter::generateExtractElementExpression(const ExtractElementInst *EEI, r
19241925
Code << getAssignIfNeeded(EEI);
19251926
std::string OperandCode;
19261927
raw_string_ostream CodeStream(OperandCode);
1927-
CodeStream << std::string("SIMD_") << SIMDType(VT) << "_extractLane(" << getValueAsStr(EEI->getVectorOperand()) << ',' << std::to_string(Index) << ')';
1928+
CodeStream << std::string("SIMD_") << SIMDType(VT) << "_extractLane(" << getValueAsStr(EEI->getVectorOperand()) << ',' << Index << ')';
19281929
Code << getCast(CodeStream.str(), EEI->getType());
19291930
return;
19301931
}
@@ -1936,7 +1937,7 @@ void JSWriter::generateExtractElementExpression(const ExtractElementInst *EEI, r
19361937
std::string castIntVecToBoolVec(int numElems, const std::string &str)
19371938
{
19381939
int elemWidth = 128 / numElems;
1939-
std::string simdType = "SIMD_Int" + std::to_string(elemWidth) + "x" + std::to_string(numElems);
1940+
std::string simdType = "SIMD_Int" + to_string(elemWidth) + "x" + to_string(numElems);
19401941
return simdType + "_notEqual(" + str + ", " + simdType + "_splat(0))";
19411942
}
19421943

0 commit comments

Comments
 (0)