aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/Analysis.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2013-01-08 05:11:57 +0000
committerChandler Carruth <chandlerc@gmail.com>2013-01-08 05:11:57 +0000
commit40b2c32475572d33ede7cf202f2d49cab9b43bb4 (patch)
tree648db86e658297112f309a15cf23d374e676838d /lib/CodeGen/Analysis.cpp
parentef24963cbcb068a5796073354fde7b9d25fd17d0 (diff)
downloadexternal_llvm-40b2c32475572d33ede7cf202f2d49cab9b43bb4.zip
external_llvm-40b2c32475572d33ede7cf202f2d49cab9b43bb4.tar.gz
external_llvm-40b2c32475572d33ede7cf202f2d49cab9b43bb4.tar.bz2
Sink a function that refers to the SelectionDAG into that library in the
one file where it is called as a static function. Nuke the declaration and the definition in lib/CodeGen, along with the include of SelectionDAG.h from this file. There is no dependency edge from lib/CodeGen to lib/CodeGen/SelectionDAG, so it isn't valid for a routine in lib/CodeGen to reference the DAG. There is a dependency from lib/CodeGen/SelectionDAG on lib/CodeGen. This breaks one violation of this layering. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171842 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/Analysis.cpp')
-rw-r--r--lib/CodeGen/Analysis.cpp21
1 files changed, 0 insertions, 21 deletions
diff --git a/lib/CodeGen/Analysis.cpp b/lib/CodeGen/Analysis.cpp
index d68bac7..aaba144 100644
--- a/lib/CodeGen/Analysis.cpp
+++ b/lib/CodeGen/Analysis.cpp
@@ -14,7 +14,6 @@
#include "llvm/CodeGen/Analysis.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
@@ -348,23 +347,3 @@ bool llvm::isInTailCallPosition(ImmutableCallSite CS, Attribute CalleeRetAttr,
return true;
}
-
-bool llvm::isInTailCallPosition(SelectionDAG &DAG, SDNode *Node,
- SDValue &Chain, const TargetLowering &TLI) {
- const Function *F = DAG.getMachineFunction().getFunction();
-
- // Conservatively require the attributes of the call to match those of
- // the return. Ignore noalias because it doesn't affect the call sequence.
- Attribute CallerRetAttr = F->getAttributes().getRetAttributes();
- if (AttrBuilder(CallerRetAttr)
- .removeAttribute(Attribute::NoAlias).hasAttributes())
- return false;
-
- // It's not safe to eliminate the sign / zero extension of the return value.
- if (CallerRetAttr.hasAttribute(Attribute::ZExt) ||
- CallerRetAttr.hasAttribute(Attribute::SExt))
- return false;
-
- // Check if the only use is a function return node.
- return TLI.isUsedByReturnOnly(Node, Chain);
-}