diff options
| author | 2020-08-03 15:06:44 +0000 | |
|---|---|---|
| committer | 2020-08-03 15:06:44 +0000 | |
| commit | b64793999546ed8adebaeebd9d8345d18db8927d (patch) | |
| tree | 4357c27b561d73b0e089727c6ed659f2ceff5f47 /gnu/llvm/tools/opt/AnalysisWrappers.cpp | |
| parent | Add support for UTF-8 DISPLAY-HINTs with octet length. For now only (diff) | |
| download | wireguard-openbsd-b64793999546ed8adebaeebd9d8345d18db8927d.tar.xz wireguard-openbsd-b64793999546ed8adebaeebd9d8345d18db8927d.zip | |
Remove LLVM 8.0.1 files.
Diffstat (limited to 'gnu/llvm/tools/opt/AnalysisWrappers.cpp')
| -rw-r--r-- | gnu/llvm/tools/opt/AnalysisWrappers.cpp | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/gnu/llvm/tools/opt/AnalysisWrappers.cpp b/gnu/llvm/tools/opt/AnalysisWrappers.cpp deleted file mode 100644 index cfdd2cf1582..00000000000 --- a/gnu/llvm/tools/opt/AnalysisWrappers.cpp +++ /dev/null @@ -1,73 +0,0 @@ -//===- AnalysisWrappers.cpp - Wrappers around non-pass analyses -----------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines pass wrappers around LLVM analyses that don't make sense to -// be passes. It provides a nice standard pass interface to these classes so -// that they can be printed out by analyze. -// -// These classes are separated out of analyze.cpp so that it is more clear which -// code is the integral part of the analyze tool, and which part of the code is -// just making it so more passes are available. -// -//===----------------------------------------------------------------------===// - -#include "llvm/Analysis/CallGraph.h" -#include "llvm/IR/CallSite.h" -#include "llvm/IR/Module.h" -#include "llvm/Pass.h" -#include "llvm/Support/raw_ostream.h" -using namespace llvm; - -namespace { - /// ExternalFunctionsPassedConstants - This pass prints out call sites to - /// external functions that are called with constant arguments. This can be - /// useful when looking for standard library functions we should constant fold - /// or handle in alias analyses. - struct ExternalFunctionsPassedConstants : public ModulePass { - static char ID; // Pass ID, replacement for typeid - ExternalFunctionsPassedConstants() : ModulePass(ID) {} - bool runOnModule(Module &M) override { - for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) { - if (!I->isDeclaration()) continue; - - bool PrintedFn = false; - for (User *U : I->users()) { - Instruction *UI = dyn_cast<Instruction>(U); - if (!UI) continue; - - CallSite CS(cast<Value>(UI)); - if (!CS) continue; - - for (CallSite::arg_iterator AI = CS.arg_begin(), - E = CS.arg_end(); AI != E; ++AI) { - if (!isa<Constant>(*AI)) continue; - - if (!PrintedFn) { - errs() << "Function '" << I->getName() << "':\n"; - PrintedFn = true; - } - errs() << *UI; - break; - } - } - } - - return false; - } - - void getAnalysisUsage(AnalysisUsage &AU) const override { - AU.setPreservesAll(); - } - }; -} - -char ExternalFunctionsPassedConstants::ID = 0; -static RegisterPass<ExternalFunctionsPassedConstants> - P1("print-externalfnconstants", - "Print external fn callsites passed constants"); |
