Skip to content

Commit 93600eb

Browse files
committed
[NFC][asan] Rename ModuleAddressSanitizerPass
1 parent e7bac3b commit 93600eb

File tree

6 files changed

+16
-18
lines changed

6 files changed

+16
-18
lines changed

clang/lib/CodeGen/BackendUtil.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -673,8 +673,8 @@ static void addSanitizers(const Triple &TargetTriple,
673673
Opts.Recover = CodeGenOpts.SanitizeRecover.has(Mask);
674674
Opts.UseAfterScope = CodeGenOpts.SanitizeAddressUseAfterScope;
675675
Opts.UseAfterReturn = CodeGenOpts.getSanitizeAddressUseAfterReturn();
676-
MPM.addPass(ModuleAddressSanitizerPass(
677-
Opts, UseGlobalGC, UseOdrIndicator, DestructorKind));
676+
MPM.addPass(AddressSanitizerPass(Opts, UseGlobalGC, UseOdrIndicator,
677+
DestructorKind));
678678
}
679679
};
680680
ASanPass(SanitizerKind::Address, false);

llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h

+4-6
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,11 @@ struct AddressSanitizerOptions {
3333
///
3434
/// This adds 'asan.module_ctor' to 'llvm.global_ctors'. This pass may also
3535
/// run intependently of the function address sanitizer.
36-
class ModuleAddressSanitizerPass
37-
: public PassInfoMixin<ModuleAddressSanitizerPass> {
36+
class AddressSanitizerPass : public PassInfoMixin<AddressSanitizerPass> {
3837
public:
39-
ModuleAddressSanitizerPass(
40-
const AddressSanitizerOptions &Options, bool UseGlobalGC = true,
41-
bool UseOdrIndicator = false,
42-
AsanDtorKind DestructorKind = AsanDtorKind::Global);
38+
AddressSanitizerPass(const AddressSanitizerOptions &Options,
39+
bool UseGlobalGC = true, bool UseOdrIndicator = false,
40+
AsanDtorKind DestructorKind = AsanDtorKind::Global);
4341
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
4442
void printPipeline(raw_ostream &OS,
4543
function_ref<StringRef(StringRef)> MapClassName2PassName);

llvm/lib/Passes/PassRegistry.def

+3-3
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,10 @@ MODULE_PASS_WITH_PARAMS("hwasan",
146146
},
147147
parseHWASanPassOptions,
148148
"kernel;recover")
149-
MODULE_PASS_WITH_PARAMS("asan-module",
150-
"ModuleAddressSanitizerPass",
149+
MODULE_PASS_WITH_PARAMS("asan",
150+
"AddressSanitizerPass",
151151
[](AddressSanitizerOptions Opts) {
152-
return ModuleAddressSanitizerPass(Opts);
152+
return AddressSanitizerPass(Opts);
153153
},
154154
parseASanPassOptions,
155155
"kernel")

llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -1110,24 +1110,24 @@ struct FunctionStackPoisoner : public InstVisitor<FunctionStackPoisoner> {
11101110

11111111
} // end anonymous namespace
11121112

1113-
void ModuleAddressSanitizerPass::printPipeline(
1113+
void AddressSanitizerPass::printPipeline(
11141114
raw_ostream &OS, function_ref<StringRef(StringRef)> MapClassName2PassName) {
1115-
static_cast<PassInfoMixin<ModuleAddressSanitizerPass> *>(this)->printPipeline(
1115+
static_cast<PassInfoMixin<AddressSanitizerPass> *>(this)->printPipeline(
11161116
OS, MapClassName2PassName);
11171117
OS << "<";
11181118
if (Options.CompileKernel)
11191119
OS << "kernel";
11201120
OS << ">";
11211121
}
11221122

1123-
ModuleAddressSanitizerPass::ModuleAddressSanitizerPass(
1123+
AddressSanitizerPass::AddressSanitizerPass(
11241124
const AddressSanitizerOptions &Options, bool UseGlobalGC,
11251125
bool UseOdrIndicator, AsanDtorKind DestructorKind)
11261126
: Options(Options), UseGlobalGC(UseGlobalGC),
11271127
UseOdrIndicator(UseOdrIndicator), DestructorKind(DestructorKind) {}
11281128

1129-
PreservedAnalyses ModuleAddressSanitizerPass::run(Module &M,
1130-
ModuleAnalysisManager &MAM) {
1129+
PreservedAnalyses AddressSanitizerPass::run(Module &M,
1130+
ModuleAnalysisManager &MAM) {
11311131
ModuleAddressSanitizer ModuleSanitizer(M, Options.CompileKernel,
11321132
Options.Recover, UseGlobalGC,
11331133
UseOdrIndicator, DestructorKind);

llvm/test/Instrumentation/SanitizerCoverage/tracing-comdat.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
; Make sure asan does not instrument __sancov_gen_
33

44
; RUN: opt < %s -passes='module(sancov-module)' -sanitizer-coverage-level=3 -sanitizer-coverage-trace-pc-guard -S | FileCheck %s
5-
; RUN: opt < %s -passes='module(sancov-module,asan-module)' -sanitizer-coverage-level=3 -sanitizer-coverage-trace-pc-guard -S | FileCheck %s
5+
; RUN: opt < %s -passes='module(sancov-module,asan)' -sanitizer-coverage-level=3 -sanitizer-coverage-trace-pc-guard -S | FileCheck %s
66
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
77
target triple = "x86_64-unknown-linux-gnu"
88
$Foo = comdat any

llvm/tools/opt/NewPMDriver.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ bool llvm::runPassPipeline(StringRef Arg0, Module &M, TargetMachine *TM,
381381
ArrayRef<PassBuilder::PipelineElement>) {
382382
AddressSanitizerOptions Opts;
383383
if (Name == "asan-pipeline") {
384-
MPM.addPass(ModuleAddressSanitizerPass(Opts));
384+
MPM.addPass(AddressSanitizerPass(Opts));
385385
return true;
386386
}
387387
return false;

0 commit comments

Comments
 (0)