aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/IPO/DeadTypeElimination.cpp2
-rw-r--r--lib/Transforms/IPO/SimpleStructMutation.cpp13
-rw-r--r--lib/Transforms/LevelRaise.cpp4
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp2
-rw-r--r--lib/Transforms/Utils/LowerAllocations.cpp6
5 files changed, 18 insertions, 9 deletions
diff --git a/lib/Transforms/IPO/DeadTypeElimination.cpp b/lib/Transforms/IPO/DeadTypeElimination.cpp
index 75d1c5343a..99c092263b 100644
--- a/lib/Transforms/IPO/DeadTypeElimination.cpp
+++ b/lib/Transforms/IPO/DeadTypeElimination.cpp
@@ -16,7 +16,6 @@
#include "llvm/Transforms/CleanupGCCOutput.h"
#include "llvm/Analysis/FindUsedTypes.h"
-#include "TransformInternals.h"
#include "llvm/Module.h"
#include "llvm/SymbolTable.h"
#include "llvm/DerivedTypes.h"
@@ -25,6 +24,7 @@
#include "llvm/iTerminators.h"
#include "llvm/iOther.h"
#include "llvm/Support/CFG.h"
+#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include <algorithm>
#include <iostream>
using std::vector;
diff --git a/lib/Transforms/IPO/SimpleStructMutation.cpp b/lib/Transforms/IPO/SimpleStructMutation.cpp
index c0d9ef46bc..908b5b1030 100644
--- a/lib/Transforms/IPO/SimpleStructMutation.cpp
+++ b/lib/Transforms/IPO/SimpleStructMutation.cpp
@@ -5,18 +5,25 @@
//
//===----------------------------------------------------------------------===//
-
#include "llvm/Transforms/IPO/SimpleStructMutation.h"
#include "llvm/Transforms/IPO/MutateStructTypes.h"
#include "llvm/Analysis/FindUsedTypes.h"
#include "llvm/Analysis/FindUnsafePointerTypes.h"
-#include "../TransformInternals.h"
+#include "llvm/Target/TargetData.h"
+#include "llvm/DerivedTypes.h"
#include <algorithm>
#include <iostream>
using std::vector;
using std::set;
using std::pair;
+// FIXME: TargetData Hack: Eventually we will have annotations given to us by
+// the backend so that we know stuff about type size and alignments. For now
+// though, just use this, because it happens to match the model that GCC and the
+// Sparc backend use.
+//
+const TargetData TD("SimpleStructMutation Should be GCC though!");
+
namespace {
struct SimpleStructMutation : public MutateStructTypes {
enum Transform { SwapElements, SortElements } CurrentXForm;
@@ -86,7 +93,7 @@ static unsigned getIndex(const vector<pair<unsigned, unsigned> > &Vec,
static inline void GetTransformation(const StructType *ST,
vector<int> &Transform,
- enum SimpleStructMutation::Transform XForm) {
+ enum SimpleStructMutation::Transform XForm) {
unsigned NumElements = ST->getElementTypes().size();
Transform.reserve(NumElements);
diff --git a/lib/Transforms/LevelRaise.cpp b/lib/Transforms/LevelRaise.cpp
index cc684b5f15..663493d105 100644
--- a/lib/Transforms/LevelRaise.cpp
+++ b/lib/Transforms/LevelRaise.cpp
@@ -7,14 +7,14 @@
//===----------------------------------------------------------------------===//
#include "llvm/Transforms/LevelChange.h"
+#include "llvm/Transforms/Utils/Local.h"
#include "TransformInternals.h"
#include "llvm/iOther.h"
#include "llvm/iMemory.h"
#include "llvm/Pass.h"
#include "llvm/ConstantHandling.h"
-#include "llvm/Transforms/Scalar/DCE.h"
-#include "llvm/Transforms/Scalar/ConstantProp.h"
#include "llvm/Analysis/Expressions.h"
+#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "Support/STLExtras.h"
#include <algorithm>
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index fda64ab49a..6272cd090f 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -16,6 +16,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/Transforms/Scalar/InstructionCombining.h"
+#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/ConstantHandling.h"
#include "llvm/iMemory.h"
#include "llvm/iOther.h"
@@ -24,7 +25,6 @@
#include "llvm/Pass.h"
#include "llvm/Support/InstIterator.h"
#include "llvm/Support/InstVisitor.h"
-#include "../TransformInternals.h"
namespace {
diff --git a/lib/Transforms/Utils/LowerAllocations.cpp b/lib/Transforms/Utils/LowerAllocations.cpp
index 07c034bad0..ff3c29f11a 100644
--- a/lib/Transforms/Utils/LowerAllocations.cpp
+++ b/lib/Transforms/Utils/LowerAllocations.cpp
@@ -8,13 +8,15 @@
//===----------------------------------------------------------------------===//
#include "llvm/Transforms/ChangeAllocations.h"
+#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Module.h"
#include "llvm/Function.h"
#include "llvm/DerivedTypes.h"
#include "llvm/iMemory.h"
#include "llvm/iOther.h"
+#include "llvm/Constants.h"
#include "llvm/Pass.h"
-#include "TransformInternals.h"
+#include "llvm/Target/TargetData.h"
using std::vector;
namespace {
@@ -102,7 +104,7 @@ bool LowerAllocations::runOnBasicBlock(BasicBlock *BB) {
if (MallocInst *MI = dyn_cast<MallocInst>(*(BBIL.begin()+i))) {
BBIL.remove(BBIL.begin()+i); // remove the malloc instr...
- const Type *AllocTy =cast<PointerType>(MI->getType())->getElementType();
+ const Type *AllocTy = cast<PointerType>(MI->getType())->getElementType();
// Get the number of bytes to be allocated for one element of the
// requested type...