| 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 handleReturnAlignmentAssumptionImpl(ReturnAlignmentAssumptionData *Data, |
| 28 | SourceLocation *LocPtr, |
| 29 | ValueHandle Pointer, |
| 30 | ValueHandle Alignment, |
| 31 | ValueHandle Offset, |
| 32 | ReportOptions Opts); |
| 33 | void handleIntegerOverflowImpl(OverflowData *Data, ValueHandle LHS, |
| 34 | const char *Operator, ValueHandle RHS, |
| 35 | ReportOptions Opts); |
| 36 | void handleNegateOverflowImpl(OverflowData *Data, ValueHandle OldVal, |
| 37 | ReportOptions Opts); |
| 38 | void handleDivremOverflowImpl(OverflowData *Data, ValueHandle LHS, |
| 39 | ValueHandle RHS, ReportOptions Opts); |
| 40 | void handleShiftOutOfBoundsImpl(ShiftOutOfBoundsData *Data, ValueHandle LHS, |
| 41 | ValueHandle RHS, ReportOptions Opts); |
| 42 | void handleOutOfBoundsImpl(OutOfBoundsData *Data, ValueHandle Index, |
| 43 | ReportOptions Opts); |
| 44 | void handleLocalOutOfBoundsImpl(ReportOptions Opts); |
| 45 | void handleBuiltinUnreachableImpl(UnreachableData *Data, ReportOptions Opts); |
| 46 | void handleMissingReturnImpl(UnreachableData *Data, ReportOptions Opts); |
| 47 | void handleVLABoundNotPositive(VLABoundData *Data, ValueHandle Bound, |
| 48 | ReportOptions Opts); |
| 49 | void handleFloatCastOverflow(void *Data, ValueHandle From, ReportOptions Opts); |
| 50 | void handleLoadInvalidValue(InvalidValueData *Data, ValueHandle Val, |
| 51 | ReportOptions Opts); |
| 52 | void handleImplicitConversion(ImplicitConversionData *Data, ReportOptions Opts, |
| 53 | ValueHandle Src, ValueHandle Dst); |
| 54 | void handleInvalidBuiltin(InvalidBuiltinData *Data, ReportOptions Opts); |
| 55 | void handleInvalidObjCCast(InvalidObjCCast *Data, ValueHandle Pointer, |
| 56 | ReportOptions Opts); |
| 57 | void handleNonNullReturn(NonNullReturnData *Data, SourceLocation *LocPtr, |
| 58 | ReportOptions Opts, bool IsAttr); |
| 59 | void handleNonNullArg(NonNullArgData *Data, ReportOptions Opts, bool IsAttr); |
| 60 | void handlePointerOverflowImpl(PointerOverflowData *Data, ValueHandle Base, |
| 61 | ValueHandle Result, ReportOptions Opts); |
| 62 | void handleCFIBadIcall(CFICheckFailData *Data, ValueHandle Function, |
| 63 | ReportOptions Opts); |
| 64 | bool handleFunctionTypeMismatch(FunctionTypeMismatchData *Data, |
| 65 | ValueHandle Function, ReportOptions Opts); |
| 66 | |
| 67 | } // namespace __ubsan |
| 68 | |
| 69 | #endif // UBSAN_HANDLERS_INTERNAL_H |
| 70 | |