Граф коммитов

35298 Коммитов

Автор SHA1 Сообщение Дата
James Molloy b3c312ce4d Fix a bug in the mangler where in 'namespace std { extern "C" {X;} }', X would not be seen to be in ::std::.
Migrate two other places where the same logic is used to use the helper function that already exists.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152022 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-05 09:59:43 +00:00
Argyrios Kyrtzidis 2a2781805a [arcmt]
-Make sure we don't change to '__weak' a __block variable used as output.
-Make sure we don't apply __weak twice.

Fixes rdar://10520757&10521362

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152020 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-05 08:46:24 +00:00
Argyrios Kyrtzidis c6c54521f9 [preprocessor] Enhance PreprocessingRecord to keep track of locations of conditional directives.
Introduce PreprocessingRecord::rangeIntersectsConditionalDirective() which returns
true if a given range intersects with a conditional directive block.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152018 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-05 05:48:17 +00:00
Argyrios Kyrtzidis bb66066688 [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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152017 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-05 05:48:09 +00:00
Richard Smith d4f9f9dfdf More tests for r152012.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152013 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-05 04:06:25 +00:00
Richard Smith 5cc2c6eb67 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152012 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-05 04:02:15 +00:00
Gregory Szorc 9d008fd572 [clang.py] Return bool from Cursor.__eq__
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152011 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-05 00:42:15 +00:00
Erik Verbruggen a81d3d434e Remove a recursive visitation in ExprEngine that is no longer needed because the CFG is fully linearized.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152007 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-04 18:12:21 +00:00
Chandler Carruth 77889c43b7 Silence a GCC warning about a set-but-not-used variable in release builds.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152005 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-04 12:16:40 +00:00
Richard Smith b4a7b1e587 Add tests for [over.literal]. Fix a few bugs which were exposed by the tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151997 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-04 09:41:16 +00:00
Chris Lattner 5bd20ffcfe 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151994 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-04 00:56:24 +00:00
Chris Lattner d6e73569cc add a testcase for PR12094 and fix a crash on pointer to incomplete type,
reported by Richard Smith.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151993 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-04 00:52:12 +00:00
Richard Smith ec92bc7897 Add a pile of tests for unrestricted unions, and advertise support for them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151992 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-03 23:51:05 +00:00
Richard Smith 1aa0be8635 constexpr: Remove APValue/CCValue distinction. It is no longer useful given the
resolution of core issue 1454.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151991 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-03 22:46:17 +00:00
Benjamin Kramer 7eb7d99d75 Remove unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151989 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-03 21:52:22 +00:00
Jean-Daniel Dupas 3fd808742e Fix Typo in 'objc changes' anchor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151978 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-03 13:37:22 +00:00
Eli Friedman 16412ef25a 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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151967 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-03 04:09:56 +00:00
Ted Kremenek 7e8678314c [analyzer] do not warn about returning stack-allocated memory when it comes from an ancestor stack frame.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151964 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-03 01:22:03 +00:00
Richard Smith 1f73ae227b Factor bitfields of LangOptions out into a base class in order to make them
trivially-copyable. 50KiB reduction in clang binary size.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151963 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-03 00:52:40 +00:00
Daniel Dunbar e21dd284d8 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151961 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-03 00:36:06 +00:00
Daniel Dunbar 12f28ab8a5 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151960 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-03 00:36:02 +00:00
DeLesley Hutchins 0d95dfcc0e Thread safety analysis: expand set of expressions that can be used to denote locks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151956 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 23:36:05 +00:00
Richard Smith a3ca41f0c2 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151955 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 23:27:11 +00:00
Anna Zaks 067cc40308 Unbreak the CMake builds following the CallGraph change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151952 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 23:18:45 +00:00
Nico Weber ff1e9cce64 Add a test for the -Wstring-plus-int fixit note.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151951 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 23:01:20 +00:00
Anna Zaks 190f6003cb [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.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151950 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 22:54:36 +00:00
Aaron Ballman 4c55c54db8 Adding support for #pragma include_alias in MS compatibility mode. This implements PR 10705.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151949 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 22:51:54 +00:00
DeLesley Hutchins 7ec419aa8f Issue warning when late-parsed attributes have no declaration.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151947 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 22:29:50 +00:00
DeLesley Hutchins 2287c5e235 Make late-parsed attributes follow the conventions of ordinary
GNU attributes to a better extent, by allowing them in more
places on a declator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151945 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 22:12:59 +00:00
DeLesley Hutchins 2a35be803c Thread safety analysis: handle CFG blocks which call functions marked as noreturn.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151944 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 22:02:58 +00:00
Nico Weber 1cb2d742eb 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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151943 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 22:01:22 +00:00
Fariborz Jahanian b0a6615cb9 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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151942 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 21:50:02 +00:00
Ted Kremenek 4ba86bc53b [analyzer diagnostics] flush locations *before* popping the current path when visiting a CallEnter.
Fixes <rdar://problem/10967815>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151938 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 21:16:22 +00:00
Hal Finkel 178a9b8b22 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151935 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 20:54:36 +00:00
Nico Weber 7d613bf783 Move int<->pointer conversion warnings behind -Wint-conversions.
This is consistent with -Wbool-conversion. Let me know if you prefer
a different flag name.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151934 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 20:23:08 +00:00
Argyrios Kyrtzidis 5a61e0c422 [Sema] Fix crash-on-invalid-code issue:
@class I;
@implementation I(cat) // crashes here
@end

rdar://10968158

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151931 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 19:14:29 +00:00
Anna Zaks 8235f9c9c8 [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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151930 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 19:05:03 +00:00
Jay Foad f4c3db1751 PR12094: Set the alignment of memory intrinsic instructions based on the
types of the pointer arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151927 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 18:34:30 +00:00
Fariborz Jahanian a0e005b06b Change diagnostic test for my last patch.
// rdar://10961370


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151923 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 17:05:03 +00:00
Daniel Dunbar c169e08f3a 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151922 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 16:24:25 +00:00
Benjamin Kramer edd1caec02 Use tabs instead of spaces.
No, really, make doesn't work with spaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151920 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 16:06:37 +00:00
Jia Liu f8e5d4cf39 clang -v support for separate clang.git and llvm.git, patch by Andrew Trick.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151910 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 14:37:41 +00:00
David Chisnall b4f0bd6864 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151889 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 10:49:52 +00:00
Richard Smith 16581335fc 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151881 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 04:14:40 +00:00
Richard Smith 0524171a57 Fix buildbot: make this test less dependent on the value names in the produced IR.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151880 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 03:22:38 +00:00
Richard Smith a3cac5b76a 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151879 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 03:16:32 +00:00
Ted Kremenek 77d09441e5 [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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151872 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 01:27:31 +00:00
Fariborz Jahanian e853bb34ec 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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151862 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-01 23:42:00 +00:00
Kostya Serebryany 48a8cd9840 add documentation for -f[no-]thread-sanitizer and -f[no-]address-sanitizer to docs/UsersManual.html
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151858 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-01 23:14:19 +00:00
Ted Kremenek cc2c4b293d Teach the analyzer to just ignore CXXBindTemporaryExpr. There's nothing special to do with it, since destructors are represented explicitly in the CFG.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151856 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-01 23:06:04 +00:00