13
13
#include < cstring>
14
14
using namespace llvm ;
15
15
16
- static const char * getManglingComponent (const Triple &T) {
16
+ static StringRef getManglingComponent (const Triple &T) {
17
17
if (T.isOSBinFormatGOFF ())
18
18
return " -m:l" ;
19
19
if (T.isOSBinFormatMachO ())
@@ -122,9 +122,9 @@ static std::string computeCSKYDataLayout(const Triple &TT) {
122
122
}
123
123
124
124
static std::string computeLoongArchDataLayout (const Triple &TT) {
125
- if (TT.isArch64Bit ())
125
+ if (TT.isLoongArch64 ())
126
126
return " e-m:e-p:64:64-i64:64-i128:128-n32:64-S128" ;
127
- assert (TT.isArch32Bit () && " only LA32 and LA64 are currently supported" );
127
+ assert (TT.isLoongArch32 () && " only LA32 and LA64 are currently supported" );
128
128
return " e-m:e-p:32:32-i64:64-n32-S128" ;
129
129
}
130
130
@@ -215,7 +215,7 @@ static std::string computeMipsDataLayout(const Triple &TT, StringRef ABIName) {
215
215
}
216
216
217
217
static std::string computePowerDataLayout (const Triple &T) {
218
- bool is64Bit = T.getArch () == Triple::ppc64 || T. getArch () == Triple::ppc64le ;
218
+ bool is64Bit = T.isPPC64 () ;
219
219
std::string Ret;
220
220
221
221
// Most PPC* platforms are big endian, PPC(64)LE is little endian.
@@ -291,11 +291,11 @@ static std::string computeRISCVDataLayout(const Triple &TT, StringRef ABIName) {
291
291
Ret += " -m:e" ;
292
292
293
293
// Pointer and integer sizes.
294
- if (TT.isArch64Bit ()) {
294
+ if (TT.isRISCV64 ()) {
295
295
Ret += " -p:64:64-i64:64-i128:128" ;
296
296
Ret += " -n32:64" ;
297
297
} else {
298
- assert (TT.isArch32Bit () && " only RV32 and RV64 are currently supported" );
298
+ assert (TT.isRISCV32 () && " only RV32 and RV64 are currently supported" );
299
299
Ret += " -p:32:32-i64:64" ;
300
300
Ret += " -n32" ;
301
301
}
@@ -313,7 +313,7 @@ static std::string computeRISCVDataLayout(const Triple &TT, StringRef ABIName) {
313
313
}
314
314
315
315
static std::string computeSparcDataLayout (const Triple &T) {
316
- const bool is64Bit = T.isSPARC64 ();
316
+ const bool Is64Bit = T.isSPARC64 ();
317
317
318
318
// Sparc is typically big endian, but some are little.
319
319
std::string Ret = T.getArch () == Triple::sparcel ? " e" : " E" ;
@@ -627,5 +627,5 @@ std::string Triple::computeDataLayout(StringRef ABIName) const {
627
627
case Triple::UnknownArch:
628
628
return " " ;
629
629
}
630
- return " " ;
630
+ llvm_unreachable ( " Invalid arch " ) ;
631
631
}
0 commit comments