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