diff options
author | Eugene Zelenko <eugene.zelenko@gmail.com> | 2016-04-05 20:19:49 +0000 |
---|---|---|
committer | Eugene Zelenko <eugene.zelenko@gmail.com> | 2016-04-05 20:19:49 +0000 |
commit | 1760dc2a232bde2175606ba737938d3032f1e49d (patch) | |
tree | 3859bc6b8b21c8d5073ded16260d7a5b3ff99b8f /llvm/tools/sanstats/sanstats.cpp | |
parent | f2fdd013a29b26791490e3a33beda1bacfeec182 (diff) | |
download | bcm5719-llvm-1760dc2a232bde2175606ba737938d3032f1e49d.tar.gz bcm5719-llvm-1760dc2a232bde2175606ba737938d3032f1e49d.zip |
Fix Clang-tidy modernize-deprecated-headers warnings in remaining files; other minor fixes.
Some Include What You Use suggestions were used too.
Use anonymous namespaces in source files.
Differential revision: http://reviews.llvm.org/D18778
llvm-svn: 265454
Diffstat (limited to 'llvm/tools/sanstats/sanstats.cpp')
-rw-r--r-- | llvm/tools/sanstats/sanstats.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/llvm/tools/sanstats/sanstats.cpp b/llvm/tools/sanstats/sanstats.cpp index 3a8cc9aea8c..95f5424ba66 100644 --- a/llvm/tools/sanstats/sanstats.cpp +++ b/llvm/tools/sanstats/sanstats.cpp @@ -12,20 +12,26 @@ // //===----------------------------------------------------------------------===// +#include "llvm/ADT/StringRef.h" #include "llvm/DebugInfo/Symbolize/Symbolize.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/ErrorOr.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Transforms/Utils/SanitizerStats.h" -#include <stdint.h> +#include <cassert> +#include <cstdint> +#include <memory> +#include <string> using namespace llvm; -static cl::opt<std::string> ClInputFile(cl::Positional, cl::Required, - cl::desc("<filename>")); +namespace { -static cl::opt<bool> ClDemangle("demangle", cl::init(false), - cl::desc("Print demangled function name.")); +cl::opt<std::string> ClInputFile(cl::Positional, cl::Required, + cl::desc("<filename>")); + +cl::opt<bool> ClDemangle("demangle", cl::init(false), + cl::desc("Print demangled function name.")); inline uint64_t KindFromData(uint64_t Data, char SizeofPtr) { return Data >> (SizeofPtr * 8 - kSanitizerStatKindBits); @@ -63,7 +69,7 @@ const char *ReadModule(char SizeofPtr, const char *Begin, const char *End) { SymbolizerOptions.UseSymbolTable = true; symbolize::LLVMSymbolizer Symbolizer(SymbolizerOptions); - while (1) { + while (true) { uint64_t Addr = ReadLE(SizeofPtr, Begin, End); Begin += SizeofPtr; uint64_t Data = ReadLE(SizeofPtr, Begin, End); @@ -109,6 +115,8 @@ const char *ReadModule(char SizeofPtr, const char *Begin, const char *End) { } } +} // end anonymous namespace + int main(int argc, char **argv) { cl::ParseCommandLineOptions(argc, argv, "Sanitizer Statistics Processing Tool"); |