yronglin added a comment. Thanks a lot for your comments @rsmith @rjmccall .
Firstly, as far as I know, turning on the `-fsanitizer=alignment` options when calling `__builtin_assume_aligned` in C code, Clang will emit `call void @__ubsan_handle_alignment_assumption(...)` in CodeGen, and CodeGen need `user-written-type` to generate correct `TypeDescriptor` (this class in compiler-rt/UBSan). Secondly, before this patch, `clang::CodeGen::CodeGenFunction::emitAlignmentAssumption` use `CastExpr->getSubExprAsWritten` to get `user-written-type` in CodeGen, In `Diff 457643` , with John's comments, we use custom sema checking. we just use `DefaultFunctionArrayLvalueConversion` to convert 1st arg, but not implicit cast 1st arg to `const void *`(We expect pass `user-written-type` to CodeGen). Unfortunately, `Diff 457643` broken windows sanitize test, because there have a forward declaration `__MACHINE(void * __cdecl __builtin_assume_aligned(const void *, size_t, ...) noexcept)`in `intrin0.inl.h`, I think the reason for this problem is we use `nct` in `BUILTIN(__builtin_assume_aligned, "v*vC*z.", "nct")`, I try to find a solution based on `Diff 457643`, what do you all think about? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133202/new/ https://reviews.llvm.org/D133202 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits