Skip to content

Commit 6b5308b

Browse files
authored
[NFC] Remove unnecessary copy of Triples (#102469)
Remove unnecessary copy of Triple in ItaniumMangle.cpp, SemaType.cpp
1 parent 458fa12 commit 6b5308b

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

clang/lib/AST/ItaniumMangle.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2727,8 +2727,6 @@ void CXXNameMangler::mangleQualifiers(Qualifiers Quals, const DependentAddressSp
27272727
// <type> ::= U <OpenCL-addrspace>
27282728
// <type> ::= U <CUDA-addrspace>
27292729

2730-
llvm::Triple Triple = getASTContext().getTargetInfo().getTriple();
2731-
27322730
SmallString<64> ASString;
27332731
LangAS AS = Quals.getAddressSpace();
27342732

@@ -2800,7 +2798,7 @@ void CXXNameMangler::mangleQualifiers(Qualifiers Quals, const DependentAddressSp
28002798
// For z/OS, there are no special mangling rules applied to the ptr32
28012799
// qualifier. Ex: void foo(int * __ptr32 p) -> _Z3f2Pi. The mangling for
28022800
// "p" is treated the same as a regular integer pointer.
2803-
if (!Triple.isOSzOS())
2801+
if (!getASTContext().getTargetInfo().getTriple().isOSzOS())
28042802
ASString = "ptr32_uptr";
28052803
break;
28062804
case LangAS::ptr64:

clang/lib/Sema/SemaType.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7057,7 +7057,6 @@ static bool handleMSPointerTypeQualifierAttr(TypeProcessingState &State,
70577057

70587058
// Add address space to type based on its attributes.
70597059
LangAS ASIdx = LangAS::Default;
7060-
llvm::Triple Triple = S.Context.getTargetInfo().getTriple();
70617060
uint64_t PtrWidth =
70627061
S.Context.getTargetInfo().getPointerWidth(LangAS::Default);
70637062
if (PtrWidth == 32) {
@@ -7066,7 +7065,7 @@ static bool handleMSPointerTypeQualifierAttr(TypeProcessingState &State,
70667065
else if (Attrs[attr::UPtr])
70677066
ASIdx = LangAS::ptr32_uptr;
70687067
} else if (PtrWidth == 64 && Attrs[attr::Ptr32]) {
7069-
if (Triple.isOSzOS() || Attrs[attr::UPtr])
7068+
if (S.Context.getTargetInfo().getTriple().isOSzOS() || Attrs[attr::UPtr])
70707069
ASIdx = LangAS::ptr32_uptr;
70717070
else
70727071
ASIdx = LangAS::ptr32_sptr;

0 commit comments

Comments
 (0)