|
LLVM 24.0.0git
|
This file is a part of HWAddressSanitizer, an address basic correctness checker based on tagged addressing. More...
#include "llvm/Transforms/Instrumentation/HWAddressSanitizer.h"#include "InstrumentationOptions.h"#include "llvm/ADT/MapVector.h"#include "llvm/ADT/STLExtras.h"#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/Statistic.h"#include "llvm/ADT/StringExtras.h"#include "llvm/ADT/StringRef.h"#include "llvm/Analysis/BlockFrequencyInfo.h"#include "llvm/Analysis/DomTreeUpdater.h"#include "llvm/Analysis/GlobalsModRef.h"#include "llvm/Analysis/OptimizationRemarkEmitter.h"#include "llvm/Analysis/PostDominators.h"#include "llvm/Analysis/ProfileSummaryInfo.h"#include "llvm/Analysis/StackSafetyAnalysis.h"#include "llvm/Analysis/TargetLibraryInfo.h"#include "llvm/Analysis/ValueTracking.h"#include "llvm/BinaryFormat/Dwarf.h"#include "llvm/BinaryFormat/ELF.h"#include "llvm/IR/Attributes.h"#include "llvm/IR/BasicBlock.h"#include "llvm/IR/Constant.h"#include "llvm/IR/Constants.h"#include "llvm/IR/DataLayout.h"#include "llvm/IR/DerivedTypes.h"#include "llvm/IR/Dominators.h"#include "llvm/IR/Function.h"#include "llvm/IR/IRBuilder.h"#include "llvm/IR/InlineAsm.h"#include "llvm/IR/InstIterator.h"#include "llvm/IR/Instruction.h"#include "llvm/IR/Instructions.h"#include "llvm/IR/IntrinsicInst.h"#include "llvm/IR/Intrinsics.h"#include "llvm/IR/LLVMContext.h"#include "llvm/IR/MDBuilder.h"#include "llvm/IR/Module.h"#include "llvm/IR/Type.h"#include "llvm/IR/Value.h"#include "llvm/Support/Casting.h"#include "llvm/Support/CommandLine.h"#include "llvm/Support/Debug.h"#include "llvm/Support/ErrorHandling.h"#include "llvm/Support/MD5.h"#include "llvm/Support/RandomNumberGenerator.h"#include "llvm/Support/raw_ostream.h"#include "llvm/TargetParser/Triple.h"#include "llvm/Transforms/Instrumentation/AddressSanitizerCommon.h"#include "llvm/Transforms/Utils/BasicBlockUtils.h"#include "llvm/Transforms/Utils/Instrumentation.h"#include "llvm/Transforms/Utils/Local.h"#include "llvm/Transforms/Utils/MemoryTaggingSupport.h"#include "llvm/Transforms/Utils/ModuleUtils.h"#include "llvm/Transforms/Utils/PromoteMemToReg.h"#include <optional>#include <random>Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "hwasan" |
Functions | |
| STATISTIC (NumTotalFuncs, "Number of total funcs") | |
| STATISTIC (NumInstrumentedFuncs, "Number of instrumented funcs") | |
| STATISTIC (NumNoProfileSummaryFuncs, "Number of funcs without PS") | |
| static unsigned | getPointerOperandIndex (Instruction *I) |
| static size_t | TypeSizeToSizeIndex (uint32_t TypeSize) |
| static void | emitRemark (const Function &F, OptimizationRemarkEmitter &ORE, bool Skip) |
Variables | |
| const char | kHwasanModuleCtorName [] = "hwasan.module_ctor" |
| const char | kHwasanNoteName [] = "hwasan.note" |
| const char | kHwasanInitName [] = "__hwasan_init" |
| const char | kHwasanPersonalityThunkName [] = "__hwasan_personality_thunk" |
| const char | kHwasanShadowMemoryDynamicAddress [] |
| static const size_t | kNumberOfAccessSizes = 5 |
| static const size_t | kDefaultShadowScale = 4 |
| static const unsigned | kShadowBaseAlignment = 32 |
| static cl::opt< uint64_t > | ClMappingOffset ("hwasan-mapping-offset", cl::desc("HWASan shadow mapping offset [EXPERIMENTAL]"), cl::Hidden) |
| static cl::opt< OffsetKind > | ClMappingOffsetDynamic ("hwasan-mapping-offset-dynamic", cl::desc("HWASan shadow mapping dynamic offset location"), cl::Hidden, cl::values(clEnumValN(OffsetKind::kGlobal, "global", "Use global"), clEnumValN(OffsetKind::kIfunc, "ifunc", "Use ifunc global"), clEnumValN(OffsetKind::kTls, "tls", "Use TLS"))) |
This file is a part of HWAddressSanitizer, an address basic correctness checker based on tagged addressing.
Definition in file HWAddressSanitizer.cpp.
| #define DEBUG_TYPE "hwasan" |
Definition at line 73 of file HWAddressSanitizer.cpp.
|
static |
Definition at line 1412 of file HWAddressSanitizer.cpp.
References DEBUG_TYPE, llvm::OptimizationRemarkEmitter::emit(), and F.
|
static |
Definition at line 788 of file HWAddressSanitizer.cpp.
References llvm::dyn_cast(), I, and llvm::report_fatal_error().
| STATISTIC | ( | NumInstrumentedFuncs | , |
| "Number of instrumented funcs" | ) |
| STATISTIC | ( | NumNoProfileSummaryFuncs | , |
| "Number of funcs without PS" | ) |
References llvm::Triple::x86_64.
| STATISTIC | ( | NumTotalFuncs | , |
| "Number of total funcs" | ) |
Definition at line 801 of file HWAddressSanitizer.cpp.
References assert(), llvm::countr_zero(), and kNumberOfAccessSizes.
|
static |
|
static |
Definition at line 86 of file HWAddressSanitizer.cpp.
Definition at line 77 of file HWAddressSanitizer.cpp.
Definition at line 75 of file HWAddressSanitizer.cpp.
Definition at line 76 of file HWAddressSanitizer.cpp.
Definition at line 78 of file HWAddressSanitizer.cpp.
Definition at line 80 of file HWAddressSanitizer.cpp.
Definition at line 84 of file HWAddressSanitizer.cpp.
Definition at line 88 of file HWAddressSanitizer.cpp.