Lines Matching refs:Data

41 static void handleTypeMismatchImpl(TypeMismatchData *Data, ValueHandle Pointer,
43 Location Loc = Data->Loc.acquire();
44 // Use the SourceLocation from Data to track deduplication, even if 'invalid'
49 if (Data->Loc.isInvalid()) {
58 << TypeCheckKinds[Data->TypeCheckKind] << Data->Type;
59 else if (Data->Alignment && (Pointer & (Data->Alignment - 1)))
62 << TypeCheckKinds[Data->TypeCheckKind] << (void*)Pointer
63 << Data->Alignment << Data->Type;
67 << TypeCheckKinds[Data->TypeCheckKind] << (void*)Pointer << Data->Type;
72 void __ubsan::__ubsan_handle_type_mismatch(TypeMismatchData *Data,
75 handleTypeMismatchImpl(Data, Pointer, Opts);
77 void __ubsan::__ubsan_handle_type_mismatch_abort(TypeMismatchData *Data,
80 handleTypeMismatchImpl(Data, Pointer, Opts);
86 static void handleIntegerOverflowImpl(OverflowData *Data, ValueHandle LHS,
89 SourceLocation Loc = Data->Loc.acquire();
97 << (Data->Type.isSignedIntegerTy() ? "signed" : "unsigned")
98 << Value(Data->Type, LHS) << Operator << RHS << Data->Type;
102 void __ubsan::handler_name(OverflowData *Data, ValueHandle LHS, \
105 handleIntegerOverflowImpl(Data, LHS, op, Value(Data->Type, RHS), Opts); \
116 static void handleNegateOverflowImpl(OverflowData *Data, ValueHandle OldVal,
118 SourceLocation Loc = Data->Loc.acquire();
124 if (Data->Type.isSignedIntegerTy())
128 << Value(Data->Type, OldVal) << Data->Type;
132 << Value(Data->Type, OldVal) << Data->Type;
135 void __ubsan::__ubsan_handle_negate_overflow(OverflowData *Data,
138 handleNegateOverflowImpl(Data, OldVal, Opts);
140 void __ubsan::__ubsan_handle_negate_overflow_abort(OverflowData *Data,
143 handleNegateOverflowImpl(Data, OldVal, Opts);
147 static void handleDivremOverflowImpl(OverflowData *Data, ValueHandle LHS,
149 SourceLocation Loc = Data->Loc.acquire();
155 Value LHSVal(Data->Type, LHS);
156 Value RHSVal(Data->Type, RHS);
160 << LHSVal << Data->Type;
165 void __ubsan::__ubsan_handle_divrem_overflow(OverflowData *Data,
168 handleDivremOverflowImpl(Data, LHS, RHS, Opts);
170 void __ubsan::__ubsan_handle_divrem_overflow_abort(OverflowData *Data,
174 handleDivremOverflowImpl(Data, LHS, RHS, Opts);
178 static void handleShiftOutOfBoundsImpl(ShiftOutOfBoundsData *Data,
181 SourceLocation Loc = Data->Loc.acquire();
187 Value LHSVal(Data->LHSType, LHS);
188 Value RHSVal(Data->RHSType, RHS);
191 else if (RHSVal.getPositiveIntValue() >= Data->LHSType.getIntegerBitWidth())
194 << RHSVal << Data->LHSType.getIntegerBitWidth() << Data->LHSType;
200 << LHSVal << RHSVal << Data->LHSType;
203 void __ubsan::__ubsan_handle_shift_out_of_bounds(ShiftOutOfBoundsData *Data,
207 handleShiftOutOfBoundsImpl(Data, LHS, RHS, Opts);
210 ShiftOutOfBoundsData *Data,
214 handleShiftOutOfBoundsImpl(Data, LHS, RHS, Opts);
218 static void handleOutOfBoundsImpl(OutOfBoundsData *Data, ValueHandle Index,
220 SourceLocation Loc = Data->Loc.acquire();
226 Value IndexVal(Data->IndexType, Index);
228 << IndexVal << Data->ArrayType;
231 void __ubsan::__ubsan_handle_out_of_bounds(OutOfBoundsData *Data,
234 handleOutOfBoundsImpl(Data, Index, Opts);
236 void __ubsan::__ubsan_handle_out_of_bounds_abort(OutOfBoundsData *Data,
239 handleOutOfBoundsImpl(Data, Index, Opts);
243 static void handleBuiltinUnreachableImpl(UnreachableData *Data,
245 ScopedReport R(Opts, Data->Loc);
246 Diag(Data->Loc, DL_Error, "execution reached a __builtin_unreachable() call");
249 void __ubsan::__ubsan_handle_builtin_unreachable(UnreachableData *Data) {
251 handleBuiltinUnreachableImpl(Data, Opts);
255 static void handleMissingReturnImpl(UnreachableData *Data, ReportOptions Opts) {
256 ScopedReport R(Opts, Data->Loc);
257 Diag(Data->Loc, DL_Error,
262 void __ubsan::__ubsan_handle_missing_return(UnreachableData *Data) {
264 handleMissingReturnImpl(Data, Opts);
268 static void handleVLABoundNotPositive(VLABoundData *Data, ValueHandle Bound,
270 SourceLocation Loc = Data->Loc.acquire();
278 << Value(Data->Type, Bound);
281 void __ubsan::__ubsan_handle_vla_bound_not_positive(VLABoundData *Data,
284 handleVLABoundNotPositive(Data, Bound, Opts);
286 void __ubsan::__ubsan_handle_vla_bound_not_positive_abort(VLABoundData *Data,
289 handleVLABoundNotPositive(Data, Bound, Opts);
293 static void handleFloatCastOverflow(FloatCastOverflowData *Data,
302 << Value(Data->FromType, From) << Data->FromType << Data->ToType;
305 void __ubsan::__ubsan_handle_float_cast_overflow(FloatCastOverflowData *Data,
308 handleFloatCastOverflow(Data, From, Opts);
311 __ubsan::__ubsan_handle_float_cast_overflow_abort(FloatCastOverflowData *Data,
314 handleFloatCastOverflow(Data, From, Opts);
318 static void handleLoadInvalidValue(InvalidValueData *Data, ValueHandle Val,
320 SourceLocation Loc = Data->Loc.acquire();
328 << Value(Data->Type, Val) << Data->Type;
331 void __ubsan::__ubsan_handle_load_invalid_value(InvalidValueData *Data,
334 handleLoadInvalidValue(Data, Val, Opts);
336 void __ubsan::__ubsan_handle_load_invalid_value_abort(InvalidValueData *Data,
339 handleLoadInvalidValue(Data, Val, Opts);
343 static void handleFunctionTypeMismatch(FunctionTypeMismatchData *Data,
346 SourceLocation CallLoc = Data->Loc.acquire();
359 << FName << Data->Type;
364 __ubsan::__ubsan_handle_function_type_mismatch(FunctionTypeMismatchData *Data,
367 handleFunctionTypeMismatch(Data, Function, Opts);
371 FunctionTypeMismatchData *Data, ValueHandle Function) {
373 handleFunctionTypeMismatch(Data, Function, Opts);
377 static void handleNonNullReturn(NonNullReturnData *Data, ReportOptions Opts) {
378 SourceLocation Loc = Data->Loc.acquire();
386 if (!Data->AttrLoc.isInvalid())
387 Diag(Data->AttrLoc, DL_Note, "returns_nonnull attribute specified here");
390 void __ubsan::__ubsan_handle_nonnull_return(NonNullReturnData *Data) {
392 handleNonNullReturn(Data, Opts);
395 void __ubsan::__ubsan_handle_nonnull_return_abort(NonNullReturnData *Data) {
397 handleNonNullReturn(Data, Opts);
401 static void handleNonNullArg(NonNullArgData *Data, ReportOptions Opts) {
402 SourceLocation Loc = Data->Loc.acquire();
409 "never be null") << Data->ArgIndex;
410 if (!Data->AttrLoc.isInvalid())
411 Diag(Data->AttrLoc, DL_Note, "nonnull attribute specified here");
414 void __ubsan::__ubsan_handle_nonnull_arg(NonNullArgData *Data) {
416 handleNonNullArg(Data, Opts);
419 void __ubsan::__ubsan_handle_nonnull_arg_abort(NonNullArgData *Data) {
421 handleNonNullArg(Data, Opts);