diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-09-13 23:44:23 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-09-13 23:44:23 +0000 |
commit | e59eaf407a675845e278c2769e3dbed9f1daae8c (patch) | |
tree | 30cd08523ff58bc894ac77a55f0b027c2a73f24d /lib/VMCore | |
parent | b9210123a9a006c5efe7feb70242c502433e780f (diff) | |
download | external_llvm-e59eaf407a675845e278c2769e3dbed9f1daae8c.zip external_llvm-e59eaf407a675845e278c2769e3dbed9f1daae8c.tar.gz external_llvm-e59eaf407a675845e278c2769e3dbed9f1daae8c.tar.bz2 |
Add support for the link-time pass list to Modules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16321 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/AsmWriter.cpp | 14 | ||||
-rw-r--r-- | lib/VMCore/Module.cpp | 6 |
2 files changed, 20 insertions, 0 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index 0c4a1f7..7f862df 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -777,6 +777,20 @@ void AssemblyWriter::printModule(const Module *M) { } Out << " ]\n"; } + + // Loop over the link time pass list and emit them + Module::pass_iterator PI = M->pass_begin(); + Module::pass_iterator PE = M->pass_end(); + if (LI != LE) { + Out << "passes = [\n"; + while (LI != LE) { + Out << "\"" << *LI << "\""; + ++LI; + if (LI != LE) + Out << ",\n"; + } + Out << " ]\n"; + } // Loop over the symbol table, emitting all named constants... printSymbolTable(M->getSymbolTable()); diff --git a/lib/VMCore/Module.cpp b/lib/VMCore/Module.cpp index d8caf7f..1dae14e 100644 --- a/lib/VMCore/Module.cpp +++ b/lib/VMCore/Module.cpp @@ -270,6 +270,12 @@ std::string Module::getTypeName(const Type *Ty) const { return ""; // Must not have found anything... } +void Module::removePass(const std::string& Lib) { + PassListType::iterator I = find(PassList.begin(),PassList.end(),Lib); + if (I != PassList.end()) + PassList.erase(I); +} + //===----------------------------------------------------------------------===// // Other module related stuff. |