diff options
author | Eugene Zelenko <eugene.zelenko@gmail.com> | 2017-10-27 01:09:08 +0000 |
---|---|---|
committer | Eugene Zelenko <eugene.zelenko@gmail.com> | 2017-10-27 01:09:08 +0000 |
commit | 57bd5a0274d63a7ab53d8064ff916fc89a80a5df (patch) | |
tree | 8a7f4560d3ca9a3cdf98a6d28e0ca7f3373ebb63 /llvm/lib/Transforms/Utils/MetaRenamer.cpp | |
parent | 636ed47428c1cf9304c4131d631f3c0b72f020ad (diff) | |
download | llvm-57bd5a0274d63a7ab53d8064ff916fc89a80a5df.zip llvm-57bd5a0274d63a7ab53d8064ff916fc89a80a5df.tar.gz llvm-57bd5a0274d63a7ab53d8064ff916fc89a80a5df.tar.bz2 |
[Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 316724
Diffstat (limited to 'llvm/lib/Transforms/Utils/MetaRenamer.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/MetaRenamer.cpp | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Utils/MetaRenamer.cpp b/llvm/lib/Transforms/Utils/MetaRenamer.cpp index 9af9d5f..0f7bd76 100644 --- a/llvm/lib/Transforms/Utils/MetaRenamer.cpp +++ b/llvm/lib/Transforms/Utils/MetaRenamer.cpp @@ -15,16 +15,30 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallString.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/ADT/Twine.h" #include "llvm/Analysis/TargetLibraryInfo.h" +#include "llvm/IR/Argument.h" +#include "llvm/IR/BasicBlock.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/Function.h" +#include "llvm/IR/GlobalAlias.h" +#include "llvm/IR/GlobalVariable.h" +#include "llvm/IR/Instruction.h" #include "llvm/IR/Module.h" #include "llvm/IR/Type.h" #include "llvm/IR/TypeFinder.h" #include "llvm/Pass.h" #include "llvm/Transforms/IPO.h" + using namespace llvm; +static const char *const metaNames[] = { + // See http://en.wikipedia.org/wiki/Metasyntactic_variable + "foo", "bar", "baz", "quux", "barney", "snork", "zot", "blam", "hoge", + "wibble", "wobble", "widget", "wombat", "ham", "eggs", "pluto", "spam" +}; + namespace { // This PRNG is from the ISO C spec. It is intentionally simple and @@ -43,12 +57,6 @@ namespace { } }; - static const char *const metaNames[] = { - // See http://en.wikipedia.org/wiki/Metasyntactic_variable - "foo", "bar", "baz", "quux", "barney", "snork", "zot", "blam", "hoge", - "wibble", "wobble", "widget", "wombat", "ham", "eggs", "pluto", "spam" - }; - struct Renamer { Renamer(unsigned int seed) { prng.srand(seed); @@ -62,7 +70,9 @@ namespace { }; struct MetaRenamer : public ModulePass { - static char ID; // Pass identification, replacement for typeid + // Pass identification, replacement for typeid + static char ID; + MetaRenamer() : ModulePass(ID) { initializeMetaRenamerPass(*PassRegistry::getPassRegistry()); } @@ -148,14 +158,17 @@ namespace { return true; } }; -} + +} // end anonymous namespace char MetaRenamer::ID = 0; + INITIALIZE_PASS_BEGIN(MetaRenamer, "metarenamer", "Assign new names to everything", false, false) INITIALIZE_PASS_DEPENDENCY(TargetLibraryInfoWrapperPass) INITIALIZE_PASS_END(MetaRenamer, "metarenamer", "Assign new names to everything", false, false) + //===----------------------------------------------------------------------===// // // MetaRenamer - Rename everything with metasyntactic names. |