mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-28 22:24:28 +00:00
Changes to build successfully with GCC 3.02
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1503 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -12,9 +12,14 @@
|
||||
#include "llvm/Analysis/FindUnsafePointerTypes.h"
|
||||
#include "TransformInternals.h"
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
using std::vector;
|
||||
using std::set;
|
||||
using std::pair;
|
||||
|
||||
#include "llvm/Assembly/Writer.h"
|
||||
|
||||
|
||||
// PruneTypes - Given a type Ty, make sure that neither it, or one of its
|
||||
// subtypes, occur in TypesToModify.
|
||||
//
|
||||
@ -26,7 +31,7 @@ static void PruneTypes(const Type *Ty, set<const StructType*> &TypesToModify,
|
||||
// If the element is in TypesToModify, remove it now...
|
||||
if (const StructType *ST = dyn_cast<StructType>(Ty)) {
|
||||
TypesToModify.erase(ST); // This doesn't fail if the element isn't present
|
||||
cerr << "Unable to swap type: " << ST << endl;
|
||||
std::cerr << "Unable to swap type: " << ST << "\n";
|
||||
}
|
||||
|
||||
// Remove all types that this type contains as well... do not remove types
|
||||
@ -69,7 +74,8 @@ static inline void GetTransformation(const StructType *ST,
|
||||
|
||||
// Build mapping from index to size
|
||||
for (unsigned i = 0; i < NumElements; ++i)
|
||||
ElList.push_back(make_pair(i, TD.getTypeSize(ST->getElementTypes()[i])));
|
||||
ElList.push_back(
|
||||
std::make_pair(i, TD.getTypeSize(ST->getElementTypes()[i])));
|
||||
|
||||
sort(ElList.begin(), ElList.end(), ptr_fun(FirstLess));
|
||||
|
||||
@ -118,14 +124,14 @@ PrebuiltStructMutation::TransformsType
|
||||
set<const Type*> ProcessedTypes;
|
||||
for (set<PointerType*>::const_iterator I = UnsafePTys.begin(),
|
||||
E = UnsafePTys.end(); I != E; ++I) {
|
||||
//cerr << "Pruning type: " << *I << endl;
|
||||
//cerr << "Pruning type: " << *I << "\n";
|
||||
PruneTypes(*I, TypesToModify, ProcessedTypes);
|
||||
}
|
||||
|
||||
|
||||
// Build up a set of structure types that we are going to modify, and
|
||||
// information describing how to modify them.
|
||||
map<const StructType*, vector<int> > Transforms;
|
||||
std::map<const StructType*, vector<int> > Transforms;
|
||||
|
||||
for (set<const StructType*>::iterator I = TypesToModify.begin(),
|
||||
E = TypesToModify.end(); I != E; ++I) {
|
||||
|
Reference in New Issue
Block a user