[TargetLoweringObjectFileImpl] Use llvm::transform
authorOrivej Desh <orivej@gmx.fr>
Mon, 25 May 2020 03:55:08 +0000 (20:55 -0700)
committerFangrui Song <maskray@google.com>
Mon, 25 May 2020 03:59:24 +0000 (20:59 -0700)
Fixes a build issue with libc++ configured with _LIBCPP_RAW_ITERATORS (ADL not effective)

```
llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp:1602:3: error: no matching function for call to 'transform'
  transform(HexString.begin(), HexString.end(), HexString.begin(), tolower);
  ^~~~~~~~~
```

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D80475

llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp

index 5a5cde4..38a0223 100644 (file)
@@ -1746,7 +1746,7 @@ const MCExpr *TargetLoweringObjectFileCOFF::lowerRelativeReference(
 static std::string APIntToHexString(const APInt &AI) {
   unsigned Width = (AI.getBitWidth() / 8) * 2;
   std::string HexString = AI.toString(16, /*Signed=*/false);
-  transform(HexString.begin(), HexString.end(), HexString.begin(), tolower);
+  llvm::transform(HexString, HexString.begin(), tolower);
   unsigned Size = HexString.size();
   assert(Width >= Size && "hex string is too large!");
   HexString.insert(HexString.begin(), Width - Size, '0');