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

44398 Коммитов

Автор SHA1 Сообщение Дата
Ted Kremenek e86ee1a213 [analyzer; alternate edges] optimize edges for ObjC fast enumeration loops.
Fixes <rdar://problem/13942300>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182342 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-21 00:34:40 +00:00
Fariborz Jahanian dbed7cceb8 doc. parsing. HeaderDoc documentaton allows use of
@class command on an @interface declaration. Turn off
the warning for this case. // rdar://13927330


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182334 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-20 23:40:39 +00:00
Richard Smith cc8e22b4e9 Revert r182331, these checks should be based on the target not the host.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182333 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-20 23:40:27 +00:00
Richard Smith 7efb8af368 Move two Darwin-specific hacks into #ifdef __APPLE__. These were stat'ing
nonexistent Darwin-specific files on every module build.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182331 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-20 23:17:08 +00:00
David Blaikie fc46ebc2b1 PR14606: Debug Info for namespace aliases/DW_TAG_imported_module
This resolves the last of the PR14606 failures in the GDB 7.5 test
suite. (but there are still unresolved issues in the imported_decl case
- we need to implement optional/lazy decls for functions & variables
like we already do for types)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182329 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-20 22:50:41 +00:00
Reid Kleckner beba3e8037 Warn on and drop dllimport attrs from variable definitions
AsmPrinter::EmitLinkage() does not handle dllimport linkage.  The LLVM
verifier should also be fixed to reject this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182320 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-20 21:53:29 +00:00
Fariborz Jahanian 8dbda516d3 Objective-C [qoi]: When an class conforms to multiple
protocols that declare the same property of incompatible
types, issue a warning when class implementation synthesizes 
the property. // rdar://13075400


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182316 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-20 21:20:24 +00:00
Eric Christopher 3a7d82c485 Make this const since it never changes (and should never change).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182309 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-20 19:59:06 +00:00
DeLesley Hutchins 451f8e4ed6 Thread safety analysis: fix use after free bug reported by Evgeniy Stepanov.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182305 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-20 17:57:55 +00:00
Hans Wennborg 355103b945 ReleaseNotes.rst: typo
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182294 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-20 15:59:04 +00:00
Alexander Kornienko 107db3c211 Minor fix: don't crash on empty configuration file, consider empty configuration files invalid.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182290 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-20 15:18:01 +00:00
Hans Wennborg 0437e0d188 ReleaseNotes: add note about ASTContext::WCharTy and WideCharTy
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182280 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-20 14:53:06 +00:00
Alexey Samsonov f8d4a6b80d Nuke build of static ASan runtime on Mac OS - clang part
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182278 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-20 14:33:20 +00:00
Peter Collingbourne f51cfb89b3 [ms-cxxabi] Look up operator delete() at every virtual dtor declaration.
While the C++ standard requires that this lookup take place only at the
definition point of a virtual destructor (C++11 [class.dtor]p12), the
Microsoft ABI may require the compiler to emit a deleting destructor
for any virtual destructor declared in the TU, including ones without
a body, requiring an operator delete() lookup for every virtual
destructor declaration.  The result of the lookup should be the same
no matter which declaration is used (except in weird corner cases).

This change will cause us to reject some valid TUs in Microsoft ABI
mode, e.g.:

struct A {
  void operator delete(void *);
};

struct B {
  void operator delete(void *);
};

struct C : A, B {
  virtual ~C();
};

As Richard points out, every virtual function declared in a TU
(including this virtual destructor) is odr-used, so it must be defined
in any program which declares it, or the program is ill formed, no
diagnostic required.  Because we know that any definition of this
destructor will cause the lookup to fail, the compiler can choose to
issue a diagnostic here.

Differential Revision: http://llvm-reviews.chandlerc.com/D822

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182270 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-20 14:12:25 +00:00
Evgeniy Stepanov 26afaf0b12 Extend default blacklist logic to MSan and TSan.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182269 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-20 14:10:58 +00:00
Douglas Gregor 44b6fa3920 Add arm_neon.h to the builtin intrinsics module map.
Fixes <rdar://problem/13933913>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182268 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-20 14:07:18 +00:00
Reid Kleckner a722534711 Implement __declspec(selectany) under -fms-extensions
selectany only applies to externally visible global variables.  It has
the effect of making the data weak_odr.

The MSDN docs suggest that unused definitions can only be dropped at
linktime, so Clang uses weak instead of linkonce.  MSVC optimizes away
references to constant selectany data, so it must assume that there is
only one definition, hence weak_odr.

Reviewers: espindola

Differential Revision: http://llvm-reviews.chandlerc.com/D814

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182266 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-20 14:02:37 +00:00
Douglas Gregor 7baff64eb3 Fix broken test
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182264 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-20 13:54:38 +00:00
Douglas Gregor 58ea48dc1d Add -Wincomplete-module, which detects when a header is included from a module but isn't itself part of a module.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182263 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-20 13:49:41 +00:00
David Blaikie 9faebd23fd Revert "Revert "Debug Info: Using declarations/DW_TAG_imported_declaration of variables, types, and functions.""
This reverts commit r181947 (git d2990ce56a16050cac0d7937ec9919ff54c6df62 )

