diff options
| author | 2018-04-06 15:04:10 +0000 | |
|---|---|---|
| committer | 2018-04-06 15:04:10 +0000 | |
| commit | 4cabce93708ac7b290eacd7f90928878c4df8681 (patch) | |
| tree | be804aa491dea48ffa74b1a5dc60e90f8a1687aa /gnu/llvm/lib/CodeGen/CountingFunctionInserter.cpp | |
| parent | Patch binutils 2.17 so that it passes option -Wno-null-pointer-arithmetic (diff) | |
| download | wireguard-openbsd-4cabce93708ac7b290eacd7f90928878c4df8681.tar.xz wireguard-openbsd-4cabce93708ac7b290eacd7f90928878c4df8681.zip | |
Tedu files that got removed in LLVM 6.0.0.
Diffstat (limited to 'gnu/llvm/lib/CodeGen/CountingFunctionInserter.cpp')
| -rw-r--r-- | gnu/llvm/lib/CodeGen/CountingFunctionInserter.cpp | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/gnu/llvm/lib/CodeGen/CountingFunctionInserter.cpp b/gnu/llvm/lib/CodeGen/CountingFunctionInserter.cpp deleted file mode 100644 index 7f7350f5fb5..00000000000 --- a/gnu/llvm/lib/CodeGen/CountingFunctionInserter.cpp +++ /dev/null @@ -1,62 +0,0 @@ -//===- CountingFunctionInserter.cpp - Insert mcount-like function calls ---===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// Insert calls to counter functions, such as mcount, intended to be called -// once per function, at the beginning of each function. -// -//===----------------------------------------------------------------------===// - -#include "llvm/Analysis/GlobalsModRef.h" -#include "llvm/CodeGen/Passes.h" -#include "llvm/IR/Function.h" -#include "llvm/IR/Instructions.h" -#include "llvm/IR/Module.h" -#include "llvm/IR/Type.h" -#include "llvm/Pass.h" -using namespace llvm; - -namespace { - struct CountingFunctionInserter : public FunctionPass { - static char ID; // Pass identification, replacement for typeid - CountingFunctionInserter() : FunctionPass(ID) { - initializeCountingFunctionInserterPass(*PassRegistry::getPassRegistry()); - } - - void getAnalysisUsage(AnalysisUsage &AU) const override { - AU.addPreserved<GlobalsAAWrapperPass>(); - } - - bool runOnFunction(Function &F) override { - std::string CountingFunctionName = - F.getFnAttribute("counting-function").getValueAsString(); - if (CountingFunctionName.empty()) - return false; - - Type *VoidTy = Type::getVoidTy(F.getContext()); - Constant *CountingFn = - F.getParent()->getOrInsertFunction(CountingFunctionName, - VoidTy); - CallInst::Create(CountingFn, "", &*F.begin()->getFirstInsertionPt()); - return true; - } - }; - - char CountingFunctionInserter::ID = 0; -} - -INITIALIZE_PASS(CountingFunctionInserter, "cfinserter", - "Inserts calls to mcount-like functions", false, false) - -//===----------------------------------------------------------------------===// -// -// CountingFunctionInserter - Give any unnamed non-void instructions "tmp" names. -// -FunctionPass *llvm::createCountingFunctionInserterPass() { - return new CountingFunctionInserter(); -} |
