Skip to content

Commit

Permalink
[MC] Avoid useless triple copy (llvm#103026)
Browse files Browse the repository at this point in the history
Copying a triple is cheap, but not free, so let's not do that if there's
no reason to do so. Trivial cleanup.
  • Loading branch information
aengelke committed Aug 13, 2024
1 parent 3fa946a commit 2b077ed
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion llvm/include/llvm/CodeGen/BasicTTIImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
TM.getCodeModel() == CodeModel::Large)
return false;

Triple TargetTriple = TM.getTargetTriple();
const Triple &TargetTriple = TM.getTargetTriple();
if (!TargetTriple.isArch64Bit())
return false;

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/MC/MCObjectFileInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ void MCObjectFileInfo::initMCObjectFileInfo(MCContext &MCCtx, bool PIC,
DwarfAccelNamespaceSection = nullptr; // Used only by selected targets.
DwarfAccelTypesSection = nullptr; // Used only by selected targets.

Triple TheTriple = Ctx->getTargetTriple();
const Triple &TheTriple = Ctx->getTargetTriple();
switch (Ctx->getObjectFileType()) {
case MCContext::IsMachO:
initMachOMCObjectFileInfo(TheTriple);
Expand Down

0 comments on commit 2b077ed

Please sign in to comment.