aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2007-05-02 21:39:20 +0000
committerDevang Patel <dpatel@apple.com>2007-05-02 21:39:20 +0000
commit3e15bf33e024b9df9e89351a165acfdb1dde51ed (patch)
tree2a1b470e139345efc714c51846d285e5a52a9f12 /lib/CodeGen
parent749a89bd53422c2aba0d78dc6e72a6d498b453e1 (diff)
downloadexternal_llvm-3e15bf33e024b9df9e89351a165acfdb1dde51ed.zip
external_llvm-3e15bf33e024b9df9e89351a165acfdb1dde51ed.tar.gz
external_llvm-3e15bf33e024b9df9e89351a165acfdb1dde51ed.tar.bz2
Use 'static const char' instead of 'static const int'.
Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36652 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter.cpp2
-rw-r--r--lib/CodeGen/BranchFolding.cpp4
-rw-r--r--lib/CodeGen/ELFWriter.cpp2
-rw-r--r--lib/CodeGen/ELFWriter.h2
-rw-r--r--lib/CodeGen/LiveIntervalAnalysis.cpp2
-rw-r--r--lib/CodeGen/LiveVariables.cpp2
-rw-r--r--lib/CodeGen/MachOWriter.cpp2
-rw-r--r--lib/CodeGen/MachOWriter.h2
-rw-r--r--lib/CodeGen/MachineFunction.cpp8
-rw-r--r--lib/CodeGen/MachineModuleInfo.cpp6
-rw-r--r--lib/CodeGen/PHIElimination.cpp4
-rw-r--r--lib/CodeGen/PrologEpilogInserter.cpp4
-rw-r--r--lib/CodeGen/RegAllocLinearScan.cpp4
-rw-r--r--lib/CodeGen/RegAllocLocal.cpp4
-rw-r--r--lib/CodeGen/RegAllocSimple.cpp4
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp2
-rw-r--r--lib/CodeGen/TwoAddressInstructionPass.cpp4
-rw-r--r--lib/CodeGen/UnreachableBlockElim.cpp4
18 files changed, 31 insertions, 31 deletions
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp
index 4ce379c..999a91b 100644
--- a/lib/CodeGen/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter.cpp
@@ -32,7 +32,7 @@ using namespace llvm;
static cl::opt<bool>
AsmVerbose("asm-verbose", cl::Hidden, cl::desc("Add comments to directives."));
-const int AsmPrinter::ID = 0;
+const char AsmPrinter::ID = 0;
AsmPrinter::AsmPrinter(std::ostream &o, TargetMachine &tm,
const TargetAsmInfo *T)
: MachineFunctionPass((intptr_t)&ID), FunctionNumber(0), O(o), TM(tm), TAI(T)
diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp
index 394fe7b..2cad5a7 100644
--- a/lib/CodeGen/BranchFolding.cpp
+++ b/lib/CodeGen/BranchFolding.cpp
@@ -39,7 +39,7 @@ static cl::opt<bool> EnableTailMerge("enable-tail-merge", cl::Hidden);
namespace {
struct BranchFolder : public MachineFunctionPass {
- static const int ID;
+ static const char ID;
BranchFolder() : MachineFunctionPass((intptr_t)&ID) {}
virtual bool runOnMachineFunction(MachineFunction &MF);
@@ -67,7 +67,7 @@ namespace {
MachineBasicBlock *TBB, MachineBasicBlock *FBB,
const std::vector<MachineOperand> &Cond);
};
- const int BranchFolder::ID = 0;
+ const char BranchFolder::ID = 0;
}
FunctionPass *llvm::createBranchFoldingPass() { return new BranchFolder(); }
diff --git a/lib/CodeGen/ELFWriter.cpp b/lib/CodeGen/ELFWriter.cpp
index ce53409..9ca7cf1 100644
--- a/lib/CodeGen/ELFWriter.cpp
+++ b/lib/CodeGen/ELFWriter.cpp
@@ -47,7 +47,7 @@
#include <list>
using namespace llvm;
-const int ELFWriter::ID = 0;
+const char ELFWriter::ID = 0;
/// AddELFWriter - Concrete function to add the ELF writer to the function pass
/// manager.
MachineCodeEmitter *llvm::AddELFWriter(FunctionPassManager &FPM,
diff --git a/lib/CodeGen/ELFWriter.h b/lib/CodeGen/ELFWriter.h
index 8b577a0..f8f82de 100644
--- a/lib/CodeGen/ELFWriter.h
+++ b/lib/CodeGen/ELFWriter.h
@@ -30,7 +30,7 @@ namespace llvm {
class ELFWriter : public MachineFunctionPass {
friend class ELFCodeEmitter;
public:
- static const int ID;
+ static const char ID;
MachineCodeEmitter &getMachineCodeEmitter() const {
return *(MachineCodeEmitter*)MCE;
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp
index d11de96..5e69852 100644
--- a/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -44,7 +44,7 @@ STATISTIC(numPeep , "Number of identity moves eliminated after coalescing");
STATISTIC(numFolded , "Number of loads/stores folded into instructions");
STATISTIC(numAborts , "Number of times interval joining aborted");
-const int LiveIntervals::ID = 0;
+const char LiveIntervals::ID = 0;
namespace {
RegisterPass<LiveIntervals> X("liveintervals", "Live Interval Analysis");
diff --git a/lib/CodeGen/LiveVariables.cpp b/lib/CodeGen/LiveVariables.cpp
index 3ea60bc..796f160 100644
--- a/lib/CodeGen/LiveVariables.cpp
+++ b/lib/CodeGen/LiveVariables.cpp
@@ -37,7 +37,7 @@
#include <algorithm>
using namespace llvm;
-const int LiveVariables::ID = 0;
+const char LiveVariables::ID = 0;
static RegisterPass<LiveVariables> X("livevars", "Live Variable Analysis");
void LiveVariables::VarInfo::dump() const {
diff --git a/lib/CodeGen/MachOWriter.cpp b/lib/CodeGen/MachOWriter.cpp
index f8dccc1..cec245d 100644
--- a/lib/CodeGen/MachOWriter.cpp
+++ b/lib/CodeGen/MachOWriter.cpp
@@ -317,7 +317,7 @@ void MachOCodeEmitter::emitJumpTables(MachineJumpTableInfo *MJTI) {
// MachOWriter Implementation
//===----------------------------------------------------------------------===//
-const int MachOWriter::ID = 0;
+const char MachOWriter::ID = 0;
MachOWriter::MachOWriter(std::ostream &o, TargetMachine &tm)
: MachineFunctionPass((intptr_t)&ID), O(o), TM(tm) {
is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64;
diff --git a/lib/CodeGen/MachOWriter.h b/lib/CodeGen/MachOWriter.h
index d4c146d..6c44662 100644
--- a/lib/CodeGen/MachOWriter.h
+++ b/lib/CodeGen/MachOWriter.h
@@ -84,7 +84,7 @@ namespace llvm {
class MachOWriter : public MachineFunctionPass {
friend class MachOCodeEmitter;
public:
- static const int ID;
+ static const char ID;
MachineCodeEmitter &getMachineCodeEmitter() const {
return *(MachineCodeEmitter*)MCE;
}
diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp
index 9b43e65..9690eea 100644
--- a/lib/CodeGen/MachineFunction.cpp
+++ b/lib/CodeGen/MachineFunction.cpp
@@ -44,7 +44,7 @@ void MachineFunctionPass::virtfn() {}
namespace {
struct VISIBILITY_HIDDEN Printer : public MachineFunctionPass {
- static const int ID;
+ static const char ID;
std::ostream *OS;
const std::string Banner;
@@ -64,7 +64,7 @@ namespace {
return false;
}
};
- const int Printer::ID = 0;
+ const char Printer::ID = 0;
}
/// Returns a newly-created MachineFunction Printer pass. The default output
@@ -77,7 +77,7 @@ FunctionPass *llvm::createMachineFunctionPrinterPass(std::ostream *OS,
namespace {
struct VISIBILITY_HIDDEN Deleter : public MachineFunctionPass {
- static const int ID;
+ static const char ID;
Deleter() : MachineFunctionPass((intptr_t)&ID) {}
const char *getPassName() const { return "Machine Code Deleter"; }
@@ -88,7 +88,7 @@ namespace {
return true;
}
};
- const int Deleter::ID = 0;
+ const char Deleter::ID = 0;
}
/// MachineCodeDeletion Pass - This pass deletes all of the machine code for
diff --git a/lib/CodeGen/MachineModuleInfo.cpp b/lib/CodeGen/MachineModuleInfo.cpp
index d62eb96..ab664ac 100644
--- a/lib/CodeGen/MachineModuleInfo.cpp
+++ b/lib/CodeGen/MachineModuleInfo.cpp
@@ -30,7 +30,7 @@ using namespace llvm::dwarf;
namespace {
RegisterPass<MachineModuleInfo> X("machinemoduleinfo", "Module Information");
}
-const int MachineModuleInfo::ID = 0;
+const char MachineModuleInfo::ID = 0;
//===----------------------------------------------------------------------===//
@@ -1751,14 +1751,14 @@ Function *MachineModuleInfo::getPersonality() const {
namespace llvm {
struct DebugLabelFolder : public MachineFunctionPass {
- static const int ID;
+ static const char ID;
DebugLabelFolder() : MachineFunctionPass((intptr_t)&ID) {}
virtual bool runOnMachineFunction(MachineFunction &MF);
virtual const char *getPassName() const { return "Label Folder"; }
};
-const int DebugLabelFolder::ID = 0;
+const char DebugLabelFolder::ID = 0;
bool DebugLabelFolder::runOnMachineFunction(MachineFunction &MF) {
// Get machine module info.
diff --git a/lib/CodeGen/PHIElimination.cpp b/lib/CodeGen/PHIElimination.cpp
index f26819d..91dbc2e 100644
--- a/lib/CodeGen/PHIElimination.cpp
+++ b/lib/CodeGen/PHIElimination.cpp
@@ -33,7 +33,7 @@ STATISTIC(NumAtomic, "Number of atomic phis lowered");
namespace {
struct VISIBILITY_HIDDEN PNE : public MachineFunctionPass {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
PNE() : MachineFunctionPass((intptr_t)&ID) {}
bool runOnMachineFunction(MachineFunction &Fn) {
@@ -76,7 +76,7 @@ namespace {
VRegPHIUse VRegPHIUseCount;
};
- const int PNE::ID = 0;
+ const char PNE::ID = 0;
RegisterPass<PNE> X("phi-node-elimination",
"Eliminate PHI nodes for register allocation");
}
diff --git a/lib/CodeGen/PrologEpilogInserter.cpp b/lib/CodeGen/PrologEpilogInserter.cpp
index 927f7d1..18b2d7d 100644
--- a/lib/CodeGen/PrologEpilogInserter.cpp
+++ b/lib/CodeGen/PrologEpilogInserter.cpp
@@ -32,7 +32,7 @@ using namespace llvm;
namespace {
struct VISIBILITY_HIDDEN PEI : public MachineFunctionPass {
- static const int ID;
+ static const char ID;
PEI() : MachineFunctionPass((intptr_t)&ID) {}
const char *getPassName() const {
@@ -101,7 +101,7 @@ namespace {
void replaceFrameIndices(MachineFunction &Fn);
void insertPrologEpilogCode(MachineFunction &Fn);
};
- const int PEI::ID = 0;
+ const char PEI::ID = 0;
}
diff --git a/lib/CodeGen/RegAllocLinearScan.cpp b/lib/CodeGen/RegAllocLinearScan.cpp
index b45d983..1e345a4 100644
--- a/lib/CodeGen/RegAllocLinearScan.cpp
+++ b/lib/CodeGen/RegAllocLinearScan.cpp
@@ -48,7 +48,7 @@ namespace {
static unsigned numIntervals = 0;
struct VISIBILITY_HIDDEN RA : public MachineFunctionPass {
- static const int ID;
+ static const char ID;
RA() : MachineFunctionPass((intptr_t)&ID) {}
typedef std::pair<LiveInterval*, LiveInterval::iterator> IntervalPtr;
@@ -149,7 +149,7 @@ namespace {
}
}
};
- const int RA::ID = 0;
+ const char RA::ID = 0;
}
void RA::ComputeRelatedRegClasses() {
diff --git a/lib/CodeGen/RegAllocLocal.cpp b/lib/CodeGen/RegAllocLocal.cpp
index 4494552..500ed87 100644
--- a/lib/CodeGen/RegAllocLocal.cpp
+++ b/lib/CodeGen/RegAllocLocal.cpp
@@ -44,7 +44,7 @@ namespace {
class VISIBILITY_HIDDEN RA : public MachineFunctionPass {
public:
- static const int ID;
+ static const char ID;
RA() : MachineFunctionPass((intptr_t)&ID) {}
private:
const TargetMachine *TM;
@@ -228,7 +228,7 @@ namespace {
void reloadPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator &I,
unsigned PhysReg);
};
- const int RA::ID = 0;
+ const char RA::ID = 0;
}
/// getStackSpaceFor - This allocates space for the specified virtual register
diff --git a/lib/CodeGen/RegAllocSimple.cpp b/lib/CodeGen/RegAllocSimple.cpp
index 771c68b..181ba03 100644
--- a/lib/CodeGen/RegAllocSimple.cpp
+++ b/lib/CodeGen/RegAllocSimple.cpp
@@ -39,7 +39,7 @@ namespace {
class VISIBILITY_HIDDEN RegAllocSimple : public MachineFunctionPass {
public:
- static const int ID;
+ static const char ID;
RegAllocSimple() : MachineFunctionPass((intptr_t)&ID) {}
private:
MachineFunction *MF;
@@ -94,7 +94,7 @@ namespace {
void spillVirtReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,
unsigned VirtReg, unsigned PhysReg);
};
- const int RegAllocSimple::ID = 0;
+ const char RegAllocSimple::ID = 0;
}
/// getStackSpaceFor - This allocates space for the specified virtual
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index c83eb5b..3f6a10a 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -5012,4 +5012,4 @@ SelectInlineAsmMemoryOperands(std::vector<SDOperand> &Ops, SelectionDAG &DAG) {
Ops.push_back(InOps.back());
}
-const int SelectionDAGISel::ID = 0;
+const char SelectionDAGISel::ID = 0;
diff --git a/lib/CodeGen/TwoAddressInstructionPass.cpp b/lib/CodeGen/TwoAddressInstructionPass.cpp
index 455993c..dfbc4a7 100644
--- a/lib/CodeGen/TwoAddressInstructionPass.cpp
+++ b/lib/CodeGen/TwoAddressInstructionPass.cpp
@@ -50,7 +50,7 @@ STATISTIC(NumConvertedTo3Addr, "Number of instructions promoted to 3-address");
namespace {
struct VISIBILITY_HIDDEN TwoAddressInstructionPass
: public MachineFunctionPass {
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
TwoAddressInstructionPass() : MachineFunctionPass((intptr_t)&ID) {}
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
@@ -59,7 +59,7 @@ namespace {
bool runOnMachineFunction(MachineFunction&);
};
- const int TwoAddressInstructionPass::ID = 0;
+ const char TwoAddressInstructionPass::ID = 0;
RegisterPass<TwoAddressInstructionPass>
X("twoaddressinstruction", "Two-Address instruction pass");
}
diff --git a/lib/CodeGen/UnreachableBlockElim.cpp b/lib/CodeGen/UnreachableBlockElim.cpp
index f66a771..24ee42e 100644
--- a/lib/CodeGen/UnreachableBlockElim.cpp
+++ b/lib/CodeGen/UnreachableBlockElim.cpp
@@ -35,10 +35,10 @@ namespace {
class VISIBILITY_HIDDEN UnreachableBlockElim : public FunctionPass {
virtual bool runOnFunction(Function &F);
public:
- static const int ID; // Pass identifcation, replacement for typeid
+ static const char ID; // Pass identifcation, replacement for typeid
UnreachableBlockElim() : FunctionPass((intptr_t)&ID) {}
};
- const int UnreachableBlockElim::ID = 0;
+ const char UnreachableBlockElim::ID = 0;
RegisterPass<UnreachableBlockElim>
X("unreachableblockelim", "Remove unreachable blocks from the CFG");
}