35 void srand(
unsigned int seed) {
40 next = next * 1103515245 + 12345;
41 return (
unsigned int)(next / 65536) % 32768;
45 static const char *
const metaNames[] = {
47 "foo",
"bar",
"baz",
"quux",
"barney",
"snork",
"zot",
"blam",
"hoge",
48 "wibble",
"wobble",
"widget",
"wombat",
"ham",
"eggs",
"pluto",
"spam"
52 Renamer(
unsigned int seed) {
56 const char *newName() {
73 bool runOnModule(
Module &M)
override {
77 unsigned int randSeed = 0;
81 Renamer renamer(randSeed);
98 GI->setName(
"global");
103 StructTypes.
run(M,
true);
105 if (STy->isLiteral() || STy->getName().empty())
continue;
108 STy->setName((
Twine(
"struct.") +
118 F.setName(renamer.newName());
126 if (!AI->getType()->isVoidTy())
133 if (!
I.getType()->isVoidTy())
143 "Assign new names to everything",
false,
false)
149 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...
Class to represent struct types.
const std::string & getModuleIdentifier() const
Get the module identifier which is, essentially, the name of the module.
global_iterator global_begin()
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
alias_iterator alias_end()
Represent the analysis usage information of a pass.
global_iterator global_end()
void run(const Module &M, bool onlyNamed)
Module.h This file contains the declarations for the Module class.
constexpr size_t array_lengthof(T(&)[N])
Find the length of an array.
alias_iterator alias_begin()
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
void setPreservesAll()
Set by analyses that do not transform their input at all.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
static StringRef toStringRef(bool B)
Construct a string ref from a boolean.
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()