summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/SimpleStructMutation.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-05-07 18:12:18 +0000
committerChris Lattner <sabre@nondot.org>2002-05-07 18:12:18 +0000
commit9b55e5a2f489cccc63e57c37aa0ac83212f8947c (patch)
tree80ef4300cd68152984b2b786f19b34423d4d9e1d /llvm/lib/Transforms/IPO/SimpleStructMutation.cpp
parent3d86d4960449edce500930ec8cb08264adb93355 (diff)
downloadbcm5719-llvm-9b55e5a2f489cccc63e57c37aa0ac83212f8947c.tar.gz
bcm5719-llvm-9b55e5a2f489cccc63e57c37aa0ac83212f8947c.zip
Reduce dependance on TransformInternals.h, instead using the TransformUtils library
llvm-svn: 2518
Diffstat (limited to 'llvm/lib/Transforms/IPO/SimpleStructMutation.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/SimpleStructMutation.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/IPO/SimpleStructMutation.cpp b/llvm/lib/Transforms/IPO/SimpleStructMutation.cpp
index c0d9ef46bc2..908b5b1030a 100644
--- a/llvm/lib/Transforms/IPO/SimpleStructMutation.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud