diff options
author | Roman Lebedev <lebedev.ri@gmail.com> | 2020-01-23 22:49:50 +0300 |
---|---|---|
committer | Roman Lebedev <lebedev.ri@gmail.com> | 2020-01-23 22:50:49 +0300 |
commit | c2a9061ac5166e48fe85ea2b6dbce9457c964958 (patch) | |
tree | 0ab1527c68c747359cbea890c3e7008714e5fd34 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | a4cfb15d15a8a353fe316f2a9fe1c8c6a6740ef1 (diff) | |
download | llvm-c2a9061ac5166e48fe85ea2b6dbce9457c964958.zip llvm-c2a9061ac5166e48fe85ea2b6dbce9457c964958.tar.gz llvm-c2a9061ac5166e48fe85ea2b6dbce9457c964958.tar.bz2 |
[Sema] Attempt to perform call-size-specific `__attribute__((alloc_align(param_idx)))` validation
Summary:
`alloc_align` attribute takes parameter number, not the alignment itself,
so given **just** the attribute/function declaration we can't do any
sanity checking for said alignment.
However, at call site, given the actual `Expr` that is passed
into that parameter, we //might// be able to evaluate said `Expr`
as Integer Constant Expression, and perform the sanity checks.
But since there is no requirement for that argument to be an immediate,
we may fail, and that's okay.
However if we did evaluate, we should enforce the same constraints
as with `__builtin_assume_aligned()`/`__attribute__((assume_aligned(imm)))`:
said alignment is a power of two, and is not greater than our magic threshold
Reviewers: erichkeane, aaron.ballman, hfinkel, rsmith, jdoerfert
Reviewed By: erichkeane
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72996
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
0 files changed, 0 insertions, 0 deletions