Argyrios Kyrtzidis
a0caa29d6f
Revert r146646 that was a mistake, and make the intended change in the right file.
...
Log:
[libclang] Try to unbreak mingw build.
llvm-svn: 146647
2011-12-15 05:53:37 +00:00
Argyrios Kyrtzidis
d99472f4cd
[libclang] Try to unbreak mingw build.
...
llvm-svn: 146646
2011-12-15 05:48:43 +00:00
Douglas Gregor
c0ac7d688e
Move the definition-specific data of ObjCInterfaceDecl into a
...
separately-allocated DefinitionData structure, which we manage the
same way as CXXRecordDecl::DefinitionData. This prepares the way for
making ObjCInterfaceDecls redeclarable, to more accurately model
forward declarations of Objective-C classes and eliminate the mutation
of ObjCInterfaceDecl that causes us serious trouble in the AST reader.
Note that ObjCInterfaceDecl's accessors are fairly robust against
being applied to forward declarations, because Clang (and Sema in
particular) doesn't perform RequireCompleteType/hasDefinition() checks
everywhere it has to. Each of these overly-robust cases is marked with
a FIXME, which we can tackle over time.
llvm-svn: 146644
2011-12-15 05:27:12 +00:00
Eli Friedman
a109e92a66
<climits> has UINT_MAX, not <limits>.
...
llvm-svn: 146638
2011-12-15 04:24:37 +00:00
Anna Zaks
f8548b080d
Another fixit for r146633 (to make debian-fnt bot happy), try including limits instead.
...
llvm-svn: 146637
2011-12-15 03:27:51 +00:00
Anna Zaks
2c74eedbba
Fixit for r146633. Make sure UINT_MAX is defined on all platforms.
...
(Attempt to turn debian-fnt buildbot back to green.)
llvm-svn: 146635
2011-12-15 02:58:00 +00:00
Eli Friedman
8349dc1fd6
Enhance the -Wsign-compare handling to suppress the -Wsign-compare warning in the case of a shifted bitfield. PR11572.
...
llvm-svn: 146634
2011-12-15 02:41:52 +00:00
Anna Zaks
a2510070ee
Add support for matching one or more (aka regex +) diagnostic messages with -verify.
...
Ex:
// expected-warning + {{tainted}
llvm-svn: 146633
2011-12-15 02:28:16 +00:00
Eli Friedman
3715d1f435
gcov-style profiling support for OpenBSD. Patch by Jonathan Gray.
...
llvm-svn: 146631
2011-12-15 02:15:56 +00:00
Anna Zaks
30373150a1
[analyzer] Ensure that the order in which checker callbacks are called
...
is deterministic.
Non-determinism was the reason for the test which caused the earlier
buildbot failures, so re-enable the test.
llvm-svn: 146628
2011-12-15 01:36:04 +00:00
Fariborz Jahanian
9e49b6a6ff
objc: do not auto synthesize properties declared in
...
protocols; with a warning. // rdar://10567333
llvm-svn: 146626
2011-12-15 01:03:18 +00:00
Douglas Gregor
95715f9ecf
In debugger support mode, if we have a top-level message send
...
expression with an unknown result type, assume that the result type is
'id'. Fixes <rdar://problem/10400663>.
llvm-svn: 146622
2011-12-15 00:53:32 +00:00
Richard Trieu
553b2b2e5d
Modify how the -verify flag works. Currently, the verification string and
...
diagnostic message are compared. If either is a substring of the other, then
no error is given. This gives rise to an unexpected case:
// expect-error{{candidate function has different number of parameters}}
will match the following error messages from Clang:
candidate function has different number of parameters (expected 1 but has 2)
candidate function has different number of parameters
It will also match these other error messages:
candidate function
function has different number of parameters
number of parameters
This patch will change so that the verification string must be a substring of
the diagnostic message before accepting. Also, all the failing tests from this
change have been corrected. Some stats from this cleanup:
87 - removed extra spaces around verification strings
70 - wording updates to diagnostics
40 - extra leading or trailing characters (typos, unmatched parens or quotes)
35 - diagnostic level was included (error:, warning:, or note:)
18 - flag name put in the warning (-Wprotocol)
llvm-svn: 146619
2011-12-15 00:38:15 +00:00
Douglas Gregor
0b144e160a
Replace all comparisons between ObjCInterfaceDecl pointers with calls
...
to declaresSameEntity(), as a baby step toward tracking forward
declarations of Objective-C classes precisely. Part of
<rdar://problem/10583531>.
llvm-svn: 146618
2011-12-15 00:29:59 +00:00
Richard Smith
902ca2138f
Produce more detailed diagnostics when static_assert condition is not an ICE.
...
llvm-svn: 146607
2011-12-14 23:32:26 +00:00
Rafael Espindola
00b29189b7
Fix typos.
...
llvm-svn: 146595
2011-12-14 21:50:24 +00:00
Douglas Gregor
7234103225
Don't consider an overloaded operator& when the expression is actually
...
going to be a pointer-to-member constant. Fixes <rdar://problem/10544564>.
llvm-svn: 146587
2011-12-14 21:23:13 +00:00
Rafael Espindola
224dd63fff
Don't use the frame pointer on linux x86 and x86_64 if optimizing. This
...
matches gcc's behavior.
Fixes PR8186.
llvm-svn: 146586
2011-12-14 21:02:23 +00:00
DeLesley Hutchins
36f5d8518b
Allow empty argument lists in thread safety attributes
...
llvm-svn: 146580
2011-12-14 19:36:06 +00:00
David Blaikie
96b4874b50
Move & comment the 'decltype in declarator-id' as suggested by Doug Gregor.
...
llvm-svn: 146576
2011-12-14 18:59:02 +00:00
Bob Wilson
16c4195548
Fix obvious error in _mm_test_all_zeros. PR11565.
...
Patch by Mathias Gaunard!
llvm-svn: 146565
2011-12-14 17:17:16 +00:00
Douglas Gregor
40d009ff0c
Eliminate the vistigial ObjCClassDecl::ObjCClassRef, and inline its
...
members into ObjCClassDecl, saving ourselves one pointer per forward
declaration.
llvm-svn: 146564
2011-12-14 17:12:03 +00:00
Douglas Gregor
4a814568b2
When name lookup comes across a declaration that is in a module that
...
is not visible, look for any previous declarations of that entity that
might be visible.
llvm-svn: 146563
2011-12-14 16:03:29 +00:00
Matt Beaumont-Gay
5533a55172
r146430 lost some compile-time performance on MultiSource/Benchmarks/MiBench/security-rijndael; this gets most of it back.
...
llvm-svn: 146562
2011-12-14 16:02:15 +00:00
Bob Wilson
721d4b858d
Enable stack protectors by default for iOS. <rdar://problem/8836680>
...
llvm-svn: 146552
2011-12-14 06:08:25 +00:00
Anna Zaks
099fe3fb28
[analyzer] Treat stdin as a source of taint.
...
Some of the test cases do not currently work because the analyzer core
does not seem to call checkers for pre/post DeclRefExpr visits.
(Opened radar://10573500. To be fixed later on.)
llvm-svn: 146536
2011-12-14 00:56:18 +00:00
Anna Zaks
04b57c25bc
[analyzer] Minor refactor to addTaint.
...
llvm-svn: 146535
2011-12-14 00:56:15 +00:00
Anna Zaks
eefc0e9342
[analyzer] Mark output of fscanf and fopen as tainted.
...
llvm-svn: 146533
2011-12-14 00:56:02 +00:00
Anna Zaks
d6bb3227de
[analyzer] Mark getenv output as tainted.
...
Also, allow adding taint to a region (not only a symbolic value).
llvm-svn: 146532
2011-12-14 00:55:58 +00:00
Chad Rosier
1332d9b26a
Per discussion on the list, remove BitcodeVerify pass to reimplement as a free function.
...
llvm-svn: 146530
2011-12-14 00:29:23 +00:00
Richard Trieu
96ed5b6b47
Make the diagnostic message more consistant. Update the type comparison to
...
handle non-pointer types. This is for the extra info printed when function
types are compared.
llvm-svn: 146525
2011-12-13 23:19:45 +00:00
Fariborz Jahanian
c17c86b56c
objc: diagnose duplicate declaration of methods
...
in classes. // rdar://10535349
llvm-svn: 146504
2011-12-13 19:40:34 +00:00
Abramo Bagnara
d541a4c70d
Added an assertion about overflow in sizeof evaluation. This does not solve the underlying structural issue that is waiting for a proper solution.
...
llvm-svn: 146482
2011-12-13 11:23:52 +00:00
David Blaikie
42b99e08e6
Disallow decltype in qualified declarator-ids.
...
llvm-svn: 146480
2011-12-13 08:03:36 +00:00
Richard Smith
357362d00b
Add checks and diagnostics for many of the cases which C++11 considers to not
...
be constant expressions.
llvm-svn: 146479
2011-12-13 06:39:58 +00:00
Douglas Gregor
4dc71835f5
Set umbrella directory correctly when we infer a framework module
...
llvm-svn: 146451
2011-12-12 23:55:05 +00:00
Nick Lewycky
12eae8085c
Fix "control may reach end of non-void function" warning.
...
llvm-svn: 146448
2011-12-12 23:36:07 +00:00
Francois Pichet
025131601d
Implement the Microsoft __if_exists/if_not_exists extension in initializer-list.
...
Necessary to parse Microsoft ATL code.
Example:
int array[] = {
0,
__if_exists(CLASS::Type) {2, }
3
};
will declare an array of 2 or 3 elements depending on if CLASS::Type exists or not.
llvm-svn: 146447
2011-12-12 23:24:39 +00:00
Douglas Gregor
18b5864b83
Tweak submodule ID handling in the AST writer
...
llvm-svn: 146445
2011-12-12 23:17:57 +00:00
Fariborz Jahanian
b989e6e50a
objc-arc: better diagnostic when block is declared
...
inside a struct/union.
llvm-svn: 146444
2011-12-12 23:17:04 +00:00
Eli Friedman
3c840aad54
Make CGRecordLayoutBuilder correctly switch over to a packed class when a class has a base whose alignment will break the class layout. <rdar://problem/10551376>.
...
llvm-svn: 146443
2011-12-12 23:13:20 +00:00
Chad Rosier
c4399f779b
Add frontend flags to enable bitcode verifier pass.
...
llvm-svn: 146441
2011-12-12 23:05:47 +00:00
Matt Beaumont-Gay
9d570c438c
Suppress -Warray-bounds in certain cases involving macros from system headers.
...
The motivation here is a "clever" implementation of strncmp(), which peels the first few comparisons via chained conditional expressions which ensure that the input arrays are known at compile time to be sufficiently large.
llvm-svn: 146430
2011-12-12 22:35:02 +00:00
Fariborz Jahanian
0586df4a00
Fixes a bug in calculation of field offsets of ms_struct
...
fields by just following what comment says.
// rdar://10513599
llvm-svn: 146414
2011-12-12 21:16:36 +00:00
Tony Linthicum
76329bf83f
Hexagon backend support
...
llvm-svn: 146413
2011-12-12 21:14:55 +00:00
Douglas Gregor
c1aaf8cacb
When we have an umbrella directory in a module map, recursively walk
...
the subdirectories to find headers in submodules.
llvm-svn: 146398
2011-12-12 19:13:53 +00:00
Richard Smith
ff07af12df
Clean up diagnostic wording for disallowed casts in C++11 constant expressions.
...
llvm-svn: 146395
2011-12-12 19:10:03 +00:00
Douglas Gregor
a95387786d
Don't mark include guard macros as implicitly private. This isn't
...
actually a terribly good heuristic, and the world is too horrible for
it to work.
llvm-svn: 146393
2011-12-12 18:47:39 +00:00
Richard Smith
6d6ecc34f8
Implement C++11 constant expression cast restrictions.
...
llvm-svn: 146371
2011-12-12 12:46:16 +00:00
Richard Smith
187ef01404
Fix some not-yet-used diagnostic code in a template, which gcc spotted and clang
...
did not!
llvm-svn: 146366
2011-12-12 09:41:58 +00:00