Skip to content

Commit 14030d7

Browse files
[llvm] Drop explicit conversions of string literals to StringRef (NFC)
We routinely rely on implicit conversions of string literals to StringRef so that we can use operator==(StringRef, StringRef).
1 parent f4066fa commit 14030d7

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

llvm/lib/Frontend/OpenMP/OMPContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ OMPContext::OMPContext(bool IsDeviceCompilation, Triple TargetTriple) {
6363
if (TraitSelector::TraitSelectorEnum == TraitSelector::device_arch) { \
6464
if (TargetTriple.getArch() == TargetTriple.getArchTypeForLLVMName(Str)) \
6565
ActiveTraits.set(unsigned(TraitProperty::Enum)); \
66-
if (StringRef(Str) == StringRef("x86_64") && \
66+
if (StringRef(Str) == "x86_64" && \
6767
TargetTriple.getArch() == Triple::x86_64) \
6868
ActiveTraits.set(unsigned(TraitProperty::Enum)); \
6969
}

llvm/lib/Object/MachOObjectFile.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3256,13 +3256,13 @@ MachOAbstractFixupEntry::MachOAbstractFixupEntry(Error *E,
32563256
for (const auto &Command : O->load_commands()) {
32573257
if (Command.C.cmd == MachO::LC_SEGMENT) {
32583258
MachO::segment_command SLC = O->getSegmentLoadCommand(Command);
3259-
if (StringRef(SLC.segname) == StringRef("__TEXT")) {
3259+
if (StringRef(SLC.segname) == "__TEXT") {
32603260
TextAddress = SLC.vmaddr;
32613261
break;
32623262
}
32633263
} else if (Command.C.cmd == MachO::LC_SEGMENT_64) {
32643264
MachO::segment_command_64 SLC_64 = O->getSegment64LoadCommand(Command);
3265-
if (StringRef(SLC_64.segname) == StringRef("__TEXT")) {
3265+
if (StringRef(SLC_64.segname) == "__TEXT") {
32663266
TextAddress = SLC_64.vmaddr;
32673267
break;
32683268
}

llvm/lib/Target/Mips/MipsISelLowering.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3234,8 +3234,7 @@ MipsTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
32343234

32353235
// Note: The check on the calling convention below must match
32363236
// MipsABIInfo::GetCalleeAllocdArgSizeInBytes().
3237-
bool MemcpyInByVal = ES &&
3238-
StringRef(ES->getSymbol()) == StringRef("memcpy") &&
3237+
bool MemcpyInByVal = ES && StringRef(ES->getSymbol()) == "memcpy" &&
32393238
CallConv != CallingConv::Fast &&
32403239
Chain.getOpcode() == ISD::CALLSEQ_START;
32413240

0 commit comments

Comments
 (0)