Skip to content

Commit 2b077ed

Browse files
authored
[MC] Avoid useless triple copy (#103026)
Copying a triple is cheap, but not free, so let's not do that if there's no reason to do so. Trivial cleanup.
1 parent 3fa946a commit 2b077ed

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

llvm/include/llvm/CodeGen/BasicTTIImpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
525525
TM.getCodeModel() == CodeModel::Large)
526526
return false;
527527

528-
Triple TargetTriple = TM.getTargetTriple();
528+
const Triple &TargetTriple = TM.getTargetTriple();
529529
if (!TargetTriple.isArch64Bit())
530530
return false;
531531

llvm/lib/MC/MCObjectFileInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ void MCObjectFileInfo::initMCObjectFileInfo(MCContext &MCCtx, bool PIC,
10241024
DwarfAccelNamespaceSection = nullptr; // Used only by selected targets.
10251025
DwarfAccelTypesSection = nullptr; // Used only by selected targets.
10261026

1027-
Triple TheTriple = Ctx->getTargetTriple();
1027+
const Triple &TheTriple = Ctx->getTargetTriple();
10281028
switch (Ctx->getObjectFileType()) {
10291029
case MCContext::IsMachO:
10301030
initMachOMCObjectFileInfo(TheTriple);

0 commit comments

Comments
 (0)