35 void srand(
unsigned int seed) {
40 next = next * 1103515245 + 12345;
41 return (
unsigned int)(next / 65536) % 32768;
55 bool runOnModule(
Module &M)
override {
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()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
A Module instance is used to store all the information related to an LLVM module. ...
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
StructType - Class to represent struct types.
bool isLiteral() const
isLiteral - Return true if this type is uniqued by structural equivalence, false if it is a struct de...
const std::string & getModuleIdentifier() const
Get the module identifier which is, essentially, the name of the module.
global_iterator global_begin()
LLVM_CONSTEXPR size_t array_lengthof(T(&)[N])
Find the length of an array.
alias_iterator alias_end()
Represent the analysis usage information of a pass.
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)
Module.h This file contains the declarations for the Module class.
alias_iterator alias_begin()
StringRef getName() const
getName - Return the name for this struct type if it has an identity.
void setPreservesAll()
Set by analyses that do not transform their input at all.
static StringRef toStringRef(bool B)
Construct a string ref from a boolean.
void setName(StringRef Name)
setName - Change the name of this type to the specified name, or to a name with a suffix if there is ...
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
StringRef - Represent a constant reference to a string, i.e.
void initializeMetaRenamerPass(PassRegistry &)
TypeFinder - Walk over a module, identifying all of the types that are used by the module...
ModulePass * createMetaRenamerPass()
bool empty() const
empty - Check if the string is empty.