aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/NaCl/StripAttributes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/NaCl/StripAttributes.cpp')
-rw-r--r--lib/Transforms/NaCl/StripAttributes.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Transforms/NaCl/StripAttributes.cpp b/lib/Transforms/NaCl/StripAttributes.cpp
index 184e06aba1..d4dc172530 100644
--- a/lib/Transforms/NaCl/StripAttributes.cpp
+++ b/lib/Transforms/NaCl/StripAttributes.cpp
@@ -162,6 +162,7 @@ void stripGlobalValueAttrs(GlobalValue *GV) {
static unsigned normalizeAlignment(DataLayout *DL, unsigned Alignment,
Type *Ty, bool IsAtomic) {
+#if 0
unsigned MaxAllowed = 1;
if (Ty->isDoubleTy() || Ty->isFloatTy() || IsAtomic)
MaxAllowed = DL->getTypeAllocSize(Ty);
@@ -170,6 +171,9 @@ static unsigned normalizeAlignment(DataLayout *DL, unsigned Alignment,
if (Alignment == 0 || Alignment >= MaxAllowed)
return MaxAllowed;
return 1;
+#else
+ return Alignment; // EMSCRIPTEN: no need to change alignment
+#endif
}
void stripFunctionAttrs(DataLayout *DL, Function *Func) {
@@ -188,12 +192,14 @@ void stripFunctionAttrs(DataLayout *DL, Function *Func) {
Call.setAttributes(AttributeSet());
Call.setCallingConv(CallingConv::C);
+#if 0 // EMSCRIPTEN: we do support alignment info in these calls
// Set memcpy(), memmove() and memset() to use pessimistic
// alignment assumptions.
if (MemIntrinsic *MemOp = dyn_cast<MemIntrinsic>(Inst)) {
Type *AlignTy = MemOp->getAlignmentCst()->getType();
MemOp->setAlignment(ConstantInt::get(AlignTy, 1));
}
+#endif
} else if (OverflowingBinaryOperator *Op =
dyn_cast<OverflowingBinaryOperator>(Inst)) {
cast<BinaryOperator>(Op)->setHasNoUnsignedWrap(false);