This addresses one of the two issues identified in r181947, ensuring
that types imported via using declarations only result in a declaration
being emitted for the type, not a definition. The second issue (emitting
using declarations that are unused) is hopefully an acceptable increase
as the real fix for this would be a bit difficult (probably at best we
could record which using directives were involved in lookups - but may
not have been the result of the lookup).

This also ensures that DW_TAG_imported_declarations (& directives) are
not emitted in line-tables-only mode as well as ensuring that typedefs
only require/emit declarations (rather than definitions) for referenced
types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182231 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-20 04:58:53 +00:00
Jakob Stoklund Olesen 5ac8c4f449 OpenBSD/sparc64 uses long long for int64_t and intmax_t.
Other operating systems, including FreeBSD and NetBSD, use long.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182215 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-19 17:53:37 +00:00
Richard Smith 1c7315116f Tests and status for core issues 1-50.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182207 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-19 07:22:38 +00:00
Alexander Kornienko 885f87b4be Clang-format: allow -style="{yaml/json}" on command line
Summary: + improved handling of default style and predefined styles.

Reviewers: djasper, klimek

Reviewed By: klimek

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D813

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182205 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-19 00:53:30 +00:00
Anna Zaks 08cf30eb32 [analyzer] Extend the checker developer manual. A patch by Sam Handler!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182204 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-18 22:51:28 +00:00
Chandler Carruth b69557ed6f Fix a logic bug in the handling of -fmath-errno in the driver. We would
imply -fno-math-errno if the user passed -fno-fast-math OR -ffast-math,
regardless of in which order and regardless of the tool chain default.

I've fixed this to follow the logic:

1) If the last dominating flag is -fno-math-errno, -ffast-math, or
   -Ofast, then do not use math-errno.
2) If the last dominating flag is an explicit -fmath-errno, do use
   math-errno.
3) Otherwise, use the toolchain default.

This, for example, allows the flag sequence
'-ffast-math ... -fno-fast-math' with no mention of '-fmath-errno' or
'-fno-math-errno' to preserve the toolchain default. Most notably, this
should prevent users trying to disable fast-math optimizations on Darwin
and BSD platforms from simultaneously enabling (pointless) -fmath-errno.

I've enhanced the tests (after more reorganization) to cover this and
other weird permutations of flags and targets.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182203 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-18 20:47:36 +00:00
Chandler Carruth edc313343d Slight reorganization of the fast-math tests which test for errno
setting. Consolidate the collection of tests that enable -fmath-errno
and share a single CHECK line for simplicity.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182202 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-18 20:27:06 +00:00
Serge Pavlov fa047c5805 Removed invalid character.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182189 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-18 04:32:15 +00:00
Jordan Rose 6d0da608c1 [analyzer] New edges: include an edge to the end-of-path location.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182188 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-18 02:27:13 +00:00
Jordan Rose b9fdfb5098 [analyzer] "Fix" ParentMap to handle non-syntactic OpaqueValueExprs.
Constructs like PseudoObjectExpr, where an expression can appear more than
once in the AST, use OpaqueValueExprs to guard against inadvertent
re-processing of the shared expression during AST traversal. The most
common form of this is to share expressions between the syntactic
"as-written" form of, say, an Objective-C property access 'obj.prop', and
the underlying "semantic" form '[obj prop]'.

However, some constructs can produce OpaqueValueExprs that don't appear in
the syntactic form at all; in these cases the ParentMap wasn't ever traversing
the children of these expressions. This patch fixes that by checking to see
if an OpaqueValueExpr's child has ever been traversed before. There's also a
bit of reset logic when visiting a PseudoObjectExpr to handle the case of
updating the ParentMap, which some external clients depend on.

This still isn't exactly the right fix because we probably want the parent
of the OpaqueValueExpr itself to be its location in the syntactic form if
it's syntactic and the PseudoObjectExpr or BinaryConditionalOperator itself
if it's semantic. Whe I originally wrote the code to do this, I didn't realize
that OpaqueValueExprs themselves are shared in the AST, not just their source
expressions. This patch doesn't change the existing behavior so as not to
break anything inadvertently relying on it; we'll come back to this later.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182187 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-18 02:27:09 +00:00
Jordan Rose d1913d89e2 [analyzer] Add a debug dump for PathPieces, a list of PathDiagnosticPieces.
Originally implemented by Ted, extended by me.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182186 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-18 02:26:59 +00:00
Jordan Rose bb518991ce Revert "[analyzer; alternate edges] improve support for edges with PseudoObjectExprs."
Ted and I spent a long time discussing this today and found out that neither
the existing code nor the new code was doing what either of us thought it
was, which is never good. The good news is we found a much simpler way to
fix the motivating test case (an ObjCSubscriptExpr).

