diff options
| author | Marcin Koscielnicki <koriakin@0x04.net> | 2016-04-19 23:46:59 +0000 |
|---|---|---|
| committer | Marcin Koscielnicki <koriakin@0x04.net> | 2016-04-19 23:46:59 +0000 |
| commit | ef2e7b4819ed00e9da15f0e875b25125d7bba6cc (patch) | |
| tree | 2b0b142b5335030dd1e6d026377f1e2f7aec539e | |
| parent | f258bf90179c07cea626a2068276c55bfc9b3fff (diff) | |
| download | bcm5719-llvm-ef2e7b4819ed00e9da15f0e875b25125d7bba6cc.tar.gz bcm5719-llvm-ef2e7b4819ed00e9da15f0e875b25125d7bba6cc.zip | |
[Mips] [MSan] VarArgMIPS64Helper: Use target's endian, not host's.
Ugh.
Differential Revision: http://reviews.llvm.org/D19292
llvm-svn: 266833
| -rw-r--r-- | llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp index 0edf186ce55..40bd5764e81 100644 --- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp @@ -2965,15 +2965,16 @@ struct VarArgMIPS64Helper : public VarArgHelper { const DataLayout &DL = F.getParent()->getDataLayout(); for (CallSite::arg_iterator ArgIt = CS.arg_begin() + 1, End = CS.arg_end(); ArgIt != End; ++ArgIt) { + llvm::Triple TargetTriple(F.getParent()->getTargetTriple()); Value *A = *ArgIt; Value *Base; uint64_t ArgSize = DL.getTypeAllocSize(A->getType()); -#if defined(__MIPSEB__) || defined(MIPSEB) - // Adjusting the shadow for argument with size < 8 to match the placement - // of bits in big endian system - if (ArgSize < 8) - VAArgOffset += (8 - ArgSize); -#endif + if (TargetTriple.getArch() == llvm::Triple::mips64) { + // Adjusting the shadow for argument with size < 8 to match the placement + // of bits in big endian system + if (ArgSize < 8) + VAArgOffset += (8 - ArgSize); + } Base = getShadowPtrForVAArgument(A->getType(), IRB, VAArgOffset); VAArgOffset += ArgSize; VAArgOffset = alignTo(VAArgOffset, 8); |

