Skip to content

Commit b90f641

Browse files
authored
merge main into amd-staging (llvm#1858)
2 parents e00ef68 + cbb000c commit b90f641

File tree

71 files changed

+570
-413
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+570
-413
lines changed

clang/lib/Format/TokenAnnotator.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3095,10 +3095,14 @@ class AnnotatingParser {
30953095

30963096
// This catches some cases where evaluation order is used as control flow:
30973097
// aaa && aaa->f();
3098+
// Or expressions like:
3099+
// width * height * length
30983100
if (NextToken->Tok.isAnyIdentifier()) {
30993101
const FormatToken *NextNextToken = NextToken->getNextNonComment();
3100-
if (NextNextToken && NextNextToken->is(tok::arrow))
3102+
if (NextNextToken && (NextNextToken->is(tok::arrow) ||
3103+
NextNextToken->isPointerOrReference())) {
31013104
return TT_BinaryOperator;
3105+
}
31023106
}
31033107

31043108
// It is very unlikely that we are going to find a pointer or reference type

clang/lib/Format/UnwrappedLineParser.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2089,7 +2089,13 @@ void UnwrappedLineParser::parseStructuralElement(
20892089
parseSquare();
20902090
break;
20912091
case tok::kw_new:
2092-
parseNew();
2092+
if (Style.isCSharp() &&
2093+
(Tokens->peekNextToken()->isAccessSpecifierKeyword() ||
2094+
(Previous && Previous->isAccessSpecifierKeyword()))) {
2095+
nextToken();
2096+
} else {
2097+
parseNew();
2098+
}
20932099
break;
20942100
case tok::kw_switch:
20952101
if (Style.isJava())

clang/unittests/Format/FormatTestCSharp.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,13 @@ TEST_F(FormatTestCSharp, CSharpNewOperator) {
689689
Style);
690690
}
691691

692+
TEST_F(FormatTestCSharp, NewModifier) {
693+
verifyFormat("public new class NestedC {\n"
694+
" public int x = 100;\n"
695+
"}",
696+
getLLVMStyle(FormatStyle::LK_CSharp));
697+
}
698+
692699
TEST_F(FormatTestCSharp, CSharpLambdas) {
693700
FormatStyle GoogleStyle = getGoogleStyle(FormatStyle::LK_CSharp);
694701
FormatStyle MicrosoftStyle = getMicrosoftStyle(FormatStyle::LK_CSharp);

clang/unittests/Format/TokenAnnotatorTest.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,11 @@ TEST_F(TokenAnnotatorTest, UnderstandsUsesOfStarAndAmp) {
395395
EXPECT_TOKEN(Tokens[3], tok::kw_operator, TT_FunctionDeclarationName);
396396
EXPECT_TOKEN(Tokens[5], tok::star, TT_PointerOrReference);
397397
EXPECT_TOKEN(Tokens[6], tok::l_paren, TT_FunctionDeclarationLParen);
398+
399+
Tokens = annotate("int8_t *a = MacroCall(int8_t, width * height * length);");
400+
ASSERT_EQ(Tokens.size(), 16u) << Tokens;
401+
EXPECT_TOKEN(Tokens[9], tok::star, TT_BinaryOperator);
402+
EXPECT_TOKEN(Tokens[11], tok::star, TT_BinaryOperator);
398403
}
399404

400405
TEST_F(TokenAnnotatorTest, UnderstandsUsesOfPlusAndMinus) {
@@ -3109,6 +3114,17 @@ TEST_F(TokenAnnotatorTest, CSharpGenericTypeConstraint) {
31093114
EXPECT_TOKEN(Tokens[18], tok::r_brace, TT_NamespaceRBrace);
31103115
}
31113116

3117+
TEST_F(TokenAnnotatorTest, CSharpNewModifier) {
3118+
auto Tokens = annotate("new public class NestedC {\n"
3119+
" public int x = 100;\n"
3120+
"}",
3121+
getGoogleStyle(FormatStyle::LK_CSharp));
3122+
ASSERT_EQ(Tokens.size(), 13u) << Tokens;
3123+
EXPECT_TOKEN(Tokens[3], tok::identifier, TT_ClassHeadName);
3124+
EXPECT_TOKEN(Tokens[4], tok::l_brace, TT_ClassLBrace);
3125+
EXPECT_TOKEN(Tokens[11], tok::r_brace, TT_ClassRBrace);
3126+
}
3127+
31123128
TEST_F(TokenAnnotatorTest, UnderstandsLabels) {
31133129
auto Tokens = annotate("{ x: break; }");
31143130
ASSERT_EQ(Tokens.size(), 7u) << Tokens;

llvm/docs/ReleaseNotes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,9 @@ Changes to the C API
210210
reading `ConstantDataArray` values without needing extra `LLVMValueRef`s for
211211
individual elements.
212212

213+
* Added ``LLVMDIBuilderCreateEnumeratorOfArbitraryPrecision`` for creating
214+
debugging metadata of enumerators larger than 64 bits.
215+
213216
Changes to the CodeGen infrastructure
214217
-------------------------------------
215218

llvm/include/llvm-c/DebugInfo.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,19 @@ LLVMMetadataRef LLVMDIBuilderCreateEnumerator(LLVMDIBuilderRef Builder,
634634
int64_t Value,
635635
LLVMBool IsUnsigned);
636636

637+
/**
638+
* Create debugging information entry for an enumerator of arbitrary precision.
639+
* @param Builder The DIBuilder.
640+
* @param Name Enumerator name.
641+
* @param NameLen Length of enumerator name.
642+
* @param SizeInBits Number of bits of the value.
643+
* @param Words The words that make up the value.
644+
* @param IsUnsigned True if the value is unsigned.
645+
*/
646+
LLVMMetadataRef LLVMDIBuilderCreateEnumeratorOfArbitraryPrecision(
647+
LLVMDIBuilderRef Builder, const char *Name, size_t NameLen,
648+
uint64_t SizeInBits, const uint64_t Words[], LLVMBool IsUnsigned);
649+
637650
/**
638651
* Create debugging information entry for an enumeration.
639652
* \param Builder The DIBuilder.

llvm/include/llvm/IR/ModuleSummaryIndex.h

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "llvm/IR/GlobalValue.h"
2929
#include "llvm/IR/Module.h"
3030
#include "llvm/Support/Allocator.h"
31+
#include "llvm/Support/InterleavedRange.h"
3132
#include "llvm/Support/MathExtras.h"
3233
#include "llvm/Support/ScaledNumber.h"
3334
#include "llvm/Support/StringSaver.h"
@@ -342,22 +343,8 @@ struct CallsiteInfo {
342343

343344
inline raw_ostream &operator<<(raw_ostream &OS, const CallsiteInfo &SNI) {
344345
OS << "Callee: " << SNI.Callee;
345-
bool First = true;
346-
OS << " Clones: ";
347-
for (auto V : SNI.Clones) {
348-
if (!First)
349-
OS << ", ";
350-
First = false;
351-
OS << V;
352-
}
353-
First = true;
354-
OS << " StackIds: ";
355-
for (auto Id : SNI.StackIdIndices) {
356-
if (!First)
357-
OS << ", ";
358-
First = false;
359-
OS << Id;
360-
}
346+
OS << " Clones: " << llvm::interleaved(SNI.Clones);
347+
OS << " StackIds: " << llvm::interleaved(SNI.StackIdIndices);
361348
return OS;
362349
}
363350

llvm/include/llvm/TableGen/DirectiveEmitter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class BaseRecord {
116116
std::string getFormattedName() const {
117117
StringRef Name = Def->getValueAsString("name");
118118
std::string N = Name.str();
119-
std::replace(N.begin(), N.end(), ' ', '_');
119+
llvm::replace(N, ' ', '_');
120120
return N;
121121
}
122122

llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ StringRef CodeViewDebug::getFullFilepath(const DIFile *File) {
164164
// Canonicalize the path. We have to do it textually because we may no longer
165165
// have access the file in the filesystem.
166166
// First, replace all slashes with backslashes.
167-
std::replace(Filepath.begin(), Filepath.end(), '/', '\\');
167+
llvm::replace(Filepath, '/', '\\');
168168

169169
// Remove all "\.\" with "\".
170170
size_t Cursor = 0;

llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3956,7 +3956,7 @@ DwarfDebug::getMD5AsBytes(const DIFile *File) const {
39563956
// An MD5 checksum is 16 bytes.
39573957
std::string ChecksumString = fromHex(Checksum->Value);
39583958
MD5::MD5Result CKMem;
3959-
std::copy(ChecksumString.begin(), ChecksumString.end(), CKMem.data());
3959+
llvm::copy(ChecksumString, CKMem.data());
39603960
return CKMem;
39613961
}
39623962

llvm/lib/CodeGen/GlobalISel/CallLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ mergeVectorRegsToResultRegs(MachineIRBuilder &B, ArrayRef<Register> DstRegs,
354354
int NumDst = LCMTy.getSizeInBits() / LLTy.getSizeInBits();
355355

356356
SmallVector<Register, 8> PadDstRegs(NumDst);
357-
std::copy(DstRegs.begin(), DstRegs.end(), PadDstRegs.begin());
357+
llvm::copy(DstRegs, PadDstRegs.begin());
358358

359359
// Create the excess dead defs for the unmerge.
360360
for (int I = DstRegs.size(); I != NumDst; ++I)

llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -937,8 +937,7 @@ class TransferTracker {
937937
assert(ActiveVLocIt != ActiveVLocs.end());
938938

939939
// Update all instances of Src in the variable's tracked values to Dst.
940-
std::replace(ActiveVLocIt->second.Ops.begin(),
941-
ActiveVLocIt->second.Ops.end(), SrcOp, DstOp);
940+
llvm::replace(ActiveVLocIt->second.Ops, SrcOp, DstOp);
942941

943942
auto &[Var, DILoc] = DVMap.lookupDVID(VarID);
944943
MachineInstr *MI = MTracker->emitLoc(ActiveVLocIt->second.Ops, Var, DILoc,

llvm/lib/CodeGen/LiveDebugVariables.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class DbgVariableValue {
134134
LocNoCount = LocNoVec.size();
135135
if (LocNoCount > 0) {
136136
LocNos = std::make_unique<unsigned[]>(LocNoCount);
137-
std::copy(LocNoVec.begin(), LocNoVec.end(), loc_nos_begin());
137+
llvm::copy(LocNoVec, loc_nos_begin());
138138
}
139139
} else {
140140
LLVM_DEBUG(dbgs() << "Found debug value with 64+ unique machine "

llvm/lib/CodeGen/LiveVariables.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ void LiveVariables::recomputeForSingleDefVirtReg(Register Reg) {
764764
void LiveVariables::replaceKillInstruction(Register Reg, MachineInstr &OldMI,
765765
MachineInstr &NewMI) {
766766
VarInfo &VI = getVarInfo(Reg);
767-
std::replace(VI.Kills.begin(), VI.Kills.end(), &OldMI, &NewMI);
767+
llvm::replace(VI.Kills, &OldMI, &NewMI);
768768
}
769769

770770
/// removeVirtualRegistersKilled - Remove all killed info for the specified

llvm/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ class SDDbgValue {
165165
IsVariadic(IsVariadic) {
166166
assert(IsVariadic || L.size() == 1);
167167
assert(!(IsVariadic && IsIndirect));
168-
std::copy(L.begin(), L.end(), LocationOps);
169-
std::copy(Dependencies.begin(), Dependencies.end(), AdditionalDependencies);
168+
llvm::copy(L, LocationOps);
169+
llvm::copy(Dependencies, AdditionalDependencies);
170170
}
171171

172172
// We allocate arrays with the BumpPtrAllocator and never free or copy them,

llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2713,8 +2713,7 @@ void SelectionDAGISel::UpdateChains(
27132713
assert(ChainVal.getValueType() == MVT::Other && "Not a chain?");
27142714
SelectionDAG::DAGNodeDeletedListener NDL(
27152715
*CurDAG, [&](SDNode *N, SDNode *E) {
2716-
std::replace(ChainNodesMatched.begin(), ChainNodesMatched.end(), N,
2717-
static_cast<SDNode *>(nullptr));
2716+
llvm::replace(ChainNodesMatched, N, static_cast<SDNode *>(nullptr));
27182717
});
27192718
if (ChainNode->getOpcode() != ISD::TokenFactor)
27202719
ReplaceUses(ChainVal, InputChain);

llvm/lib/DebugInfo/LogicalView/Core/LVSupport.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ LVStringPool &llvm::logicalview::getStringPool() { return StringPool; }
3131
std::string llvm::logicalview::transformPath(StringRef Path) {
3232
std::string Name(Path);
3333
std::transform(Name.begin(), Name.end(), Name.begin(), tolower);
34-
std::replace(Name.begin(), Name.end(), '\\', '/');
34+
llvm::replace(Name, '\\', '/');
3535

3636
// Remove all duplicate slashes.
3737
size_t Pos = 0;

llvm/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ std::string PDBSymbolCompiland::getSourceFileFullPath() const {
6363
auto Len = EnvWorkingDir.length();
6464
if (EnvWorkingDir[Len - 1] != '/' && EnvWorkingDir[Len - 1] != '\\') {
6565
std::string Path = EnvWorkingDir + "\\" + EnvSrc;
66-
std::replace(Path.begin(), Path.end(), '/', '\\');
66+
llvm::replace(Path, '/', '\\');
6767
// We will return it as full path if we can't find a better one.
6868
if (sys::path::is_absolute(Path))
6969
SourceFileFullPath = Path;

llvm/lib/ExecutionEngine/ExecutionEngine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ void *ArgvArray::reset(LLVMContext &C, ExecutionEngine *EE,
347347
LLVM_DEBUG(dbgs() << "JIT: ARGV[" << i << "] = " << (void *)Dest.get()
348348
<< "\n");
349349

350-
std::copy(InputArgv[i].begin(), InputArgv[i].end(), Dest.get());
350+
llvm::copy(InputArgv[i], Dest.get());
351351
Dest[Size-1] = 0;
352352

353353
// Endian safe: Array[i] = (PointerTy)Dest;

llvm/lib/IR/AsmWriter.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5110,13 +5110,9 @@ void AssemblyWriter::printUseListOrder(const Value *V,
51105110
Out << " ";
51115111
writeOperand(V, true);
51125112
}
5113-
Out << ", { ";
51145113

51155114
assert(Shuffle.size() >= 2 && "Shuffle too small");
5116-
Out << Shuffle[0];
5117-
for (unsigned I = 1, E = Shuffle.size(); I != E; ++I)
5118-
Out << ", " << Shuffle[I];
5119-
Out << " }\n";
5115+
Out << ", { " << llvm::interleaved(Shuffle) << " }\n";
51205116
}
51215117

51225118
void AssemblyWriter::printUseLists(const Function *F) {

llvm/lib/IR/DebugInfo.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
#include "llvm-c/DebugInfo.h"
1515
#include "LLVMContextImpl.h"
16+
#include "llvm/ADT/APSInt.h"
1617
#include "llvm/ADT/DenseMap.h"
1718
#include "llvm/ADT/DenseSet.h"
1819
#include "llvm/ADT/STLExtras.h"
@@ -1313,6 +1314,15 @@ LLVMMetadataRef LLVMDIBuilderCreateEnumerator(LLVMDIBuilderRef Builder,
13131314
IsUnsigned != 0));
13141315
}
13151316

1317+
LLVMMetadataRef LLVMDIBuilderCreateEnumeratorOfArbitraryPrecision(
1318+
LLVMDIBuilderRef Builder, const char *Name, size_t NameLen,
1319+
uint64_t SizeInBits, const uint64_t Words[], LLVMBool IsUnsigned) {
1320+
uint64_t NumWords = (SizeInBits + 63) / 64;
1321+
return wrap(unwrap(Builder)->createEnumerator(
1322+
{Name, NameLen},
1323+
APSInt(APInt(SizeInBits, ArrayRef(Words, NumWords)), IsUnsigned != 0)));
1324+
}
1325+
13161326
LLVMMetadataRef LLVMDIBuilderCreateEnumerationType(
13171327
LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
13181328
size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,

llvm/lib/IR/Instructions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ void CallBrInst::init(FunctionType *FTy, Value *Fn, BasicBlock *Fallthrough,
936936

937937
// Set operands in order of their index to match use-list-order
938938
// prediction.
939-
std::copy(Args.begin(), Args.end(), op_begin());
939+
llvm::copy(Args, op_begin());
940940
NumIndirectDests = IndirectDests.size();
941941
setDefaultDest(Fallthrough);
942942
for (unsigned i = 0; i != NumIndirectDests; ++i)

llvm/lib/ObjCopy/COFF/COFFWriter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ void COFFWriter::writeSections() {
317317
uint8_t *Ptr = reinterpret_cast<uint8_t *>(Buf->getBufferStart()) +
318318
S.Header.PointerToRawData;
319319
ArrayRef<uint8_t> Contents = S.getContents();
320-
std::copy(Contents.begin(), Contents.end(), Ptr);
320+
llvm::copy(Contents, Ptr);
321321

322322
// For executable sections, pad the remainder of the raw data size with
323323
// 0xcc, which is int3 on x86.
@@ -355,7 +355,7 @@ template <class SymbolTy> void COFFWriter::writeSymbolStringTables() {
355355
// For file symbols, just write the string into the aux symbol slots,
356356
// assuming that the unwritten parts are initialized to zero in the memory
357357
// mapped file.
358-
std::copy(S.AuxFile.begin(), S.AuxFile.end(), Ptr);
358+
llvm::copy(S.AuxFile, Ptr);
359359
Ptr += S.Sym.NumberOfAuxSymbols * sizeof(SymbolTy);
360360
} else {
361361
// For other auxillary symbols, write their opaque payload into one symbol
@@ -364,7 +364,7 @@ template <class SymbolTy> void COFFWriter::writeSymbolStringTables() {
364364
// entry.
365365
for (const AuxSymbol &AuxSym : S.AuxData) {
366366
ArrayRef<uint8_t> Ref = AuxSym.getRef();
367-
std::copy(Ref.begin(), Ref.end(), Ptr);
367+
llvm::copy(Ref, Ptr);
368368
Ptr += sizeof(SymbolTy);
369369
}
370370
}

llvm/lib/ObjCopy/ELF/ELFObject.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ Error ELFSectionWriter<ELFT>::visit(const DecompressedSection &Sec) {
488488
"': " + toString(std::move(E)));
489489

490490
uint8_t *Buf = reinterpret_cast<uint8_t *>(Out.getBufferStart()) + Sec.Offset;
491-
std::copy(Decompressed.begin(), Decompressed.end(), Buf);
491+
llvm::copy(Decompressed, Buf);
492492

493493
return Error::success();
494494
}

llvm/lib/ObjCopy/MachO/MachOObjcopy.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ static void updateLoadCommandPayloadString(LoadCommand &LC, StringRef S) {
161161

162162
LC.MachOLoadCommand.load_command_data.cmdsize = NewCmdsize;
163163
LC.Payload.assign(NewCmdsize - sizeof(LCType), 0);
164-
std::copy(S.begin(), S.end(), LC.Payload.begin());
164+
llvm::copy(S, LC.Payload.begin());
165165
}
166166

167167
static LoadCommand buildRPathLoadCommand(StringRef Path) {
@@ -172,7 +172,7 @@ static LoadCommand buildRPathLoadCommand(StringRef Path) {
172172
RPathLC.cmdsize = alignTo(sizeof(MachO::rpath_command) + Path.size() + 1, 8);
173173
LC.MachOLoadCommand.rpath_command_data = RPathLC;
174174
LC.Payload.assign(RPathLC.cmdsize - sizeof(MachO::rpath_command), 0);
175-
std::copy(Path.begin(), Path.end(), LC.Payload.begin());
175+
llvm::copy(Path, LC.Payload.begin());
176176
return LC;
177177
}
178178

llvm/lib/ObjCopy/XCOFF/XCOFFWriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void XCOFFWriter::writeSections() {
7575
for (const Section &Sec : Obj.Sections) {
7676
uint8_t *Ptr = reinterpret_cast<uint8_t *>(Buf->getBufferStart()) +
7777
Sec.SectionHeader.FileOffsetToRawData;
78-
Ptr = std::copy(Sec.Contents.begin(), Sec.Contents.end(), Ptr);
78+
Ptr = llvm::copy(Sec.Contents, Ptr);
7979
}
8080

8181
// Write relocations.

llvm/lib/ObjCopy/wasm/WasmObjcopy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static Error dumpSectionToFile(StringRef SecName, StringRef Filename,
4747
if (!BufferOrErr)
4848
return createFileError(Filename, BufferOrErr.takeError());
4949
std::unique_ptr<FileOutputBuffer> Buf = std::move(*BufferOrErr);
50-
std::copy(Contents.begin(), Contents.end(), Buf->getBufferStart());
50+
llvm::copy(Contents, Buf->getBufferStart());
5151
if (Error E = Buf->commit())
5252
return createFileError(Filename, std::move(E));
5353
return Error::success();

llvm/lib/ObjectYAML/COFFEmitter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ struct COFFParser {
6565
StringRef Name = Sec.Name;
6666

6767
if (Name.size() <= COFF::NameSize) {
68-
std::copy(Name.begin(), Name.end(), Sec.Header.Name);
68+
llvm::copy(Name, Sec.Header.Name);
6969
} else {
7070
// Add string to the string table and format the index for output.
7171
unsigned Index = getStringIndex(Name);
@@ -75,7 +75,7 @@ struct COFFParser {
7575
return false;
7676
}
7777
Sec.Header.Name[0] = '/';
78-
std::copy(str.begin(), str.end(), Sec.Header.Name + 1);
78+
llvm::copy(str, Sec.Header.Name + 1);
7979
}
8080

8181
if (Sec.Alignment) {

0 commit comments

Comments
 (0)