summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorJoerg Sonnenberger <joerg@bec.de>2015-03-11 23:46:32 +0000
committerJoerg Sonnenberger <joerg@bec.de>2015-03-11 23:46:32 +0000
commit27173288c296638e7e3c9e6c1653e305e3482a63 (patch)
treed264967c538a3296bfea8074ce3b1e048c5e4e98 /clang/lib/CodeGen
parent3c2ea3106c70e8fcb0c97300584f849651248d0c (diff)
downloadbcm5719-llvm-27173288c296638e7e3c9e6c1653e305e3482a63.tar.gz
bcm5719-llvm-27173288c296638e7e3c9e6c1653e305e3482a63.zip
Under duress, move check for target support of __builtin_setjmp/
__builtin_longjmp to Sema as requested by John McCall. llvm-svn: 231986
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGBuiltin.cpp9
-rw-r--r--clang/lib/CodeGen/TargetInfo.cpp30
-rw-r--r--clang/lib/CodeGen/TargetInfo.h6
3 files changed, 0 insertions, 45 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index eae5f02edbd..951e9aeec27 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -859,11 +859,6 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD,
return RValue::get(Builder.CreateZExt(Result, Int64Ty, "extend.zext"));
}
case Builtin::BI__builtin_setjmp: {
- if (!getTargetHooks().hasSjLjLowering(*this)) {
- CGM.ErrorUnsupported(E, "__builtin_setjmp");
- return RValue::get(nullptr);
- }
-
// Buffer is a void**.
Value *Buf = EmitScalarExpr(E->getArg(0));
@@ -886,10 +881,6 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD,
return RValue::get(Builder.CreateCall(F, Buf));
}
case Builtin::BI__builtin_longjmp: {
- if (!getTargetHooks().hasSjLjLowering(*this)) {
- CGM.ErrorUnsupported(E, "__builtin_longjmp");
- return RValue::get(nullptr);
- }
Value *Buf = EmitScalarExpr(E->getArg(0));
Buf = Builder.CreateBitCast(Buf, Int8PtrTy);
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp
index 7b25da256e1..988b8fc80d2 100644
--- a/clang/lib/CodeGen/TargetInfo.cpp
+++ b/clang/lib/CodeGen/TargetInfo.cpp
@@ -664,10 +664,6 @@ public:
('T' << 24);
return llvm::ConstantInt::get(CGM.Int32Ty, Sig);
}
-
- bool hasSjLjLowering(CodeGen::CodeGenFunction &CGF) const override {
- return true;
- }
};
}
@@ -1613,10 +1609,6 @@ public:
unsigned getOpenMPSimdDefaultAlignment(QualType) const override {
return HasAVX ? 32 : 16;
}
-
- bool hasSjLjLowering(CodeGen::CodeGenFunction &CGF) const override {
- return true;
- }
};
class PS4TargetCodeGenInfo : public X86_64TargetCodeGenInfo {
@@ -1724,10 +1716,6 @@ public:
unsigned getOpenMPSimdDefaultAlignment(QualType) const override {
return HasAVX ? 32 : 16;
}
-
- bool hasSjLjLowering(CodeGen::CodeGenFunction &CGF) const override {
- return true;
- }
};
void WinX86_64TargetCodeGenInfo::SetTargetAttributes(const Decl *D,
@@ -3127,10 +3115,6 @@ public:
unsigned getOpenMPSimdDefaultAlignment(QualType) const override {
return 16; // Natural alignment for Altivec vectors.
}
-
- bool hasSjLjLowering(CodeGen::CodeGenFunction &CGF) const override {
- return true;
- }
};
}
@@ -3381,10 +3365,6 @@ public:
return 16; // Natural alignment for Altivec and VSX vectors.
}
-
- bool hasSjLjLowering(CodeGen::CodeGenFunction &CGF) const override {
- return true;
- }
};
class PPC64TargetCodeGenInfo : public DefaultTargetCodeGenInfo {
@@ -3402,10 +3382,6 @@ public:
unsigned getOpenMPSimdDefaultAlignment(QualType) const override {
return 16; // Natural alignment for Altivec vectors.
}
-
- bool hasSjLjLowering(CodeGen::CodeGenFunction &CGF) const override {
- return true;
- }
};
}
@@ -4533,12 +4509,6 @@ public:
llvm::AttributeSet::FunctionIndex,
B));
}
-
- bool hasSjLjLowering(CodeGen::CodeGenFunction &CGF) const override {
- return false;
- // FIXME: backend implementation too restricted, even on Darwin.
- // return CGF.getTarget().getTriple().isOSDarwin();
- }
};
class WindowsARMTargetCodeGenInfo : public ARMTargetCodeGenInfo {
diff --git a/clang/lib/CodeGen/TargetInfo.h b/clang/lib/CodeGen/TargetInfo.h
index 0c3fdc3c8ac..cc469d69e39 100644
--- a/clang/lib/CodeGen/TargetInfo.h
+++ b/clang/lib/CodeGen/TargetInfo.h
@@ -225,12 +225,6 @@ public:
virtual unsigned getOpenMPSimdDefaultAlignment(QualType Type) const {
return 0;
}
-
- /// Control if __builtin_longjmp / __builtin_setjmp can be lowered to
- /// llvm.eh.sjlj.longjmp / llvm.eh.sjlj.setjmp.
- virtual bool hasSjLjLowering(CodeGen::CodeGenFunction &CGF) const {
- return false;
- }
};
}
OpenPOWER on IntegriCloud