forked from OSchip/llvm-project
parent
e680139c34
commit
10073a9080
|
@ -79,7 +79,7 @@ private:
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
template<class _NodeType>
|
template<class _NodeType>
|
||||||
class ScheduleIterator: public std::forward_iterator<_NodeType, ptrdiff_t> {
|
class ScheduleIterator : public forward_iterator<_NodeType, ptrdiff_t> {
|
||||||
private:
|
private:
|
||||||
unsigned cycleNum;
|
unsigned cycleNum;
|
||||||
unsigned slotNum;
|
unsigned slotNum;
|
||||||
|
|
|
@ -132,7 +132,7 @@ SchedGraphEdge::~SchedGraphEdge()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void SchedGraphEdge::dump(int indent=0) const {
|
void SchedGraphEdge::dump(int indent) const {
|
||||||
cerr << std::string(indent*2, ' ') << *this;
|
cerr << std::string(indent*2, ' ') << *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,7 +171,7 @@ SchedGraphNode::~SchedGraphNode()
|
||||||
deleter<SchedGraphEdge>);
|
deleter<SchedGraphEdge>);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SchedGraphNode::dump(int indent=0) const {
|
void SchedGraphNode::dump(int indent) const {
|
||||||
cerr << std::string(indent*2, ' ') << *this;
|
cerr << std::string(indent*2, ' ') << *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -377,7 +377,7 @@ private:
|
||||||
// for <const SchedGraphNode, SchedGraphNode::const_iterator>.
|
// for <const SchedGraphNode, SchedGraphNode::const_iterator>.
|
||||||
//
|
//
|
||||||
template <class _NodeType, class _EdgeType, class _EdgeIter>
|
template <class _NodeType, class _EdgeType, class _EdgeIter>
|
||||||
class SGPredIterator: public std::bidirectional_iterator<_NodeType, ptrdiff_t> {
|
class SGPredIterator: public bidirectional_iterator<_NodeType, ptrdiff_t> {
|
||||||
protected:
|
protected:
|
||||||
_EdgeIter oi;
|
_EdgeIter oi;
|
||||||
public:
|
public:
|
||||||
|
@ -406,7 +406,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _NodeType, class _EdgeType, class _EdgeIter>
|
template <class _NodeType, class _EdgeType, class _EdgeIter>
|
||||||
class SGSuccIterator: public std::bidirectional_iterator<_NodeType, ptrdiff_t> {
|
class SGSuccIterator : public bidirectional_iterator<_NodeType, ptrdiff_t> {
|
||||||
protected:
|
protected:
|
||||||
_EdgeIter oi;
|
_EdgeIter oi;
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -139,7 +139,7 @@ int
|
||||||
MachineCodeForMethod::computeOffsetforLocalVar(const TargetMachine& target,
|
MachineCodeForMethod::computeOffsetforLocalVar(const TargetMachine& target,
|
||||||
const Value* val,
|
const Value* val,
|
||||||
unsigned int& getPaddedSize,
|
unsigned int& getPaddedSize,
|
||||||
unsigned int sizeToUse = 0)
|
unsigned int sizeToUse)
|
||||||
{
|
{
|
||||||
bool growUp;
|
bool growUp;
|
||||||
int firstOffset =target.getFrameInfo().getFirstAutomaticVarOffset(*this,
|
int firstOffset =target.getFrameInfo().getFirstAutomaticVarOffset(*this,
|
||||||
|
@ -174,7 +174,7 @@ MachineCodeForMethod::computeOffsetforLocalVar(const TargetMachine& target,
|
||||||
int
|
int
|
||||||
MachineCodeForMethod::allocateLocalVar(const TargetMachine& target,
|
MachineCodeForMethod::allocateLocalVar(const TargetMachine& target,
|
||||||
const Value* val,
|
const Value* val,
|
||||||
unsigned int sizeToUse = 0)
|
unsigned int sizeToUse)
|
||||||
{
|
{
|
||||||
assert(! automaticVarsAreaFrozen &&
|
assert(! automaticVarsAreaFrozen &&
|
||||||
"Size of auto vars area has been used to compute an offset so "
|
"Size of auto vars area has been used to compute an offset so "
|
||||||
|
|
|
@ -44,8 +44,8 @@ void
|
||||||
MachineInstr::SetMachineOperandVal(unsigned int i,
|
MachineInstr::SetMachineOperandVal(unsigned int i,
|
||||||
MachineOperand::MachineOperandType opType,
|
MachineOperand::MachineOperandType opType,
|
||||||
Value* _val,
|
Value* _val,
|
||||||
bool isdef=false,
|
bool isdef,
|
||||||
bool isDefAndUse=false)
|
bool isDefAndUse)
|
||||||
{
|
{
|
||||||
assert(i < operands.size());
|
assert(i < operands.size());
|
||||||
operands[i].Initialize(opType, _val);
|
operands[i].Initialize(opType, _val);
|
||||||
|
@ -69,9 +69,9 @@ MachineInstr::SetMachineOperandConst(unsigned int i,
|
||||||
void
|
void
|
||||||
MachineInstr::SetMachineOperandReg(unsigned int i,
|
MachineInstr::SetMachineOperandReg(unsigned int i,
|
||||||
int regNum,
|
int regNum,
|
||||||
bool isdef=false,
|
bool isdef,
|
||||||
bool isDefAndUse=false,
|
bool isDefAndUse,
|
||||||
bool isCCReg=false)
|
bool isCCReg)
|
||||||
{
|
{
|
||||||
assert(i < operands.size());
|
assert(i < operands.size());
|
||||||
operands[i].InitializeReg(regNum, isCCReg);
|
operands[i].InitializeReg(regNum, isCCReg);
|
||||||
|
|
|
@ -138,7 +138,7 @@ static bool EatsUnboundedNumberOfValues(const Option *O) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void cl::ParseCommandLineOptions(int &argc, char **argv,
|
void cl::ParseCommandLineOptions(int &argc, char **argv,
|
||||||
const char *Overview = 0) {
|
const char *Overview) {
|
||||||
assert((!getOpts().empty() || !getPositionalOpts().empty()) &&
|
assert((!getOpts().empty() || !getPositionalOpts().empty()) &&
|
||||||
"No options specified, or ParseCommandLineOptions called more"
|
"No options specified, or ParseCommandLineOptions called more"
|
||||||
" than once!");
|
" than once!");
|
||||||
|
@ -396,7 +396,7 @@ void cl::ParseCommandLineOptions(int &argc, char **argv,
|
||||||
// Option Base class implementation
|
// Option Base class implementation
|
||||||
//
|
//
|
||||||
|
|
||||||
bool Option::error(string Message, const char *ArgName = 0) {
|
bool Option::error(string Message, const char *ArgName) {
|
||||||
if (ArgName == 0) ArgName = ArgStr;
|
if (ArgName == 0) ArgName = ArgStr;
|
||||||
if (ArgName[0] == 0)
|
if (ArgName[0] == 0)
|
||||||
cerr << HelpStr; // Be nice for positional arguments
|
cerr << HelpStr; // Be nice for positional arguments
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include "Support/CommandLine.h"
|
#include "Support/CommandLine.h"
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#include <link.h>
|
#include <link.h>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
struct PluginLoader {
|
struct PluginLoader {
|
||||||
|
@ -25,6 +26,6 @@ namespace {
|
||||||
}
|
}
|
||||||
|
|
||||||
// This causes operator= above to be invoked for every -load option.
|
// This causes operator= above to be invoked for every -load option.
|
||||||
static cl::opt<PluginLoader, false, cl::parser<string> >
|
static cl::opt<PluginLoader, false, cl::parser<std::string> >
|
||||||
LoadOpt("load", cl::ZeroOrMore, cl::value_desc("plugin.so"),
|
LoadOpt("load", cl::ZeroOrMore, cl::value_desc("plugin.so"),
|
||||||
cl::desc("Load the specified plugin"));
|
cl::desc("Load the specified plugin"));
|
||||||
|
|
|
@ -74,11 +74,11 @@ Annotation *TargetData::TypeAnFactory(AnnotationID AID, const Annotable *T,
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
TargetData::TargetData(const std::string &TargetName,
|
TargetData::TargetData(const std::string &TargetName,
|
||||||
unsigned char IntRegSize = 8, unsigned char PtrSize = 8,
|
unsigned char IntRegSize, unsigned char PtrSize,
|
||||||
unsigned char PtrAl = 8, unsigned char DoubleAl = 8,
|
unsigned char PtrAl, unsigned char DoubleAl,
|
||||||
unsigned char FloatAl = 4, unsigned char LongAl = 8,
|
unsigned char FloatAl, unsigned char LongAl,
|
||||||
unsigned char IntAl = 4, unsigned char ShortAl = 2,
|
unsigned char IntAl, unsigned char ShortAl,
|
||||||
unsigned char ByteAl = 1)
|
unsigned char ByteAl)
|
||||||
: AID(AnnotationManager::getID("TargetData::" + TargetName)) {
|
: AID(AnnotationManager::getID("TargetData::" + TargetName)) {
|
||||||
AnnotationManager::registerAnnotationFactory(AID, TypeAnFactory, this);
|
AnnotationManager::registerAnnotationFactory(AID, TypeAnFactory, this);
|
||||||
|
|
||||||
|
|
|
@ -108,7 +108,7 @@ const Type *MutateStructTypes::ConvertType(const Type *Ty) {
|
||||||
//
|
//
|
||||||
void MutateStructTypes::AdjustIndices(const CompositeType *OldTy,
|
void MutateStructTypes::AdjustIndices(const CompositeType *OldTy,
|
||||||
vector<Value*> &Idx,
|
vector<Value*> &Idx,
|
||||||
unsigned i = 0) {
|
unsigned i) {
|
||||||
assert(i < Idx.size() && "i out of range!");
|
assert(i < Idx.size() && "i out of range!");
|
||||||
const CompositeType *NewCT = cast<CompositeType>(ConvertType(OldTy));
|
const CompositeType *NewCT = cast<CompositeType>(ConvertType(OldTy));
|
||||||
if (NewCT == OldTy) return; // No adjustment unless type changes
|
if (NewCT == OldTy) return; // No adjustment unless type changes
|
||||||
|
|
|
@ -1759,5 +1759,6 @@ bool PoolAllocate::run(Module &M) {
|
||||||
//
|
//
|
||||||
Pass *createPoolAllocatePass() {
|
Pass *createPoolAllocatePass() {
|
||||||
assert(0 && "Pool allocator disabled!");
|
assert(0 && "Pool allocator disabled!");
|
||||||
|
return 0;
|
||||||
//return new PoolAllocate();
|
//return new PoolAllocate();
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ static Statistic<> NumSwapped("reassociate\t- Number of insts with operands swap
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class Reassociate : public FunctionPass {
|
class Reassociate : public FunctionPass {
|
||||||
map<BasicBlock*, unsigned> RankMap;
|
std::map<BasicBlock*, unsigned> RankMap;
|
||||||
public:
|
public:
|
||||||
bool runOnFunction(Function &F);
|
bool runOnFunction(Function &F);
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ static const Type *getStructOffsetStep(const StructType *STy, unsigned &Offset,
|
||||||
//
|
//
|
||||||
const Type *getStructOffsetType(const Type *Ty, unsigned &Offset,
|
const Type *getStructOffsetType(const Type *Ty, unsigned &Offset,
|
||||||
std::vector<Value*> &Indices,
|
std::vector<Value*> &Indices,
|
||||||
bool StopEarly = true) {
|
bool StopEarly) {
|
||||||
if (Offset == 0 && StopEarly && !Indices.empty())
|
if (Offset == 0 && StopEarly && !Indices.empty())
|
||||||
return Ty; // Return the leaf type
|
return Ty; // Return the leaf type
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ const Type *getStructOffsetType(const Type *Ty, unsigned &Offset,
|
||||||
//
|
//
|
||||||
const Type *ConvertableToGEP(const Type *Ty, Value *OffsetVal,
|
const Type *ConvertableToGEP(const Type *Ty, Value *OffsetVal,
|
||||||
std::vector<Value*> &Indices,
|
std::vector<Value*> &Indices,
|
||||||
BasicBlock::iterator *BI = 0) {
|
BasicBlock::iterator *BI) {
|
||||||
const CompositeType *CompTy = dyn_cast<CompositeType>(Ty);
|
const CompositeType *CompTy = dyn_cast<CompositeType>(Ty);
|
||||||
if (CompTy == 0) return 0;
|
if (CompTy == 0) return 0;
|
||||||
|
|
||||||
|
|
|
@ -138,7 +138,7 @@ static bool EatsUnboundedNumberOfValues(const Option *O) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void cl::ParseCommandLineOptions(int &argc, char **argv,
|
void cl::ParseCommandLineOptions(int &argc, char **argv,
|
||||||
const char *Overview = 0) {
|
const char *Overview) {
|
||||||
assert((!getOpts().empty() || !getPositionalOpts().empty()) &&
|
assert((!getOpts().empty() || !getPositionalOpts().empty()) &&
|
||||||
"No options specified, or ParseCommandLineOptions called more"
|
"No options specified, or ParseCommandLineOptions called more"
|
||||||
" than once!");
|
" than once!");
|
||||||
|
@ -396,7 +396,7 @@ void cl::ParseCommandLineOptions(int &argc, char **argv,
|
||||||
// Option Base class implementation
|
// Option Base class implementation
|
||||||
//
|
//
|
||||||
|
|
||||||
bool Option::error(string Message, const char *ArgName = 0) {
|
bool Option::error(string Message, const char *ArgName) {
|
||||||
if (ArgName == 0) ArgName = ArgStr;
|
if (ArgName == 0) ArgName = ArgStr;
|
||||||
if (ArgName[0] == 0)
|
if (ArgName[0] == 0)
|
||||||
cerr << HelpStr; // Be nice for positional arguments
|
cerr << HelpStr; // Be nice for positional arguments
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include "Support/CommandLine.h"
|
#include "Support/CommandLine.h"
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#include <link.h>
|
#include <link.h>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
struct PluginLoader {
|
struct PluginLoader {
|
||||||
|
@ -25,6 +26,6 @@ namespace {
|
||||||
}
|
}
|
||||||
|
|
||||||
// This causes operator= above to be invoked for every -load option.
|
// This causes operator= above to be invoked for every -load option.
|
||||||
static cl::opt<PluginLoader, false, cl::parser<string> >
|
static cl::opt<PluginLoader, false, cl::parser<std::string> >
|
||||||
LoadOpt("load", cl::ZeroOrMore, cl::value_desc("plugin.so"),
|
LoadOpt("load", cl::ZeroOrMore, cl::value_desc("plugin.so"),
|
||||||
cl::desc("Load the specified plugin"));
|
cl::desc("Load the specified plugin"));
|
||||||
|
|
Loading…
Reference in New Issue