Skip to content

Commit 7a28cdc

Browse files
committedJun 25, 2015
Teach LLVM about the PPC64 memory sanitizer implementation.
Summary: This is the LLVM part of the PPC memory sanitizer implementation in D10648. Reviewers: kcc, samsonov, willschm, wschmidt, eugenis Reviewed By: eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10649 llvm-svn: 240627
1 parent 8bebed9 commit 7a28cdc

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
 

‎llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp

+17
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,14 @@ static const MemoryMapParams Linux_MIPS64_MemoryMapParams = {
236236
0x002000000000, // OriginBase
237237
};
238238

239+
// ppc64 Linux
240+
static const MemoryMapParams Linux_PowerPC64_MemoryMapParams = {
241+
0x200000000000, // AndMask
242+
0x100000000000, // XorMask
243+
0x080000000000, // ShadowBase
244+
0x1C0000000000, // OriginBase
245+
};
246+
239247
// i386 FreeBSD
240248
static const MemoryMapParams FreeBSD_I386_MemoryMapParams = {
241249
0x000180000000, // AndMask
@@ -262,6 +270,11 @@ static const PlatformMemoryMapParams Linux_MIPS_MemoryMapParams = {
262270
&Linux_MIPS64_MemoryMapParams,
263271
};
264272

273+
static const PlatformMemoryMapParams Linux_PowerPC_MemoryMapParams = {
274+
NULL,
275+
&Linux_PowerPC64_MemoryMapParams,
276+
};
277+
265278
static const PlatformMemoryMapParams FreeBSD_X86_MemoryMapParams = {
266279
&FreeBSD_I386_MemoryMapParams,
267280
&FreeBSD_X86_64_MemoryMapParams,
@@ -479,6 +492,10 @@ bool MemorySanitizer::doInitialization(Module &M) {
479492
case Triple::mips64el:
480493
MapParams = Linux_MIPS_MemoryMapParams.bits64;
481494
break;
495+
case Triple::ppc64:
496+
case Triple::ppc64le:
497+
MapParams = Linux_PowerPC_MemoryMapParams.bits64;
498+
break;
482499
default:
483500
report_fatal_error("unsupported architecture");
484501
}

0 commit comments

Comments
 (0)
Please sign in to comment.