mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-28 22:00:30 +00:00
Added a stupid testcase for iterators.
llvm-svn: 17
This commit is contained in:
parent
9839031654
commit
f6f820bfac
@ -29,6 +29,25 @@
|
||||
#include "llvm/Tools/CommandLine.h"
|
||||
#include "llvm/Opt/AllOpts.h"
|
||||
|
||||
#if 1 // Testcase, TODO: REMOVE
|
||||
#include "llvm/CFG.h"
|
||||
#include "llvm/Assembly/Writer.h"
|
||||
#include "llvm/Method.h"
|
||||
static bool DoPrintM(Method *M) {
|
||||
df_iterator I = df_begin(M->getBasicBlocks().front(), false);
|
||||
df_iterator E = df_end(M->getBasicBlocks().front());
|
||||
unsigned i = 0;
|
||||
for (; I != E; ++I, ++i) {
|
||||
cerr << "Basic Block Visited #" << i << *I;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool DoPrint(Module *C) {
|
||||
return ApplyOptToAllMethods(C, DoPrintM);
|
||||
}
|
||||
#endif
|
||||
|
||||
struct {
|
||||
const string ArgName, Name;
|
||||
bool (*OptPtr)(Module *C);
|
||||
@ -38,6 +57,7 @@ struct {
|
||||
{ "-inline" ,"Method Inlining", DoMethodInlining },
|
||||
{ "-strip" ,"Strip Symbols", DoSymbolStripping },
|
||||
{ "-mstrip" ,"Strip Module Symbols", DoFullSymbolStripping },
|
||||
{ "-print" ,"Test printing stuff", DoPrint },
|
||||
};
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
Loading…
Reference in New Issue
Block a user