diff options
author | Hal Finkel <hfinkel@anl.gov> | 2014-07-19 03:25:16 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2014-07-19 03:25:16 +0000 |
commit | 9e440c08a961eea1bc4c2a3faa5d6ce87b3c4554 (patch) | |
tree | 23bce32e6906e374295fe60aa305a4fe097f06dc /clang/lib/Frontend/CompilerInstance.cpp | |
parent | 16e394a36ce184e0312dd9ecebaee3bf36b2cacd (diff) | |
download | llvm-9e440c08a961eea1bc4c2a3faa5d6ce87b3c4554.zip llvm-9e440c08a961eea1bc4c2a3faa5d6ce87b3c4554.tar.gz llvm-9e440c08a961eea1bc4c2a3faa5d6ce87b3c4554.tar.bz2 |
Make Value::isDereferenceablePointer handle offsets to pointer types with dereferenceable attributes
When we have a parameter (or call site return) with a dereferenceable
attribute, it can specify the size of an array pointed to by that parameter. If
we have a value for which we can accumulate a constant offset to such a
parameter, then we can use that offset in a direct comparison with the size
specified by the dereferenceable attribute.
This enables us to handle cases like this:
int foo(int a[static 3]) {
return a[2]; /* this is always dereferenceable */
}
llvm-svn: 213447
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
0 files changed, 0 insertions, 0 deletions