35 void srand(
unsigned int seed) {
41 return (
unsigned int)(
next / 65536) % 32768;
55 bool runOnModule(
Module &M) {
56 static const char *
const metaNames[] = {
58 "foo",
"bar",
"baz",
"quux",
"barney",
"snork",
"zot",
"blam",
"hoge",
59 "wibble",
"wobble",
"widget",
"wombat",
"ham",
"eggs",
"pluto",
"spam"
65 unsigned int randSeed = 0;
90 GI->setName(
"global");
95 StructTypes.
run(M,
true);
96 for (
unsigned i = 0, e = StructTypes.
size(); i != e; ++i) {
101 STy->
setName((
Twine(
"struct.") + metaNames[prng.rand() %
121 if (!AI->getType()->isVoidTy())
128 if (!
I->getType()->isVoidTy())
138 "Assign new names to everything",
false,
false)
144 return new MetaRenamer();
static PassRegistry * getPassRegistry()
The main container class for the LLVM Intermediate Representation.
ID
LLVM Calling Convention Representation.
const std::string & getModuleIdentifier() const
global_iterator global_begin()
size_t array_lengthof(T(&)[N])
Find the length of an array.
alias_iterator alias_end()
ItTy next(ItTy it, Dist n)
StringRef toStringRef(bool B)
Construct a string ref from a boolean.
global_iterator global_end()
bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
void run(const Module &M, bool onlyNamed)
alias_iterator alias_begin()
StringRef getName() const
void setName(StringRef Name)
void initializeMetaRenamerPass(PassRegistry &)
ModulePass * createMetaRenamerPass()
bool empty() const
empty - Check if the string is empty.