Skip to content

Commit 908d242

Browse files
authored
[NFC][LLVM] Namespace cleanup in AddressSanitizer/ControlHeightReduction (llvm#163776)
1 parent de981c1 commit 908d242

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -605,17 +605,16 @@ static ShadowMapping getShadowMapping(const Triple &TargetTriple, int LongSize,
605605
return Mapping;
606606
}
607607

608-
namespace llvm {
609-
void getAddressSanitizerParams(const Triple &TargetTriple, int LongSize,
610-
bool IsKasan, uint64_t *ShadowBase,
611-
int *MappingScale, bool *OrShadowOffset) {
608+
void llvm::getAddressSanitizerParams(const Triple &TargetTriple, int LongSize,
609+
bool IsKasan, uint64_t *ShadowBase,
610+
int *MappingScale, bool *OrShadowOffset) {
612611
auto Mapping = getShadowMapping(TargetTriple, LongSize, IsKasan);
613612
*ShadowBase = Mapping.Offset;
614613
*MappingScale = Mapping.Scale;
615614
*OrShadowOffset = Mapping.OrShadowOffset;
616615
}
617616

618-
void removeASanIncompatibleFnAttributes(Function &F, bool ReadsArgMem) {
617+
void llvm::removeASanIncompatibleFnAttributes(Function &F, bool ReadsArgMem) {
619618
// Sanitizer checks read from shadow, which invalidates memory(argmem: *).
620619
//
621620
// This is not only true for sanitized functions, because AttrInfer can
@@ -668,20 +667,17 @@ ASanAccessInfo::ASanAccessInfo(bool IsWrite, bool CompileKernel,
668667
AccessSizeIndex(AccessSizeIndex), IsWrite(IsWrite),
669668
CompileKernel(CompileKernel) {}
670669

671-
} // namespace llvm
672-
673670
static uint64_t getRedzoneSizeForScale(int MappingScale) {
674671
// Redzone used for stack and globals is at least 32 bytes.
675672
// For scales 6 and 7, the redzone has to be 64 and 128 bytes respectively.
676673
return std::max(32U, 1U << MappingScale);
677674
}
678675

679676
static uint64_t GetCtorAndDtorPriority(Triple &TargetTriple) {
680-
if (TargetTriple.isOSEmscripten()) {
677+
if (TargetTriple.isOSEmscripten())
681678
return kAsanEmscriptenCtorAndDtorPriority;
682-
} else {
679+
else
683680
return kAsanCtorAndDtorPriority;
684-
}
685681
}
686682

687683
static Twine genName(StringRef suffix) {

llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2092,8 +2092,6 @@ bool CHR::run() {
20922092
return Changed;
20932093
}
20942094

2095-
namespace llvm {
2096-
20972095
ControlHeightReductionPass::ControlHeightReductionPass() {
20982096
parseCHRFilterFiles();
20992097
}
@@ -2116,5 +2114,3 @@ PreservedAnalyses ControlHeightReductionPass::run(
21162114
return PreservedAnalyses::all();
21172115
return PreservedAnalyses::none();
21182116
}
2119-
2120-
} // namespace llvm

0 commit comments

Comments
 (0)