Argyrios Kyrtzidis
c793a61355
[preprocessor] Enhance the preprocessor callbacks:
...
-Add location parameter for the directives callbacks
-Skip callbacks if the directive is inside a skipped range.
-Make sure the directive callbacks are invoked in source order.
llvm-svn: 152017
2012-03-05 05:48:09 +00:00
Richard Smith
2a1b1c68f3
More tests for r152012.
...
llvm-svn: 152013
2012-03-05 04:06:25 +00:00
Richard Smith
e18f0faff2
Lexing support for user-defined literals. Currently these lex as the same token
...
kinds as the underlying string literals, and we silently drop the ud-suffix;
those issues will be fixed by subsequent patches.
llvm-svn: 152012
2012-03-05 04:02:15 +00:00
Gregory Szorc
74226d3597
[clang.py] Return bool from Cursor.__eq__
...
llvm-svn: 152011
2012-03-05 00:42:15 +00:00
Erik Verbruggen
8c738bc98a
Remove a recursive visitation in ExprEngine that is no longer needed because the CFG is fully linearized.
...
llvm-svn: 152007
2012-03-04 18:12:21 +00:00
Chandler Carruth
52b6ac2a78
Silence a GCC warning about a set-but-not-used variable in release builds.
...
llvm-svn: 152005
2012-03-04 12:16:40 +00:00
Richard Smith
72eebee0cb
Add tests for [over.literal]. Fix a few bugs which were exposed by the tests.
...
llvm-svn: 151997
2012-03-04 09:41:16 +00:00
Chris Lattner
332673d39d
From his comment in PR12168, Eli seems confused about the alignment assumptions
...
we're making. We only ignore implicit casts. Add a testcase showing that
we get the right behavior with explicit casts.
llvm-svn: 151994
2012-03-04 00:56:24 +00:00
Chris Lattner
aaa18fad7d
add a testcase for PR12094 and fix a crash on pointer to incomplete type,
...
reported by Richard Smith.
llvm-svn: 151993
2012-03-04 00:52:12 +00:00
Richard Smith
522fa53703
Add a pile of tests for unrestricted unions, and advertise support for them.
...
llvm-svn: 151992
2012-03-03 23:51:05 +00:00
Richard Smith
2e312c8738
constexpr: Remove APValue/CCValue distinction. It is no longer useful given the
...
resolution of core issue 1454.
llvm-svn: 151991
2012-03-03 22:46:17 +00:00
Benjamin Kramer
15ceed9a9e
Remove unused variable.
...
llvm-svn: 151989
2012-03-03 21:52:22 +00:00
Jean-Daniel Dupas
999892f0d0
Fix Typo in 'objc changes' anchor.
...
llvm-svn: 151978
2012-03-03 13:37:22 +00:00
Eli Friedman
5358a0ab5a
Avoid an unnecessary recursive loop between type canonicalization and NNS canonicalization which would (rarely) lead to memory corruption. While I'm here, simplify. Fixes PR12166. Not committing a testcase because it's impossible to reduce it.
...
llvm-svn: 151967
2012-03-03 04:09:56 +00:00
Ted Kremenek
868dbda367
[analyzer] do not warn about returning stack-allocated memory when it comes from an ancestor stack frame.
...
llvm-svn: 151964
2012-03-03 01:22:03 +00:00
Richard Smith
906ccc167c
Factor bitfields of LangOptions out into a base class in order to make them
...
trivially-copyable. 50KiB reduction in clang binary size.
llvm-svn: 151963
2012-03-03 00:52:40 +00:00
Daniel Dunbar
ae77b3dfad
Frontend: Default to creating output files using temporary files + rename.
...
- This is a more reliable default, as it behaves better on failure and also
ensures that we create *new* files (instead of reusing existing inodes). This
is useful for other applications (like lldb) which want to cache inode's to
know when a file has been rewritten.
llvm-svn: 151961
2012-03-03 00:36:06 +00:00
Daniel Dunbar
b9c62c0773
Frontend: Don't automatically create missing directories when using temporary files with createOutputFile()
...
- This would otherwise happen as a side effect of llvm::sys::fs::unique_file creating parent directories.
llvm-svn: 151960
2012-03-03 00:36:02 +00:00
DeLesley Hutchins
e2a3f75a12
Thread safety analysis: expand set of expressions that can be used to denote locks.
...
llvm-svn: 151956
2012-03-02 23:36:05 +00:00
Richard Smith
bc638767f8
Reinstate r151879, r151880, reverted in r151922, along with a bugfix for
...
scalar emission of DeclRefExprs to const bools: emit scalar bools as i1,
not as i8.
In addition to the extra unit testing, this has successfully bootstrapped.
llvm-svn: 151955
2012-03-02 23:27:11 +00:00
Anna Zaks
b8b21e9b56
Unbreak the CMake builds following the CallGraph change.
...
llvm-svn: 151952
2012-03-02 23:18:45 +00:00
Nico Weber
9b9ebfc090
Add a test for the -Wstring-plus-int fixit note.
...
llvm-svn: 151951
2012-03-02 23:01:20 +00:00
Anna Zaks
fc5dfe9f7c
[analyzer] Rename clang::CallGraph into clang::idx::CallGraph + rename
...
the corresponding files to avoid confusion.
This is a preparation to adding an AST-based call graph to Analysis. The
existing call graph works with indexer entries. We might be able to
refactor it to use the AST based graph in the future.
(Minimal testing here as the only example that uses the API has been
completely broken, does not compile.)
llvm-svn: 151950
2012-03-02 22:54:36 +00:00
Aaron Ballman
611306eae6
Adding support for #pragma include_alias in MS compatibility mode. This implements PR 10705.
...
llvm-svn: 151949
2012-03-02 22:51:54 +00:00
DeLesley Hutchins
71d6103295
Issue warning when late-parsed attributes have no declaration.
...
llvm-svn: 151947
2012-03-02 22:29:50 +00:00
DeLesley Hutchins
bd2ee13e78
Make late-parsed attributes follow the conventions of ordinary
...
GNU attributes to a better extent, by allowing them in more
places on a declator.
llvm-svn: 151945
2012-03-02 22:12:59 +00:00
DeLesley Hutchins
a2587ef26d
Thread safety analysis: handle CFG blocks which call functions marked as noreturn.
...
llvm-svn: 151944
2012-03-02 22:02:58 +00:00
Nico Weber
ccec40d9b7
Add -Wstring-plus-int, which warns on "str" + int and int + "str".
...
It doesn't warn if the integer is known at compile time and within
the bounds of the string.
Discussion: http://comments.gmane.org/gmane.comp.compilers.clang.scm/47203
llvm-svn: 151943
2012-03-02 22:01:22 +00:00
Fariborz Jahanian
7923ef41e1
objc: When issue diagnostic about deprecated method, also
...
issue the note if it is because message is sent to a forward class
declaration in delayed diagnostic. // rdar://10290322
llvm-svn: 151942
2012-03-02 21:50:02 +00:00
Ted Kremenek
aa1f96add5
[analyzer diagnostics] flush locations *before* popping the current path when visiting a CallEnter.
...
Fixes <rdar://problem/10967815>
llvm-svn: 151938
2012-03-02 21:16:22 +00:00
Hal Finkel
2690838227
Fix an ABI problem with ptrdiff_t and intptr_t on PPC32
...
ptrdiff_t on PPC32 on Linux, etc. should be int not long.
This does not matter for C, but it does matter for C++ because of
name mangling.
The preprocessor test has been changed accordingly.
llvm-svn: 151935
2012-03-02 20:54:36 +00:00
Nico Weber
99c07bc822
Move int<->pointer conversion warnings behind -Wint-conversions.
...
This is consistent with -Wbool-conversion. Let me know if you prefer
a different flag name.
llvm-svn: 151934
2012-03-02 20:23:08 +00:00
Argyrios Kyrtzidis
4af2cb3355
[Sema] Fix crash-on-invalid-code issue:
...
@class I;
@implementation I(cat) // crashes here
@end
rdar://10968158
llvm-svn: 151931
2012-03-02 19:14:29 +00:00
Anna Zaks
265087721a
[analyzer] Bound the size of the functions being inlined + provide
...
command line options for inlining tuning.
This adds the option for stack depth bound as well as function size
bound.
+ minor doxygenification
llvm-svn: 151930
2012-03-02 19:05:03 +00:00
Jay Foad
b0f3344b10
PR12094: Set the alignment of memory intrinsic instructions based on the
...
types of the pointer arguments.
llvm-svn: 151927
2012-03-02 18:34:30 +00:00
Fariborz Jahanian
bf48281c25
Change diagnostic test for my last patch.
...
// rdar://10961370
llvm-svn: 151923
2012-03-02 17:05:03 +00:00
Daniel Dunbar
d01281fe0d
Revert r151879, r151880, "PR12145: Avoid emitting loads of constexpr variables in contexts where there" and "Fix buildbot: make this test less dependent on the value names in the produced IR."
...
They broke bootstrap.
llvm-svn: 151922
2012-03-02 16:24:25 +00:00
Benjamin Kramer
8fe5fc8521
Use tabs instead of spaces.
...
No, really, make doesn't work with spaces.
llvm-svn: 151920
2012-03-02 16:06:37 +00:00
Jia Liu
5c302484e9
clang -v support for separate clang.git and llvm.git, patch by Andrew Trick.
...
llvm-svn: 151910
2012-03-02 14:37:41 +00:00
David Chisnall
e04307e47c
Add the Solaris support directory to the header search when using libc++.
...
Unconditionally define __C99FEATURES__ when using C++ on Solaris. This is a
(hopefully temporary) work around for libc++ exposing C99-but-not-C++98
features in C++98 mode.
llvm-svn: 151889
2012-03-02 10:49:52 +00:00
Richard Smith
35ecb36fcd
Ensure that we instantiate static reference data members of class templates
...
early, since their values can be used in constant expressions in C++11. For
odr-use checking, the opposite change is required, since references are
odr-used whether or not they satisfy the requirements for appearing in a
constant expression.
llvm-svn: 151881
2012-03-02 04:14:40 +00:00
Richard Smith
545f38c3d2
Fix buildbot: make this test less dependent on the value names in the produced IR.
...
llvm-svn: 151880
2012-03-02 03:22:38 +00:00
Richard Smith
a541a3bbee
PR12145: Avoid emitting loads of constexpr variables in contexts where there
...
is no odr-use of the variable. Go slightly beyond what the standard requires
for variables of reference type.
llvm-svn: 151879
2012-03-02 03:16:32 +00:00
Ted Kremenek
f9e9d33019
[analyzer diagnostics] Change CompactPathDiagnostic to recursively compact diagnostics in calls into macro pieces.
...
Also fix handling of macros within calls in the HTMLDiagnostics.
This also adds a test case for r151774.
llvm-svn: 151872
2012-03-02 01:27:31 +00:00
Fariborz Jahanian
3854a55a17
c/objc: problem originally reported as an objective-c bug.
...
But it is in the underlying c part of clang. clang crashes
in IRGen when passing an incomplete type argument to
variadic function (instead of diagnosing the bug).
// rdar://10961370
llvm-svn: 151862
2012-03-01 23:42:00 +00:00
Kostya Serebryany
b187449435
add documentation for -f[no-]thread-sanitizer and -f[no-]address-sanitizer to docs/UsersManual.html
...
llvm-svn: 151858
2012-03-01 23:14:19 +00:00
Ted Kremenek
57207d6074
Teach the analyzer to just ignore CXXBindTemporaryExpr. There's nothing special to do with it, since destructors are represented explicitly in the CFG.
...
llvm-svn: 151856
2012-03-01 23:06:04 +00:00
Ted Kremenek
9466603322
Moving tagging of '__experimental_modules_import' IdentifierInfo out of
...
IndentifierTable::get() and into IdentifierTable's constructor.
This gets a 0.7% reducing on lexing time for Cocoa.h, and
about the same for PCH generation.
llvm-svn: 151854
2012-03-01 22:53:32 +00:00
Eli Friedman
c4e5d0ccda
Make CodeGenFunction::EmitBlockCopyAndAutorelease actually do what its name says.
...
llvm-svn: 151853
2012-03-01 22:52:28 +00:00
Eric Christopher
5bc1f47b00
Update test for llvm assembly output change. Also add a fixme that this
...
shouldn't be relying on assembly emission.
For the record we should check the metadata output from the front
end and then check in the backend that such a thing emits a pubtypes
entry.
llvm-svn: 151851
2012-03-01 22:49:10 +00:00