30 ModuleHasher(
Module &M) : TheModule(
M) {}
39 for (
auto &
F : TheModule) {
40 if (
F.isDeclaration() ||
F.hasLocalLinkage() || !
F.hasName())
42 auto Name =
F.getName();
45 for (
auto &GV : TheModule.globals()) {
46 if (GV.isDeclaration() || GV.hasLocalLinkage() || !GV.hasName())
48 auto Name = GV.getName();
57 TheHash = std::string(Result);
74 for (
auto &GO : M.global_objects())
76 for (
auto &GA : M.aliases())
Module.h This file contains the declarations for the Module class.
This file defines the SmallString class.
A container for analyses that lazily runs them and caches their results.
void update(ArrayRef< uint8_t > Data)
Updates the hash for the byte stream provided.
static void stringifyResult(MD5Result &Result, SmallVectorImpl< char > &Str)
Translates the bytes in Res to a hex string that is deposited into Str.
void final(MD5Result &Result)
Finishes off the hash and puts the result in result.
A Module instance is used to store all the information related to an LLVM module.
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses none()
Convenience factory function for the empty preserved set.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
bool nameUnamedGlobals(Module &M)
Rename all the anon globals in the module using a hash computed from the list of public globals in th...
auto count(R &&Range, const E &Element)
Wrapper function around std::count to count the number of times an element Element occurs in the give...
std::array< uint32_t, 5 > ModuleHash
160 bits SHA1