| 1 | //===-- ubsan_handlers_internal.h -------------------------------*- C++ -*-===// |
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
| 9 | // Internal handle*Impl entry points. Used by the public handlers and by |
| 10 | // device report replay. Not a stable ABI. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef UBSAN_HANDLERS_INTERNAL_H |
| 15 | #define UBSAN_HANDLERS_INTERNAL_H |
| 16 | |
| 17 | #include "ubsan_diag.h" |
| 18 | #include "ubsan_handlers.h" |
| 19 | |
| 20 | namespace __ubsan { |
| 21 | |
| 22 | void handleTypeMismatchImpl(TypeMismatchData *Data, ValueHandle Pointer, |
| 23 | ReportOptions Opts); |
| 24 | void handleAlignmentAssumptionImpl(AlignmentAssumptionData *Data, |
| 25 | ValueHandle Pointer, ValueHandle Alignment, |
| 26 | ValueHandle Offset, ReportOptions Opts); |
| 27 | void handleIntegerOverflowImpl(OverflowData *Data, ValueHandle LHS, |
| 28 | const char *Operator, ValueHandle RHS, |
| 29 | ReportOptions Opts); |
| 30 | void handleNegateOverflowImpl(OverflowData *Data, ValueHandle OldVal, |
| 31 | ReportOptions Opts); |
| 32 | void handleDivremOverflowImpl(OverflowData *Data, ValueHandle LHS, |
| 33 | ValueHandle RHS, ReportOptions Opts); |
| 34 | void handleShiftOutOfBoundsImpl(ShiftOutOfBoundsData *Data, ValueHandle LHS, |
| 35 | ValueHandle RHS, ReportOptions Opts); |
| 36 | void handleOutOfBoundsImpl(OutOfBoundsData *Data, ValueHandle Index, |
| 37 | ReportOptions Opts); |
| 38 | void handleLocalOutOfBoundsImpl(ReportOptions Opts); |
| 39 | void handleBuiltinUnreachableImpl(UnreachableData *Data, ReportOptions Opts); |
| 40 | void handleMissingReturnImpl(UnreachableData *Data, ReportOptions Opts); |
| 41 | void handleVLABoundNotPositive(VLABoundData *Data, ValueHandle Bound, |
| 42 | ReportOptions Opts); |
| 43 | void handleFloatCastOverflow(void *Data, ValueHandle From, ReportOptions Opts); |
| 44 | void handleLoadInvalidValue(InvalidValueData *Data, ValueHandle Val, |
| 45 | ReportOptions Opts); |
| 46 | void handleImplicitConversion(ImplicitConversionData *Data, ReportOptions Opts, |
| 47 | ValueHandle Src, ValueHandle Dst); |
| 48 | void handleInvalidBuiltin(InvalidBuiltinData *Data, ReportOptions Opts); |
| 49 | void handleInvalidObjCCast(InvalidObjCCast *Data, ValueHandle Pointer, |
| 50 | ReportOptions Opts); |
| 51 | void handleNonNullReturn(NonNullReturnData *Data, SourceLocation *LocPtr, |
| 52 | ReportOptions Opts, bool IsAttr); |
| 53 | void handleNonNullArg(NonNullArgData *Data, ReportOptions Opts, bool IsAttr); |
| 54 | void handlePointerOverflowImpl(PointerOverflowData *Data, ValueHandle Base, |
| 55 | ValueHandle Result, ReportOptions Opts); |
| 56 | void handleCFIBadIcall(CFICheckFailData *Data, ValueHandle Function, |
| 57 | ReportOptions Opts); |
| 58 | bool handleFunctionTypeMismatch(FunctionTypeMismatchData *Data, |
| 59 | ValueHandle Function, ReportOptions Opts); |
| 60 | |
| 61 | } // namespace __ubsan |
| 62 | |
| 63 | #endif // UBSAN_HANDLERS_INTERNAL_H |
| 64 | |