| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
|
|
| |
This change also makes the serialisation store the required semantics,
fixing an issue where PPC128 was always assumed when re-reading a
128-bit value.
llvm-svn: 173139
|
| |
|
|
|
|
| |
OpenCL restrictions (OpenCL 1.2 spec 6.9)
llvm-svn: 172973
|
| |
|
|
|
|
| |
to visit them.
llvm-svn: 172769
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is inspired by a number of false positives in real code, including
PR14968. I've added test cases reduced from these false positives to
test/Sema/unused-expr.c, as well as corresponding test cases that pass the
offending expressions as arguments to a no-op macro to ensure that we do warn
there.
This also removes my previous tweak from r166522/r166534, so that we warn on
unused cast expressions in macro arguments.
There were several test cases that were using -Wunused-value to test general
diagnostic emission features; I changed those to use other warnings or warn on
a macro argument expression. I stared at the test case for PR14399 for a while
with Richard Smith and we believe the new test case exercises the same
codepaths as before.
llvm-svn: 172696
|
| |
|
|
|
|
| |
brought into 'clang' namespace by clang/Basic/LLVM.h
llvm-svn: 172323
|
| |
|
|
|
|
| |
nearby 'C++0x' comments.
llvm-svn: 171372
|
| |
|
|
| |
llvm-svn: 171367
|
| |
|
|
|
|
|
|
| |
Changed getLocStart() and getLocEnd() to be required for Stmts, and make
getSourceRange() optional. The default implementation for getSourceRange()
is build the range by calling getLocStart() and getLocEnd().
llvm-svn: 171067
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
of a member function with parenthesized declarator.
Like this test case:
class Foo {
const char *(baz)() {
return __PRETTY_FUNCTION__;
}
};
llvm-svn: 170233
|
| |
|
|
|
|
|
|
|
| |
pull in all the generated Attr code.
Required to pull some functions out of line, but this shouldn't have a perf impact.
No functionality change.
llvm-svn: 169092
|
| |
|
|
|
|
| |
viceversa). No functionality change.
llvm-svn: 167591
|
| |
|
|
| |
llvm-svn: 167581
|
| |
|
|
| |
llvm-svn: 167232
|
| |
|
|
|
|
|
|
| |
the receiver of an ObjC message expression.
rdar://12578643
llvm-svn: 167201
|
| |
|
|
| |
llvm-svn: 166853
|
| |
|
|
|
|
|
| |
In particular, we do want to warn on some unused cast subexpressions within
macros.
llvm-svn: 166534
|
| |
|
|
| |
llvm-svn: 166522
|
| |
|
|
|
|
| |
to dependent arguments.
llvm-svn: 166468
|
| |
|
|
| |
llvm-svn: 165383
|
| |
|
|
| |
llvm-svn: 164966
|
| |
|
|
|
|
| |
unused expression warnings. <rdar://problem/12359208>.
llvm-svn: 164569
|
| |
|
|
|
|
|
|
|
|
|
| |
bytes of the buffer and not the size of the string, otherwise we
may overwrite the buffer if there is a mismatch between the size
of the string and the CharByteWidth, and assertions are disabled.
The bug where this could occur was fixed in r163931.
Related to rdar://12069503
llvm-svn: 163939
|
| |
|
|
|
|
|
| |
parameter packs where the reference is not being expanded but the pack has
been. Previously, Clang would segfault in such cases.
llvm-svn: 163672
|
| |
|
|
|
|
|
|
|
| |
(__builtin_* etc.) so that it isn't possible to take their address.
Specifically, introduce a new type to represent a reference to a builtin
function, and a new cast kind to convert it to a function pointer in the
operand of a call. Fixes PR13195.
llvm-svn: 162962
|
| |
|
|
|
|
| |
No functionality change.
llvm-svn: 162552
|
| |
|
|
|
|
| |
correctly. PR13643.
llvm-svn: 162226
|
| |
|
|
|
|
| |
evaluated into a CXXTypeid member function. No functionality change.
llvm-svn: 161779
|
| |
|
|
|
|
|
|
|
| |
This also provides isConst/Volatile/Restrict on FunctionTypes to coalesce
the implementation with other callers (& update those other callers).
Patch contributed by Sam Panzer (panzer@google.com).
llvm-svn: 161647
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is effectively a warning for code that violates core issue 903 & thus will
become standard error in the future, hopefully. It catches strange null
pointers such as: '\0', 1 - 1, const int null = 0; etc...
There's currently a flaw in this warning (& the warning for 'false' as a null
pointer literal as well) where it doesn't trigger on comparisons (ptr == '\0'
for example). Fix to come in a future patch.
Also, due to this only being a warning, not an error, it triggers quite
frequently on gtest code which tests expressions for null-pointer-ness in a
SFINAE context (so it wouldn't be a problem if this was an error as in an
actual implementation of core issue 903). To workaround this for now, the
diagnostic does not fire in unevaluated contexts.
Review by Sean Silva and Richard Smith.
llvm-svn: 161501
|
| |
|
|
|
|
|
|
|
|
|
|
| |
update implementation to match. An elidable, non-trivial constructor call is a
side-effect under this definition, but wasn't under the old one, because we are
not required to evaluate it even though it may have an effect.
Also rationalize checking for volatile reads: just look for lvalue-to-rvalue
conversions on volatile glvalues, and ignore whether a DeclRefExpr etc is for
a volatile variable.
llvm-svn: 161393
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
was mistakenly classifying dynamic_casts which might throw as having no side
effects.
Switch it from a visitor to a switch, so it is kept up-to-date as future Expr
nodes are added. Move it from ExprConstant.cpp to Expr.cpp, since it's not
really related to constant expression evaluation.
Since we use HasSideEffect to determine whether to emit an unused global with
internal linkage, this has the effect of suppressing emission of globals in
some cases.
I've left many of the Objective-C cases conservatively assuming that the
expression has side-effects. I'll leave it to someone with better knowledge
of Objective-C than mine to improve them.
llvm-svn: 161388
|
| |
|
|
|
|
| |
Fixes pr13353.cpp.
llvm-svn: 160393
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This required moving the ctors for IntegerLiteral and FloatingLiteral out of
line which shouldn't change anything as they are usually called through Create
methods that are already out of line.
ASTContext::Deallocate has been a nop for a long time, drop it from ASTVector
and make it independent from ASTContext.h
Pass the StorageAllocator directly to AccessedEntity so it doesn't need to
have a definition of ASTContext around.
llvm-svn: 159718
|
| |
|
|
|
|
|
|
| |
the correct this pointer. There is some potential for sharing a bit more
code with canDevirtualizeMemberFunctionCalls, but that can be done in an
independent patch.
llvm-svn: 159326
|
| |
|
|
|
|
| |
being updated. Will fix that in a second.
llvm-svn: 159280
|
| |
|
|
|
|
|
|
| |
to see if we had an underlying final class or method, but we would then
use the cast type to do the call, resulting in a direct call to the wrong
method.
llvm-svn: 159212
|
| |
|
|
|
|
| |
field has a non-trivial copy constructor. PR13097.
llvm-svn: 158578
|
| |
|
|
|
|
|
| |
class and have StmtPrinter and StmtDumper refer to it. This fixes an
assertion failure when dumping wchar string literals.
llvm-svn: 158417
|
| |
|
|
|
|
| |
escape sequences.
llvm-svn: 158390
|
| |
|
|
| |
llvm-svn: 158343
|
| |
|
|
|
|
| |
where "x" refers to a local variable. This should silence a useless warning in compiler-rt and other places.
llvm-svn: 157414
|
| |
|
|
|
|
| |
Conceptually, this is part of -Wunused-value, but I added a separate flag -Wunused-volatile-lvalue so it doesn't get turned off by accident with -Wno-unused-value. I also made a few minor improvements to existing unused value warnings in the process. <rdar://problem/11516811>.
llvm-svn: 157362
|
| |
|
|
|
|
|
|
| |
file buffer, not at the start of lexing.
Fixes assertion hit in format diagnostics. rdar://11418366
llvm-svn: 156647
|
| |
|
|
|
|
| |
Part of rdar://10796159
llvm-svn: 156228
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have a new flavor of exception specification, EST_Uninstantiated. A function
type with this exception specification carries a pointer to a FunctionDecl, and
the exception specification for that FunctionDecl is instantiated (if needed)
and used in the place of the function type's exception specification.
When a function template declaration with a non-trivial exception specification
is instantiated, the specialization's exception specification is set to this
new 'uninstantiated' kind rather than being instantiated immediately.
Expr::CanThrow has migrated onto Sema, so it can instantiate exception specs
on-demand. Also, any odr-use of a function triggers the instantiation of its
exception specification (the exception specification could be needed by IRGen).
In passing, fix two places where a DeclRefExpr was created but the corresponding
function was not actually marked odr-used. We used to get away with this, but
don't any more.
Also fix a bug where instantiating an exception specification which refers to
function parameters resulted in a crash. We still have the same bug in default
arguments, which I'll be looking into next.
This, plus a tiny patch to fix libstdc++'s common_type, is enough for clang to
parse (and, in very limited testing, support) all of libstdc++4.7's standard
headers.
llvm-svn: 154886
|
| |
|
|
|
|
|
|
|
| |
initialize an array of unsigned char. Outside C++11 mode, this bug was benign,
and just resulted in us emitting a constant which was double the required
length, padded with 0s. In C++11, it resulted in us generating an array whose
first element was something like i8 ptrtoint ([n x i8]* @str to i8).
llvm-svn: 154756
|
| |
|
|
|
|
| |
GNU __atomic builtins.
llvm-svn: 154659
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This is not quite sufficient for libstdc++'s <atomic>: we still need
__atomic_test_and_set and __atomic_clear, and may need a more complete
__atomic_is_lock_free implementation.
We are also missing an implementation of __atomic_always_lock_free,
__atomic_nand_fetch, and __atomic_fetch_nand, but those aren't needed
for libstdc++.
llvm-svn: 154579
|
| |
|
|
|
|
|
| |
of an uninitialized Stmt* in serialization of __atomic_init and add a test of
atomics serialization.
llvm-svn: 154448
|
| |
|
|
|
|
| |
information and more closely match GCC's, from Nikola Smiljanic!
llvm-svn: 154430
|