summaryrefslogtreecommitdiff
path: root/lib/IR
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@apple.com>2015-11-12 21:19:18 +0000
committerAkira Hatanaka <ahatanaka@apple.com>2015-11-12 21:19:18 +0000
commit85b811eedd5ba15cee44bef5ec05d846c36dbed1 (patch)
tree236089f0b452f55f63ca515da3f868bf37e41770 /lib/IR
parentd68ad56b3f52878be32ce60b8a6f9c8dce94c34b (diff)
Revert r252949.
It broke some of the bots including clang-x64-ninja-win7. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252951 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR')
-rw-r--r--lib/IR/Attributes.cpp78
-rw-r--r--lib/IR/AttributesCompatFunc.td1
-rw-r--r--lib/IR/CMakeLists.txt4
-rw-r--r--lib/IR/Makefile18
4 files changed, 1 insertions, 100 deletions
diff --git a/lib/IR/Attributes.cpp b/lib/IR/Attributes.cpp
index e2013c48aa4..bdefe5917fe 100644
--- a/lib/IR/Attributes.cpp
+++ b/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);
-}
diff --git a/lib/IR/AttributesCompatFunc.td b/lib/IR/AttributesCompatFunc.td
deleted file mode 100644
index 7c85b3da9ab..00000000000
--- a/lib/IR/AttributesCompatFunc.td
+++ /dev/null
@@ -1 +0,0 @@
-include "llvm/IR/Attributes.td"
diff --git a/lib/IR/CMakeLists.txt b/lib/IR/CMakeLists.txt
index eb67c525ce2..472178f5122 100644
--- a/lib/IR/CMakeLists.txt
+++ b/lib/IR/CMakeLists.txt
@@ -1,7 +1,3 @@
-set(LLVM_TARGET_DEFINITIONS AttributesCompatFunc.td)
-tablegen(LLVM AttributesCompatFunc.inc -gen-attrs)
-add_public_tablegen_target(AttributeCompatFuncTableGen)
-
add_llvm_library(LLVMCore
AsmWriter.cpp
Attributes.cpp
diff --git a/lib/IR/Makefile b/lib/IR/Makefile
index c69d41d357b..d5fc4033b46 100644
--- a/lib/IR/Makefile
+++ b/lib/IR/Makefile
@@ -11,19 +11,16 @@ LIBRARYNAME = LLVMCore
BUILD_ARCHIVE = 1
BUILT_SOURCES = $(PROJ_OBJ_ROOT)/include/llvm/IR/Intrinsics.gen \
- $(PROJ_OBJ_ROOT)/include/llvm/IR/Attributes.inc \
- $(PROJ_OBJ_ROOT)/lib/IR/AttributesCompatFunc.inc
+ $(PROJ_OBJ_ROOT)/include/llvm/IR/Attributes.inc
include $(LEVEL)/Makefile.common
GENFILE:=$(PROJ_OBJ_ROOT)/include/llvm/IR/Intrinsics.gen
ATTRINCFILE:=$(PROJ_OBJ_ROOT)/include/llvm/IR/Attributes.inc
-ATTRCOMPATFUNCINCFILE:=$(PROJ_OBJ_ROOT)/lib/IR/AttributesCompatFunc.inc
INTRINSICTD := $(PROJ_SRC_ROOT)/include/llvm/IR/Intrinsics.td
INTRINSICTDS := $(wildcard $(PROJ_SRC_ROOT)/include/llvm/IR/Intrinsics*.td)
ATTRIBUTESTD := $(PROJ_SRC_ROOT)/include/llvm/IR/Attributes.td
-ATTRCOMPATFUNCTD := $(PROJ_SRC_ROOT)/lib/IR/AttributesCompatFunc.td
$(ObjDir)/Intrinsics.gen.tmp: $(ObjDir)/.dir $(INTRINSICTDS) $(LLVM_TBLGEN)
$(Echo) Building Intrinsics.gen.tmp from Intrinsics.td
@@ -43,15 +40,6 @@ $(ATTRINCFILE): $(ObjDir)/Attributes.inc.tmp $(PROJ_OBJ_ROOT)/include/llvm/IR/.d
$(EchoCmd) Updated Attributes.inc because Attributes.inc.tmp \
changed significantly. )
-$(ObjDir)/AttributesCompatFunc.inc.tmp: $(ObjDir)/.dir $(ATTRCOMPATFUNCTD) $(LLVM_TBLGEN)
- $(Echo) Building AttributesCompatFunc.inc.tmp from $(ATTRCOMPATFUNCTD)
- $(Verb) $(LLVMTableGen) $(call SYSPATH, $(ATTRCOMPATFUNCTD)) -o $(call SYSPATH, $@) -gen-attrs
-
-$(ATTRCOMPATFUNCINCFILE): $(ObjDir)/AttributesCompatFunc.inc.tmp $(PROJ_OBJ_ROOT)/include/llvm/IR/.dir
- $(Verb) $(CMP) -s $@ $< || ( $(CP) $< $@ && \
- $(EchoCmd) Updated AttributesCompatFunc.inc because AttributesCompatFunc.inc.tmp \
- changed significantly. )
-
install-local:: $(GENFILE)
$(Echo) Installing $(DESTDIR)$(PROJ_includedir)/llvm/IR/Intrinsics.gen
$(Verb) $(DataInstall) $(GENFILE) $(DESTDIR)$(PROJ_includedir)/llvm/IR/Intrinsics.gen
@@ -59,7 +47,3 @@ install-local:: $(GENFILE)
install-local:: $(ATTRINCFILE)
$(Echo) Installing $(DESTDIR)$(PROJ_includedir)/llvm/IR/Attributes.inc
$(Verb) $(DataInstall) $(ATTRINCFILE) $(DESTDIR)$(PROJ_includedir)/llvm/IR/Attributes.inc
-
-install-local:: $(ATTRCOMPATFUNCINCFILE)
- $(Echo) Installing $(DESTDIR)$(PROJ_libdir)/IR/AttributesCompatFunc.inc
- $(Verb) $(DataInstall) $(ATTRCOMPATFUNCINCFILE) $(DESTDIR)$(PROJ_libdir)/IR/AttributesCompatFunc.inc