@@ -222,6 +222,10 @@ static cl::opt<bool> ClInlineAllChecks("hwasan-inline-all-checks",
222
222
cl::desc (" inline all checks" ),
223
223
cl::Hidden, cl::init(false ));
224
224
225
+ static cl::opt<bool > ClInlineFastPathChecks (" hwasan-inline-fast-path-checks" ,
226
+ cl::desc (" inline all checks" ),
227
+ cl::Hidden, cl::init(false ));
228
+
225
229
// Enabled from clang by "-fsanitize-hwaddress-experimental-aliasing".
226
230
static cl::opt<bool > ClUsePageAliases (" hwasan-experimental-use-page-aliases" ,
227
231
cl::desc (" Use page aliasing in HWASan" ),
@@ -372,6 +376,7 @@ class HWAddressSanitizer {
372
376
bool CompileKernel;
373
377
bool Recover;
374
378
bool OutlinedChecks;
379
+ bool InlineFastPath;
375
380
bool UseShortGranules;
376
381
bool InstrumentLandingPads;
377
382
bool InstrumentWithCalls;
@@ -579,6 +584,13 @@ void HWAddressSanitizer::initializeModule() {
579
584
TargetTriple.isOSBinFormatELF () &&
580
585
(ClInlineAllChecks.getNumOccurrences () ? !ClInlineAllChecks : !Recover);
581
586
587
+ InlineFastPath =
588
+ (ClInlineFastPathChecks.getNumOccurrences ()
589
+ ? ClInlineFastPathChecks
590
+ : !(TargetTriple.isAndroid () ||
591
+ TargetTriple.isOSFuchsia ())); // These platforms may prefer less
592
+ // inlining to reduce binary size.
593
+
582
594
if (ClMatchAllTag.getNumOccurrences ()) {
583
595
if (ClMatchAllTag != -1 ) {
584
596
MatchAllTag = ClMatchAllTag & 0xFF ;
@@ -845,6 +857,11 @@ void HWAddressSanitizer::instrumentMemAccessOutline(Value *Ptr, bool IsWrite,
845
857
assert (!UsePageAliases);
846
858
const int64_t AccessInfo = getAccessInfo (IsWrite, AccessSizeIndex);
847
859
IRBuilder<> IRB (InsertBefore);
860
+
861
+ if (InlineFastPath) {
862
+ // TODO.
863
+ }
864
+
848
865
Module *M = IRB.GetInsertBlock ()->getParent ()->getParent ();
849
866
Ptr = IRB.CreateBitCast (Ptr , Int8PtrTy);
850
867
IRB.CreateCall (Intrinsic::getDeclaration (
0 commit comments