This reverts r182083, but pieces of it will come back in subsequent commits.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182185 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-18 02:26:50 +00:00
Rafael Espindola ac8b151c4f Handle local enum types too.
Thanks to John McCall for pointing this out.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182182 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-18 00:33:28 +00:00
Adrian Prantl b509224b28 Drop the const from the isa test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182178 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-17 23:58:45 +00:00
Adrian Prantl 687ecae119 ObjC Debug Info: Emit the correct method names for accessors for
properties declared in a protocol.

rdar://problem/13798000

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182176 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-17 23:49:10 +00:00
DeLesley Hutchins 5c6134fd09 Thread safety analysis: add two new attributes to the thread safety analysis:
assert_exclusive_lock and assert_shared_lock.  These attributes are used to
mark functions that dynamically check (i.e. assert) that a lock is held.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182170 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-17 23:02:59 +00:00
Rafael Espindola 8b00b8004e Use the awesome CHECK-DAG!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182167 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-17 22:33:49 +00:00
Anna Zaks 5a8e1ad062 [analyzer] Address Jordan's review comments for r182058
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182156 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-17 20:51:16 +00:00
Dmitri Gribenko c965f76e02 libclang: add a function to check whether a member function is pure virtual
Patch by Seth Fowler.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182139 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-17 18:38:35 +00:00
Fariborz Jahanian e4bb74973c Objective-C parsing. Error recovery when category implementation
declaration is illegally protocol qualified. // rdar://13920026


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182136 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-17 17:58:11 +00:00
Dmitri Gribenko e3c63fce12 Move documentation to the constructor. Fixes a -Wdocumentation warning
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182134 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-17 17:50:16 +00:00
Fariborz Jahanian 2521dfa550 Objective-C++ (and c++) Sema: Patch fixes a sema crash when gnu’s ?: extension
is used for Objective-C++’s dictionary subscripting. This is done by filtering
out all placeholder types before check on lowering of the
common expression is done. // rdar://1374918.
Reviewed by John McCall.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182120 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-17 16:29:36 +00:00
Reid Kleckner 8fbda8e4a0 Refactor diagnostics for MS attributes without -fms-extensions
This shares the warn_attribute_unused diagnostic and reduces the
indentation level.  No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182096 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-17 14:04:52 +00:00
Ted Kremenek e9aae62e8b [analyzer; alternate edges] improve support for edges with PseudoObjectExprs.
This optimizes some spurious edges resulting from PseudoObjectExprs.
This required far more changes than I anticipated.  The current
ParentMap does not record any hierarchy information between
a PseudoObjectExpr and its *semantic* expressions that may be
wrapped in OpaqueValueExprs, which are the expressions actually
laid out in the CFG.  This means the arrow pruning logic could
not map from an expression to its containing PseudoObjectExprs.

To solve this, this patch adds a variant of ParentMap that
returns the "semantic" parentage of expressions (essentially
as they are viewed by the CFG).  This alternate ParentMap is then
used by the arrow reducing logic to identify edges into pseudo
object expressions, and then eliminate them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182083 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-17 09:41:40 +00:00
Daniel Jasper 399914b7a6 Slightly modify the formatting rules for braced lists.
Basically, the new rule is: The opening "{" always has to be on the
same line as the first element if the braced list is nested
(e.g. in another braced list or in a function).

The solution that clang-format produces almost always adheres to this
rule anyway and this makes clang-format significantly faster for larger
lists. Added a test cases for the only exception I could find
(which doesn't seem to be very important at first sight).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182082 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-17 09:35:01 +00:00
Manuel Klimek 7b773002d0 Add embedded video for the AST tutorial.
As asked for by Sean, putting the video into the docs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182081 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-17 08:40:22 +00:00
Ted Kremenek a40983460c [analyzer; alternate edges] treat 'if' statements the same way we do as 'for' or 'while'.
This means adding an extra edge from the 'if' to the condition,
which aesthetically looks more pleasing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182079 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-17 06:48:27 +00:00
Ted Kremenek dbfa950abe [analyzer; alternate edges] don't add an edge incoming from the start of a function
for a nested call.  This matches what we do with the first stack frame.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182078 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-17 06:48:22 +00:00
Richard Smith 24ce46c8ce Use 'c++' not 'cxx' in these diagnostic group names for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182075 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-17 03:11:25 +00:00
Richard Smith 7a9f7c7c68 A little ArrayRef'ization.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182074 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-17 03:04:50 +00:00
Richard Smith b5eb3f5bf3 PR15757: When we instantiate an inheriting constructor template, also
instantiate the inherited constructor template and mark that as the constructor
which the instantiated specialization is inheriting. This fixes a
crash-on-valid when trying to compute the exception specification of a
specialization of the inheriting constructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182072 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-17 02:19:35 +00:00