From ca5092a11a09ddbaa11c3696596f11e56fb19229 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Thu, 28 Dec 2017 16:58:54 +0000 Subject: [PATCH] Avoid int to string conversion in Twine or raw_ostream contexts. Some output changes from uppercase hex to lowercase hex, no other functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321526 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/DemandedBits.cpp | 4 +- lib/LTO/ThinLTOCodeGenerator.cpp | 2 +- lib/Support/ARMAttributeParser.cpp | 2 +- lib/TableGen/Main.cpp | 2 +- lib/Target/NVPTX/NVPTXAsmPrinter.cpp | 6 +- lib/Target/NVPTX/NVPTXMCExpr.cpp | 6 +- .../WebAssembly/WebAssemblyAsmPrinter.cpp | 2 +- lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp | 3 +- .../Instrumentation/AddressSanitizer.cpp | 7 ++- lib/Transforms/Scalar/GVNSink.cpp | 2 +- tools/llvm-cov/CodeCoverage.cpp | 5 +- tools/llvm-objdump/llvm-objdump.cpp | 2 +- tools/llvm-readobj/COFFDumper.cpp | 2 +- tools/llvm-readobj/ELFDumper.cpp | 4 +- tools/yaml2obj/yaml2obj.cpp | 2 +- utils/TableGen/CodeGenDAGPatterns.cpp | 15 +++-- utils/TableGen/DFAPacketizerEmitter.cpp | 57 ++++++++++--------- utils/TableGen/IntrinsicEmitter.cpp | 2 +- 18 files changed, 60 insertions(+), 65 deletions(-) diff --git a/lib/Analysis/DemandedBits.cpp b/lib/Analysis/DemandedBits.cpp index 7276f2524fed0..de7d21f9f1334 100644 --- a/lib/Analysis/DemandedBits.cpp +++ b/lib/Analysis/DemandedBits.cpp @@ -385,8 +385,8 @@ bool DemandedBits::isInstructionDead(Instruction *I) { void DemandedBits::print(raw_ostream &OS) { performAnalysis(); for (auto &KV : AliveBits) { - OS << "DemandedBits: 0x" << utohexstr(KV.second.getLimitedValue()) << " for " - << *KV.first << "\n"; + OS << "DemandedBits: 0x" << Twine::utohexstr(KV.second.getLimitedValue()) + << " for " << *KV.first << '\n'; } } diff --git a/lib/LTO/ThinLTOCodeGenerator.cpp b/lib/LTO/ThinLTOCodeGenerator.cpp index c8b3892375f64..abcd8905ad356 100644 --- a/lib/LTO/ThinLTOCodeGenerator.cpp +++ b/lib/LTO/ThinLTOCodeGenerator.cpp @@ -76,7 +76,7 @@ static void saveTempBitcode(const Module &TheModule, StringRef TempDir, if (TempDir.empty()) return; // User asked to save temps, let dump the bitcode file after import. - std::string SaveTempPath = (TempDir + llvm::utostr(count) + Suffix).str(); + std::string SaveTempPath = (TempDir + llvm::Twine(count) + Suffix).str(); std::error_code EC; raw_fd_ostream OS(SaveTempPath, EC, sys::fs::F_None); if (EC) diff --git a/lib/Support/ARMAttributeParser.cpp b/lib/Support/ARMAttributeParser.cpp index 3d800eb7a96c4..e39bddc4e8f22 100644 --- a/lib/Support/ARMAttributeParser.cpp +++ b/lib/Support/ARMAttributeParser.cpp @@ -666,7 +666,7 @@ void ARMAttributeParser::ParseSubsection(const uint8_t *Data, uint32_t Length) { ParseIndexList(Data, Offset, Indicies); break; default: - errs() << "unrecognised tag: 0x" << utohexstr(Tag) << '\n'; + errs() << "unrecognised tag: 0x" << Twine::utohexstr(Tag) << '\n'; return; } diff --git a/lib/TableGen/Main.cpp b/lib/TableGen/Main.cpp index fc9d0cc088856..be35f894cccd5 100644 --- a/lib/TableGen/Main.cpp +++ b/lib/TableGen/Main.cpp @@ -110,7 +110,7 @@ int llvm::TableGenMain(char *argv0, TableGenMainFn *MainFn) { return 1; if (ErrorsPrinted > 0) - return reportError(argv0, utostr(ErrorsPrinted) + " errors.\n"); + return reportError(argv0, Twine(ErrorsPrinted) + " errors.\n"); // Declare success. Out.keep(); diff --git a/lib/Target/NVPTX/NVPTXAsmPrinter.cpp b/lib/Target/NVPTX/NVPTXAsmPrinter.cpp index 2aa395642c400..753cfff4cdaef 100644 --- a/lib/Target/NVPTX/NVPTXAsmPrinter.cpp +++ b/lib/Target/NVPTX/NVPTXAsmPrinter.cpp @@ -1797,11 +1797,7 @@ void NVPTXAsmPrinter::printFPConstant(const ConstantFP *Fp, raw_ostream &O) { llvm_unreachable("unsupported fp type"); APInt API = APF.bitcastToAPInt(); - std::string hexstr(utohexstr(API.getZExtValue())); - O << lead; - if (hexstr.length() < numHex) - O << std::string(numHex - hexstr.length(), '0'); - O << utohexstr(API.getZExtValue()); + O << lead << format_hex_no_prefix(API.getZExtValue(), numHex, /*Upper=*/true); } void NVPTXAsmPrinter::printScalarConstant(const Constant *CPV, raw_ostream &O) { diff --git a/lib/Target/NVPTX/NVPTXMCExpr.cpp b/lib/Target/NVPTX/NVPTXMCExpr.cpp index 86a28f7d0700a..a754a6a36dab7 100644 --- a/lib/Target/NVPTX/NVPTXMCExpr.cpp +++ b/lib/Target/NVPTX/NVPTXMCExpr.cpp @@ -11,6 +11,7 @@ #include "llvm/ADT/StringExtras.h" #include "llvm/MC/MCAssembler.h" #include "llvm/MC/MCContext.h" +#include "llvm/Support/Format.h" using namespace llvm; #define DEBUG_TYPE "nvptx-mcexpr" @@ -47,10 +48,7 @@ void NVPTXFloatMCExpr::printImpl(raw_ostream &OS, const MCAsmInfo *MAI) const { } APInt API = APF.bitcastToAPInt(); - std::string HexStr(utohexstr(API.getZExtValue())); - if (HexStr.length() < NumHex) - OS << std::string(NumHex - HexStr.length(), '0'); - OS << utohexstr(API.getZExtValue()); + OS << format_hex_no_prefix(API.getZExtValue(), NumHex, /*Upper=*/true); } const NVPTXGenericMCSymbolRefExpr* diff --git a/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp b/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp index d19463ccb51f0..204d97cbdd443 100644 --- a/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp +++ b/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp @@ -190,7 +190,7 @@ void WebAssemblyAsmPrinter::EmitInstruction(const MachineInstr *MI) { if (isVerbose()) { OutStreamer->AddComment("fallthrough-return: $pop" + - utostr(MFI->getWARegStackId( + Twine(MFI->getWARegStackId( MFI->getWAReg(MI->getOperand(0).getReg())))); OutStreamer->AddBlankLine(); } diff --git a/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp b/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp index 9451330740598..caffc03339c4e 100644 --- a/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp +++ b/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp @@ -90,8 +90,7 @@ void promoteTypeIds(Module &M, StringRef ModuleId) { if (isa(MD) && cast(MD)->isDistinct()) { Metadata *&GlobalMD = LocalToGlobal[MD]; if (!GlobalMD) { - std::string NewName = - (to_string(LocalToGlobal.size()) + ModuleId).str(); + std::string NewName = (Twine(LocalToGlobal.size()) + ModuleId).str(); GlobalMD = MDString::get(M.getContext(), NewName); } diff --git a/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/lib/Transforms/Instrumentation/AddressSanitizer.cpp index 8328d40319411..8e39f24d819ce 100644 --- a/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -2702,9 +2702,10 @@ void FunctionStackPoisoner::copyArgsPassedByValToAllocas() { unsigned Align = Arg.getParamAlignment(); if (Align == 0) Align = DL.getABITypeAlignment(Ty); - const std::string &Name = Arg.hasName() ? Arg.getName().str() : - "Arg" + llvm::to_string(Arg.getArgNo()); - AllocaInst *AI = IRB.CreateAlloca(Ty, nullptr, Twine(Name) + ".byval"); + AllocaInst *AI = IRB.CreateAlloca( + Ty, nullptr, + (Arg.hasName() ? Arg.getName() : "Arg" + Twine(Arg.getArgNo())) + + ".byval"); AI->setAlignment(Align); Arg.replaceAllUsesWith(AI); diff --git a/lib/Transforms/Scalar/GVNSink.cpp b/lib/Transforms/Scalar/GVNSink.cpp index 814a62cd7d65a..bf92e43c47154 100644 --- a/lib/Transforms/Scalar/GVNSink.cpp +++ b/lib/Transforms/Scalar/GVNSink.cpp @@ -641,7 +641,7 @@ Optional GVNSink::analyzeInstructionForSinking( DenseMap VNums; for (auto *I : Insts) { uint32_t N = VN.lookupOrAdd(I); - DEBUG(dbgs() << " VN=" << utohexstr(N) << " for" << *I << "\n"); + DEBUG(dbgs() << " VN=" << Twine::utohexstr(N) << " for" << *I << "\n"); if (N == ~0U) return None; VNums[N]++; diff --git a/tools/llvm-cov/CodeCoverage.cpp b/tools/llvm-cov/CodeCoverage.cpp index 00258f2a1b333..c5ea50bff2730 100644 --- a/tools/llvm-cov/CodeCoverage.cpp +++ b/tools/llvm-cov/CodeCoverage.cpp @@ -353,13 +353,14 @@ std::unique_ptr CodeCoverageTool::load() { auto Coverage = std::move(CoverageOrErr.get()); unsigned Mismatched = Coverage->getMismatchedCount(); if (Mismatched) { - warning(utostr(Mismatched) + " functions have mismatched data"); + warning(Twine(Mismatched) + " functions have mismatched data"); if (ViewOpts.Debug) { for (const auto &HashMismatch : Coverage->getHashMismatches()) errs() << "hash-mismatch: " << "No profile record found for '" << HashMismatch.first << "'" - << " with hash = 0x" << utohexstr(HashMismatch.second) << "\n"; + << " with hash = 0x" << Twine::utohexstr(HashMismatch.second) + << '\n'; for (const auto &CounterMismatch : Coverage->getCounterMismatches()) errs() << "counter-mismatch: " diff --git a/tools/llvm-objdump/llvm-objdump.cpp b/tools/llvm-objdump/llvm-objdump.cpp index 79204c6e95332..3a9112423cff1 100644 --- a/tools/llvm-objdump/llvm-objdump.cpp +++ b/tools/llvm-objdump/llvm-objdump.cpp @@ -1643,7 +1643,7 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) { outs() << " <" << TargetName; uint64_t Disp = Target - TargetAddress; if (Disp) - outs() << "+0x" << utohexstr(Disp); + outs() << "+0x" << Twine::utohexstr(Disp); outs() << '>'; } } diff --git a/tools/llvm-readobj/COFFDumper.cpp b/tools/llvm-readobj/COFFDumper.cpp index cf0228b1f10e0..28c88b66791ff 100644 --- a/tools/llvm-readobj/COFFDumper.cpp +++ b/tools/llvm-readobj/COFFDumper.cpp @@ -767,7 +767,7 @@ void COFFDumper::printRVATable(uint64_t TableVA, uint64_t Count, for (uintptr_t I = TableStart; I < TableEnd; I += EntrySize) { uint32_t RVA = *reinterpret_cast(I); raw_ostream &OS = W.startLine(); - OS << "0x" << utohexstr(Obj->getImageBase() + RVA); + OS << "0x" << Twine::utohexstr(Obj->getImageBase() + RVA); if (PrintExtra) PrintExtra(OS, reinterpret_cast(I)); OS << '\n'; diff --git a/tools/llvm-readobj/ELFDumper.cpp b/tools/llvm-readobj/ELFDumper.cpp index f2b9369043931..5605eaea7555d 100644 --- a/tools/llvm-readobj/ELFDumper.cpp +++ b/tools/llvm-readobj/ELFDumper.cpp @@ -1900,8 +1900,8 @@ template <> void ELFDumper>::printAttributes() { ArrayRef Contents = unwrapOrError(Obj->getSectionContents(&Sec)); if (Contents[0] != ARMBuildAttrs::Format_Version) { - errs() << "unrecognised FormatVersion: 0x" << utohexstr(Contents[0]) - << '\n'; + errs() << "unrecognised FormatVersion: 0x" + << Twine::utohexstr(Contents[0]) << '\n'; continue; } diff --git a/tools/yaml2obj/yaml2obj.cpp b/tools/yaml2obj/yaml2obj.cpp index 3e2a5ca7ae0ff..0f21d7a54708a 100644 --- a/tools/yaml2obj/yaml2obj.cpp +++ b/tools/yaml2obj/yaml2obj.cpp @@ -65,7 +65,7 @@ static int convertYAML(yaml::Input &YIn, raw_ostream &Out) { } } while (YIn.nextDocument()); - error("yaml2obj: Cannot find the " + utostr(DocNum) + + error("yaml2obj: Cannot find the " + Twine(DocNum) + llvm::getOrdinalSuffix(DocNum) + " document"); } diff --git a/utils/TableGen/CodeGenDAGPatterns.cpp b/utils/TableGen/CodeGenDAGPatterns.cpp index 7755cd1be3556..64cf23314497b 100644 --- a/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/utils/TableGen/CodeGenDAGPatterns.cpp @@ -1873,7 +1873,7 @@ TreePatternNode *TreePatternNode::InlinePatternFragments(TreePattern &TP) { // Verify that we are passing the right number of operands. if (Frag->getNumArgs() != Children.size()) { TP.error("'" + Op->getName() + "' fragment requires " + - utostr(Frag->getNumArgs()) + " operands!"); + Twine(Frag->getNumArgs()) + " operands!"); return nullptr; } @@ -2195,7 +2195,7 @@ bool TreePatternNode::ApplyTypeConstraints(TreePattern &TP, bool NotRegisters) { SignBitAndAbove == 1) continue; - TP.error("Integer value '" + itostr(II->getValue()) + + TP.error("Integer value '" + Twine(II->getValue()) + "' is out of range for type '" + getEnumName(VT) + "'!"); break; } @@ -2245,9 +2245,8 @@ bool TreePatternNode::ApplyTypeConstraints(TreePattern &TP, bool NotRegisters) { MadeChange |= UpdateNodeType(i, Int->IS.RetVTs[i], TP); if (getNumChildren() != NumParamVTs + 1) { - TP.error("Intrinsic '" + Int->Name + "' expects " + - utostr(NumParamVTs) + " operands, not " + - utostr(getNumChildren() - 1) + " operands!"); + TP.error("Intrinsic '" + Int->Name + "' expects " + Twine(NumParamVTs) + + " operands, not " + Twine(getNumChildren() - 1) + " operands!"); return false; } @@ -2271,7 +2270,7 @@ bool TreePatternNode::ApplyTypeConstraints(TreePattern &TP, bool NotRegisters) { if (NI.getNumOperands() >= 0 && getNumChildren() != (unsigned)NI.getNumOperands()) { TP.error(getOperator()->getName() + " node requires exactly " + - itostr(NI.getNumOperands()) + " operands!"); + Twine(NI.getNumOperands()) + " operands!"); return false; } @@ -2340,7 +2339,7 @@ bool TreePatternNode::ApplyTypeConstraints(TreePattern &TP, bool NotRegisters) { TreePatternNode *SubIdxChild = getChild(I + 1); if (!isOperandClass(SubIdxChild, "SubRegIndex")) { TP.error("REG_SEQUENCE requires a SubRegIndex for operand " + - itostr(I + 1) + "!"); + Twine(I + 1) + "!"); return false; } } @@ -3514,7 +3513,7 @@ const DAGInstruction &CodeGenDAGPatterns::parseInstructionPattern( CGIOperandList::OperandInfo &Op = CGI.Operands[i]; const std::string &OpName = Op.Name; if (OpName.empty()) - I->error("Operand #" + utostr(i) + " in operands list has no name!"); + I->error("Operand #" + Twine(i) + " in operands list has no name!"); if (!InstInputsCheck.count(OpName)) { // If this is an operand with a DefaultOps set filled in, we can ignore diff --git a/utils/TableGen/DFAPacketizerEmitter.cpp b/utils/TableGen/DFAPacketizerEmitter.cpp index f879a5bae2151..1c1932a0144a1 100644 --- a/utils/TableGen/DFAPacketizerEmitter.cpp +++ b/utils/TableGen/DFAPacketizerEmitter.cpp @@ -283,10 +283,10 @@ void dbgsInsnClass(const std::vector &InsnClass) { if (i > 0) { DEBUG(dbgs() << ", "); } - DEBUG(dbgs() << "0x" << utohexstr(InsnClass[i])); + DEBUG(dbgs() << "0x" << Twine::utohexstr(InsnClass[i])); } DFAInput InsnInput = getDFAInsnInput(InsnClass); - DEBUG(dbgs() << " (input: 0x" << utohexstr(InsnInput) << ")"); + DEBUG(dbgs() << " (input: 0x" << Twine::utohexstr(InsnInput) << ")"); } // @@ -301,7 +301,7 @@ void dbgsStateInfo(const std::set &stateInfo) { if (i > 0) { DEBUG(dbgs() << ", "); } - DEBUG(dbgs() << "0x" << utohexstr(thisState)); + DEBUG(dbgs() << "0x" << Twine::utohexstr(thisState)); } } @@ -361,7 +361,7 @@ void State::AddInsnClass(std::vector &InsnClass, DenseSet VisitedResourceStates; - DEBUG(dbgs() << " thisState: 0x" << utohexstr(thisState) << "\n"); + DEBUG(dbgs() << " thisState: 0x" << Twine::utohexstr(thisState) << "\n"); AddInsnClassStages(InsnClass, ComboBitToBitsMap, numstages - 1, numstages, thisState, thisState, @@ -381,7 +381,7 @@ void State::AddInsnClassStages(std::vector &InsnClass, DEBUG({ dbgsIndent((1 + numstages - chkstage) << 1); dbgs() << "AddInsnClassStages " << chkstage << " (0x" - << utohexstr(thisStage) << ") from "; + << Twine::utohexstr(thisStage) << ") from "; dbgsInsnClass(InsnClass); dbgs() << "\n"; }); @@ -395,9 +395,10 @@ void State::AddInsnClassStages(std::vector &InsnClass, if (resourceMask & thisStage) { unsigned combo = ComboBitToBitsMap[resourceMask]; if (combo && ((~prevState & combo) != combo)) { - DEBUG(dbgs() << "\tSkipped Add 0x" << utohexstr(prevState) - << " - combo op 0x" << utohexstr(resourceMask) - << " (0x" << utohexstr(combo) <<") cannot be scheduled\n"); + DEBUG(dbgs() << "\tSkipped Add 0x" << Twine::utohexstr(prevState) + << " - combo op 0x" << Twine::utohexstr(resourceMask) + << " (0x" << Twine::utohexstr(combo) + << ") cannot be scheduled\n"); continue; } // @@ -407,11 +408,11 @@ void State::AddInsnClassStages(std::vector &InsnClass, unsigned ResultingResourceState = prevState | resourceMask | combo; DEBUG({ dbgsIndent((2 + numstages - chkstage) << 1); - dbgs() << "0x" << utohexstr(prevState) - << " | 0x" << utohexstr(resourceMask); + dbgs() << "0x" << Twine::utohexstr(prevState) << " | 0x" + << Twine::utohexstr(resourceMask); if (combo) - dbgs() << " | 0x" << utohexstr(combo); - dbgs() << " = 0x" << utohexstr(ResultingResourceState) << " "; + dbgs() << " | 0x" << Twine::utohexstr(combo); + dbgs() << " = 0x" << Twine::utohexstr(ResultingResourceState) << " "; }); // @@ -433,7 +434,7 @@ void State::AddInsnClassStages(std::vector &InsnClass, VisitedResourceStates.insert(ResultingResourceState); PossibleStates.insert(ResultingResourceState); DEBUG(dbgs() << "\tResultingResourceState: 0x" - << utohexstr(ResultingResourceState) << "\n"); + << Twine::utohexstr(ResultingResourceState) << "\n"); } else { DEBUG(dbgs() << "\tSkipped Add - state already seen\n"); } @@ -493,9 +494,10 @@ bool State::canMaybeAddInsnClass(std::vector &InsnClass, // These cases are caught later in AddInsnClass. unsigned combo = ComboBitToBitsMap[InsnClass[i]]; if (combo && ((~resources & combo) != combo)) { - DEBUG(dbgs() << "\tSkipped canMaybeAdd 0x" << utohexstr(resources) - << " - combo op 0x" << utohexstr(InsnClass[i]) - << " (0x" << utohexstr(combo) <<") cannot be scheduled\n"); + DEBUG(dbgs() << "\tSkipped canMaybeAdd 0x" + << Twine::utohexstr(resources) << " - combo op 0x" + << Twine::utohexstr(InsnClass[i]) << " (0x" + << Twine::utohexstr(combo) << ") cannot be scheduled\n"); available = false; break; } @@ -573,9 +575,8 @@ void DFA::writeTableAndAPI(raw_ostream &OS, const std::string &TargetName, for (State::TransitionMap::iterator II = SI->Transitions.begin(), IE = SI->Transitions.end(); II != IE; ++II) { - OS << "{0x" << utohexstr(getDFAInsnInput(II->first)) << ", " - << II->second->stateNum - << "},\t"; + OS << "{0x" << Twine::utohexstr(getDFAInsnInput(II->first)) << ", " + << II->second->stateNum << "},\t"; } ValidTransitions += SI->Transitions.size(); @@ -668,8 +669,8 @@ int DFAPacketizerEmitter::collectAllFuncUnits( "Exceeded maximum number of representable resources"); unsigned FuncResources = (unsigned) (1U << j); FUNameToBitsMap[FUs[j]->getName()] = FuncResources; - DEBUG(dbgs() << " " << FUs[j]->getName() - << ":0x" << utohexstr(FuncResources)); + DEBUG(dbgs() << " " << FUs[j]->getName() << ":0x" + << Twine::utohexstr(FuncResources)); } if (((int) numFUs) > maxFUs) { maxFUs = numFUs; @@ -713,20 +714,20 @@ int DFAPacketizerEmitter::collectAllComboFuncs( const std::string &ComboFuncName = ComboFunc->getName(); unsigned ComboBit = FUNameToBitsMap[ComboFuncName]; unsigned ComboResources = ComboBit; - DEBUG(dbgs() << " combo: " << ComboFuncName - << ":0x" << utohexstr(ComboResources) << "\n"); + DEBUG(dbgs() << " combo: " << ComboFuncName << ":0x" + << Twine::utohexstr(ComboResources) << "\n"); for (unsigned k = 0, M = FuncList.size(); k < M; ++k) { std::string FuncName = FuncList[k]->getName(); unsigned FuncResources = FUNameToBitsMap[FuncName]; - DEBUG(dbgs() << " " << FuncName - << ":0x" << utohexstr(FuncResources) << "\n"); + DEBUG(dbgs() << " " << FuncName << ":0x" + << Twine::utohexstr(FuncResources) << "\n"); ComboResources |= FuncResources; } ComboBitToBitsMap[ComboBit] = ComboResources; numCombos++; DEBUG(dbgs() << " => combo bits: " << ComboFuncName << ":0x" - << utohexstr(ComboBit) << " = 0x" - << utohexstr(ComboResources) << "\n"); + << Twine::utohexstr(ComboBit) << " = 0x" + << Twine::utohexstr(ComboResources) << "\n"); } } return numCombos; @@ -781,7 +782,7 @@ int DFAPacketizerEmitter::collectOneInsnClass(const std::string &ProcName, dbglen += 8; DEBUG(dbgs() << "\t"); } - DEBUG(dbgs() << " (bits: 0x" << utohexstr(UnitBitValue) << ")\n"); + DEBUG(dbgs() << " (bits: 0x" << Twine::utohexstr(UnitBitValue) << ")\n"); } if (!UnitBits.empty()) diff --git a/utils/TableGen/IntrinsicEmitter.cpp b/utils/TableGen/IntrinsicEmitter.cpp index 37e024b1665ed..ba793ad9b938b 100644 --- a/utils/TableGen/IntrinsicEmitter.cpp +++ b/utils/TableGen/IntrinsicEmitter.cpp @@ -448,7 +448,7 @@ void IntrinsicEmitter::EmitGenerator(const CodeGenIntrinsicTable &Ints, // If the entry fit in the table, just emit it. if (FixedEncodings[i] != ~0U) { - OS << "0x" << utohexstr(FixedEncodings[i]) << ", "; + OS << "0x" << Twine::utohexstr(FixedEncodings[i]) << ", "; continue; }