LLVM Pass that renames all functions Below is an LLVM pass that I've written to rename all functions in an LLVM bitcode file. I would appreciate tips on what is well done and what is poorly done in the code below. In particular, is there a better way to go about writing LLVM passes. Bear in mind that I'm a novice at programming and so would also appreciate it if you could direct me to any resources that would be useful in improving my C++ code.

#include "llvm/Pass.h"
#include "llvm/IR/Function.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/TypeFinder.h"
#include "llvm/Transforms/IPO.h"

using namespace llvm;

namespace {

  struct FunctionRenamer : public ModulePass {
    static char ID; // Pass identification
    FunctionRenamer() : ModulePass(ID) {
      initializeFunctionRenamerPass(*PassRegistry::getPassRegistry());
    }

    void getAnalysisUsage(AnalysisUsage &amp;AU) const override {
      AU.addRequired&lt;TargetLibraryInfoWrapperPass&gt;();
      AU.setPreservesAll();
    }

    bool runOnModule(Module &amp;M) override {
      // Rename all functions
      const TargetLibraryInfo &amp;TLI =
        getAnalysis&lt;TargetLibraryInforWrapperPass&gt;().getTLI();
      for (auto &amp;F : M) {
        StringRef Name = F.getName();
        LibFunc Tmp;
        // Leave library functions alone because their presence or absence
        // could affect the behaviour of other passes.
        if (Name.startswith("llvm.") || (!Name.empty() &amp;&amp; Name[0] == 1) ||
            TLI.getLibFunc(F, Tmp))
          continue;

        F.setName(Name + "_2");
      }
      return true;
    }
  };
}

char FunctionRenamer::ID = 0;
INITIALIZE_PASS_BEGIN(FunctionRenamer, "functionrenamer",
                      "Rename all functions", false, false);
INITIALIZE_PASS_DEPENDENCY(TargetLibraryInfoWrapperPass);
INITIALIZE_PASS_END(FunctionRenamer, "functionrenamer",
                    "Rename all functions", false, false);
// ===-------------------------------------------------------==//
//
// Function Renamer - Renames all functions
//
ModulePass *llvm::createFunctionRenamerPass() {
  return new FunctionRenamer();
}
TargetLibraryInforWrapperPass seems to have one r too many.
Try using auto a bit more extensively. Almost always auto
Did you really mean '\1' or should that be '1' in the following line? Either way, use a character-literal to make it obvious it's not an error.

if (Name.startswith("llvm.") || (!Name.empty() &amp;&amp; Name[0] == 1) ||
                                                             ^

The same applies to using namespace llvm; as to using namespace std;:
Don't do it. Read "Why is “using namespace std” considered bad practice?" for why.