projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
back out my recent commit (r80858), it seems to break self-hosting buildbot's stage...
[oota-llvm.git]
/
lib
/
Analysis
/
IPA
/
FindUsedTypes.cpp
diff --git
a/lib/Analysis/IPA/FindUsedTypes.cpp
b/lib/Analysis/IPA/FindUsedTypes.cpp
index d52617da08896948ed5f09cad7bbff9a8fe74458..c4fb0b9a4e3ddc8fee591159df4ed6ebe93d9012 100644
(file)
--- a/
lib/Analysis/IPA/FindUsedTypes.cpp
+++ b/
lib/Analysis/IPA/FindUsedTypes.cpp
@@
-2,8
+2,8
@@
//
// The LLVM Compiler Infrastructure
//
//
// The LLVM Compiler Infrastructure
//
-// This file
was developed by the LLVM research group and is distributed under
-//
the University of Illinois Open Source
License. See LICENSE.TXT for details.
+// This file
is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
//
//===----------------------------------------------------------------------===//
//
@@
-19,11
+19,12
@@
#include "llvm/Module.h"
#include "llvm/Assembly/Writer.h"
#include "llvm/Support/InstIterator.h"
#include "llvm/Module.h"
#include "llvm/Assembly/Writer.h"
#include "llvm/Support/InstIterator.h"
+#include "llvm/Support/raw_ostream.h"
using namespace llvm;
using namespace llvm;
-c
onst c
har FindUsedTypes::ID = 0;
+char FindUsedTypes::ID = 0;
static RegisterPass<FindUsedTypes>
static RegisterPass<FindUsedTypes>
-X("print
usedtypes", "Find Used Types"
);
+X("print
-used-types", "Find Used Types", false, true
);
// IncorporateType - Incorporate one type and all of its subtypes into the
// collection of used types.
// IncorporateType - Incorporate one type and all of its subtypes into the
// collection of used types.
@@
-59,7
+60,8
@@
bool FindUsedTypes::runOnModule(Module &m) {
UsedTypes.clear(); // reset if run multiple times...
// Loop over global variables, incorporating their types
UsedTypes.clear(); // reset if run multiple times...
// Loop over global variables, incorporating their types
- for (Module::const_global_iterator I = m.global_begin(), E = m.global_end(); I != E; ++I) {
+ for (Module::const_global_iterator I = m.global_begin(), E = m.global_end();
+ I != E; ++I) {
IncorporateType(I->getType());
if (I->hasInitializer())
IncorporateValue(I->getInitializer());
IncorporateType(I->getType());
if (I->hasInitializer())
IncorporateValue(I->getInitializer());
@@
-90,12
+92,12
@@
bool FindUsedTypes::runOnModule(Module &m) {
// passed in, then the types are printed symbolically if possible, using the
// symbol table from the module.
//
// passed in, then the types are printed symbolically if possible, using the
// symbol table from the module.
//
-void FindUsedTypes::print(
std::ostream &o
, const Module *M) const {
-
o
<< "Types in use by this module:\n";
+void FindUsedTypes::print(
raw_ostream &OS
, const Module *M) const {
+
OS
<< "Types in use by this module:\n";
for (std::set<const Type *>::const_iterator I = UsedTypes.begin(),
for (std::set<const Type *>::const_iterator I = UsedTypes.begin(),
- E = UsedTypes.end(); I != E; ++I)
- WriteTypeSymbolic(o << " ", *I, M) << "\n";
+ E = UsedTypes.end(); I != E; ++I) {
+ OS << " ";
+ WriteTypeSymbolic(OS, *I, M);
+ OS << '\n';
+ }
}
}
-
-// Ensure that this file gets linked in when FindUsedTypes.h is used.
-DEFINING_FILE_FOR(FindUsedTypes)