@@ -105,6 +105,7 @@ static const uint64_t kSystemZ_ShadowOffset64 = 1ULL << 52;
105
105
static const uint64_t kMIPS32_ShadowOffset32 = 0x0aaa0000 ;
106
106
static const uint64_t kMIPS64_ShadowOffset64 = 1ULL << 37 ;
107
107
static const uint64_t kAArch64_ShadowOffset64 = 1ULL << 36 ;
108
+ static const uint64_t kRISCV64_ShadowOffset64 = 0x20000000 ;
108
109
static const uint64_t kFreeBSD_ShadowOffset32 = 1ULL << 30 ;
109
110
static const uint64_t kFreeBSD_ShadowOffset64 = 1ULL << 46 ;
110
111
static const uint64_t kNetBSD_ShadowOffset32 = 1ULL << 30 ;
@@ -447,6 +448,7 @@ static ShadowMapping getShadowMapping(Triple &TargetTriple, int LongSize,
447
448
bool IsMIPS64 = TargetTriple.isMIPS64 ();
448
449
bool IsArmOrThumb = TargetTriple.isARM () || TargetTriple.isThumb ();
449
450
bool IsAArch64 = TargetTriple.getArch () == Triple::aarch64;
451
+ bool IsRISCV64 = TargetTriple.getArch () == Triple::riscv64;
450
452
bool IsWindows = TargetTriple.isOSWindows ();
451
453
bool IsFuchsia = TargetTriple.isOSFuchsia ();
452
454
bool IsMyriad = TargetTriple.getVendor () == llvm::Triple::Myriad;
@@ -515,6 +517,8 @@ static ShadowMapping getShadowMapping(Triple &TargetTriple, int LongSize,
515
517
Mapping.Offset = kDynamicShadowSentinel ;
516
518
else if (IsAArch64)
517
519
Mapping.Offset = kAArch64_ShadowOffset64 ;
520
+ else if (IsRISCV64)
521
+ Mapping.Offset = kRISCV64_ShadowOffset64 ;
518
522
else
519
523
Mapping.Offset = kDefaultShadowOffset64 ;
520
524
}
@@ -533,6 +537,7 @@ static ShadowMapping getShadowMapping(Triple &TargetTriple, int LongSize,
533
537
// we could OR the constant in a single instruction, but it's more
534
538
// efficient to load it once and use indexed addressing.
535
539
Mapping.OrShadowOffset = !IsAArch64 && !IsPPC64 && !IsSystemZ && !IsPS4CPU &&
540
+ !IsRISCV64 &&
536
541
!(Mapping.Offset & (Mapping.Offset - 1 )) &&
537
542
Mapping.Offset != kDynamicShadowSentinel ;
538
543
bool IsAndroidWithIfuncSupport =
0 commit comments