summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Attributes.cpp
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@apple.com>2015-11-13 01:44:32 +0000
committerAkira Hatanaka <ahatanaka@apple.com>2015-11-13 01:44:32 +0000
commit5af7ace4ee9397fe9e1738a144b196fd23868cef (patch)
treec98b569b0836eabbe96ec20661dffdd5a6e15688 /llvm/lib/IR/Attributes.cpp
parent560a5faab099c45cead32faf03c825c30ff1e9c8 (diff)
downloadbcm5719-llvm-5af7ace4ee9397fe9e1738a144b196fd23868cef.tar.gz
bcm5719-llvm-5af7ace4ee9397fe9e1738a144b196fd23868cef.zip
Revert r252990.
Some of the buildbots are still failing. llvm-svn: 252999
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r--llvm/lib/IR/Attributes.cpp78
1 files changed, 0 insertions, 78 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp
index e2013c48aa4..bdefe5917fe 100644
--- a/llvm/lib/IR/Attributes.cpp
+++ b/llvm/lib/IR/Attributes.cpp
@@ -14,7 +14,6 @@
//===----------------------------------------------------------------------===//
#include "llvm/IR/Attributes.h"
-#include "llvm/IR/Function.h"
#include "AttributeImpl.h"
#include "LLVMContextImpl.h"
#include "llvm/ADT/STLExtras.h"
@@ -1408,80 +1407,3 @@ AttrBuilder AttributeFuncs::typeIncompatible(Type *Ty) {
return Incompatible;
}
-
-template<typename AttrClass>
-static bool isEqual(const Function &Caller, const Function &Callee) {
- return Caller.getFnAttribute(AttrClass::Kind) ==
- Callee.getFnAttribute(AttrClass::Kind);
-}
-
-/// \brief Compute the logical AND of the attributes of the caller and the
-/// callee.
-///
-/// This function sets the caller's attribute to false if the callee's attribute
-/// is false.
-template<typename AttrClass>
-static void setAND(Function &Caller, const Function &Callee) {
- if (AttrClass::isSet(Caller, AttrClass::Kind) &&
- !AttrClass::isSet(Callee, AttrClass::Kind))
- AttrClass::set(Caller, AttrClass::Kind, false);
-}
-
-/// \brief Compute the logical OR of the attributes of the caller and the
-/// callee.
-///
-/// This function sets the caller's attribute to true if the callee's attribute
-/// is true.
-template<typename AttrClass>
-static void setOR(Function &Caller, const Function &Callee) {
- if (!AttrClass::isSet(Caller, AttrClass::Kind) &&
- AttrClass::isSet(Callee, AttrClass::Kind))
- AttrClass::set(Caller, AttrClass::Kind, true);
-}
-
-/// \brief If the inlined function had a higher stack protection level than the
-/// calling function, then bump up the caller's stack protection level.
-static void adjustCallerSSPLevel(Function &Caller, const Function &Callee) {
- // If upgrading the SSP attribute, clear out the old SSP Attributes first.
- // Having multiple SSP attributes doesn't actually hurt, but it adds useless
- // clutter to the IR.
- AttrBuilder B;
- B.addAttribute(Attribute::StackProtect)
- .addAttribute(Attribute::StackProtectStrong)
- .addAttribute(Attribute::StackProtectReq);
- AttributeSet OldSSPAttr = AttributeSet::get(Caller.getContext(),
- AttributeSet::FunctionIndex,
- B);
-
- if (Callee.hasFnAttribute(Attribute::SafeStack)) {
- Caller.removeAttributes(AttributeSet::FunctionIndex, OldSSPAttr);
- Caller.addFnAttr(Attribute::SafeStack);
- } else if (Callee.hasFnAttribute(Attribute::StackProtectReq) &&
- !Caller.hasFnAttribute(Attribute::SafeStack)) {
- Caller.removeAttributes(AttributeSet::FunctionIndex, OldSSPAttr);
- Caller.addFnAttr(Attribute::StackProtectReq);
- } else if (Callee.hasFnAttribute(Attribute::StackProtectStrong) &&
- !Caller.hasFnAttribute(Attribute::SafeStack) &&
- !Caller.hasFnAttribute(Attribute::StackProtectReq)) {
- Caller.removeAttributes(AttributeSet::FunctionIndex, OldSSPAttr);
- Caller.addFnAttr(Attribute::StackProtectStrong);
- } else if (Callee.hasFnAttribute(Attribute::StackProtect) &&
- !Caller.hasFnAttribute(Attribute::SafeStack) &&
- !Caller.hasFnAttribute(Attribute::StackProtectReq) &&
- !Caller.hasFnAttribute(Attribute::StackProtectStrong))
- Caller.addFnAttr(Attribute::StackProtect);
-}
-
-#define GET_ATTR_COMPAT_FUNC
-#include "AttributesCompatFunc.inc"
-
-bool AttributeFuncs::areInlineCompatible(const Function &Caller,
- const Function &Callee) {
- return hasCompatibleFnAttrs(Caller, Callee);
-}
-
-
-void AttributeFuncs::mergeAttributesForInlining(Function &Caller,
- const Function &Callee) {
- mergeFnAttrs(Caller, Callee);
-}
OpenPOWER on IntegriCloud