aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/CBackend/CBackend.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2007-05-01 21:15:47 +0000
committerDevang Patel <dpatel@apple.com>2007-05-01 21:15:47 +0000
commit794fd75c67a2cdc128d67342c6d88a504d186896 (patch)
tree6b805aa4a576e9de6cbf096d2fb85063b3fb8fca /lib/Target/CBackend/CBackend.cpp
parente50fb9ac174b791047ffa8648443ab94b2097cd9 (diff)
Do not use typeinfo to identify pass in pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36632 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/CBackend/CBackend.cpp')
-rw-r--r--lib/Target/CBackend/CBackend.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index ac7251f898..e29edff13b 100644
--- a/lib/Target/CBackend/CBackend.cpp
+++ b/lib/Target/CBackend/CBackend.cpp
@@ -56,6 +56,10 @@ namespace {
/// external functions with the same name.
///
class CBackendNameAllUsedStructsAndMergeFunctions : public ModulePass {
+ public:
+ static const int ID;
+ CBackendNameAllUsedStructsAndMergeFunctions()
+ : ModulePass((intptr_t)&ID) {}
void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<FindUsedTypes>();
}
@@ -67,6 +71,8 @@ namespace {
virtual bool runOnModule(Module &M);
};
+ const int CBackendNameAllUsedStructsAndMergeFunctions::ID = 0;
+
/// CWriter - This class is the main chunk of code that converts an LLVM
/// module to a C translation unit.
class CWriter : public FunctionPass, public InstVisitor<CWriter> {
@@ -82,8 +88,10 @@ namespace {
std::set<Function*> intrinsicPrototypesAlreadyGenerated;
public:
- CWriter(std::ostream &o) : Out(o), IL(0), Mang(0), LI(0), TheModule(0),
- TAsm(0), TD(0) {}
+ static const int ID;
+ CWriter(std::ostream &o)
+ : FunctionPass((intptr_t)&ID), Out(o), IL(0), Mang(0), LI(0),
+ TheModule(0), TAsm(0), TD(0) {}
virtual const char *getPassName() const { return "C backend"; }
@@ -256,6 +264,8 @@ namespace {
};
}
+const int CWriter::ID = 0;
+
/// This method inserts names for any unnamed structure types that are used by
/// the program, and removes names from structure types that are not used by the
/// program.