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

20800 Коммитов

Автор SHA1 Сообщение Дата
Chris Lattner b205ac9fcd add capabilities to stop emitting errors after some limit.
Right now the limit is 0 (aka disabled)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100684 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 20:21:58 +00:00
Ted Kremenek c46a246f5f Don't emit an 'unused expression' warning for '||' and '&&' expressions that contain assignments
or similar side-effects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100676 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 18:49:21 +00:00
Chris Lattner 53eee7ba97 Instead of counting totally diagnostics, split the count into a count
of errors and warnings.  This allows us to emit something like this:

2 warnings and 1 error generated.

instead of:

3 diagnostics generated.

This also stops counting 'notes' because they are just follow-on information
about the previous diag, not a diagnostic in themselves.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100675 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 18:47:42 +00:00
Chris Lattner 5863b41004 convert to -verify mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100674 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 18:43:41 +00:00
Douglas Gregor 06245bfb3a Improve handling of friend types in several ways:
- When instantiating a friend type template, perform semantic
  analysis on the resulting type.
  - Downgrade the errors concerning friend type declarations that do
  not refer to classes to ExtWarns in C++98/03. C++0x allows
  practically any type to be befriended, and ignores the friend
  declaration if the type is not a class.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100635 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 17:57:12 +00:00
Douglas Gregor 1d86935801 Split Sema::ActOnFriendTypeDecl into Sema::CheckFriendTypeDecl (for
semantic analysis) and Sema::ActOnFriendTypeDecl (the action
callback). This is a prerequisite for improving template instantiation
of friend type declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100633 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 16:53:43 +00:00
John McCall beb41281f8 @llvm.sqrt isn't really close enough to C's sqrt to justify emitting calls
to the intrinsic, even when math-errno is off.

Fixes rdar://problem/7828230 by falling back on the library function.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100613 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 08:20:20 +00:00
Chris Lattner fc1a9c312d a ridiculous amount of propagation through the backend later,
have the code generate slap a srcloc metadata on inline asm nodes.
This allows us to diagnose invalid inline asms with such nice 
diagnostics as:

<inline asm>:1:2: error: unrecognized instruction
        abc incl    %eax
        ^
asm.c:2:12: note: generated from here
  __asm__ ("abc incl    %0" : "+r" (X));
           ^
2 diagnostics generated.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100608 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 05:46:54 +00:00
Zhongxing Xu 74626d6ef2 Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100604 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 04:40:26 +00:00
Ted Kremenek 2dce0c40f5 Update checker build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100603 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 04:09:49 +00:00
Jeffrey Yasskin 595f2698fe Deprecate CXXScopeSpec::isSet() in favor of isNotEmpty() or isValid().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100600 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 01:55:59 +00:00
John McCall 3aae6093dd Teach -Wsign-compare to treat 1 << blah as "idiomatically non-negative".
Fixes a spurious warning in LLVM.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100595 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 01:14:35 +00:00
Ted Kremenek 974d97b251 Fix crash in StoreManager::CastRegion() when the base region is a type with 0 size.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100594 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 00:46:49 +00:00
John McCall c91cc66e92 Check access for the implicit calls to destructors that occur when we
have a temporary object in C++.

Also fix a tag mismatch that Doug noticed.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100593 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 00:41:46 +00:00
Ted Kremenek 5dbacb4179 Fix CIndex crash on invalid code reported in <rdar://problem/7833619>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100589 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 00:27:13 +00:00
Fariborz Jahanian e9f5581ad4 Improve on diagnostics when an objc class is used as
a stand-alone type declaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100588 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 00:22:00 +00:00
Douglas Gregor e8f5a1710a Implement code completion for Objective-C method declarations and
definitions, e.g., after 

  -

or

  - (id)

we'll find all of the "likely" instance methods that one would want to
declare or define at this point. In the latter case, we only produce
results whose return types match "id".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100587 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 00:21:17 +00:00
Fariborz Jahanian dba0b0b876 Minor clean up.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100583 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 23:43:59 +00:00
Fariborz Jahanian 2846b2b470 default access for synthesize ivar is @protect.
Fixes radar 7823675.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100582 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 23:36:17 +00:00
Fariborz Jahanian 0bd04596e4 Patch to not build ivar ASTs when they are ilegally
declared in categories.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100577 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 22:43:48 +00:00
John McCall 209acbd6d0 Devote a special diagnostic to the typo
(void*) someFunction(5, 10, 15, 20);
where the cast is presumably meant to be to 'void'.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100574 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 22:24:14 +00:00
Ted Kremenek 68b9a599dd Teach MemRegion::getBaseRegion() about ObjCIvarRegions. We want to treat
them the same way as fields.  This fixes a regression in RegionStore::RemoveDeadbindings()
that emerged from going to the cluster-based analysis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100570 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 22:06:03 +00:00
John McCall 161755a098 Implement the protected access restriction ([class.protected]), which requires
that protected members be used on objects of types which derive from the
naming class of the lookup.  My first N attempts at this were poorly-founded,
largely because the standard is very badly worded here.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100562 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 21:38:20 +00:00
Douglas Gregor 2e4c7a5865 When code completion produces an overload set as its results (e.g.,
while we're completing in the middle of a function call), also produce
"ordinary" name results that show what can be typed at that point.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100558 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 20:19:47 +00:00
Douglas Gregor fe0bdba446 Do not produce semicolons at the end of code-completion results
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100557 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 20:11:37 +00:00
Douglas Gregor 2f880e47ca Only prove macros as code-completion results when we're in a case
statement or for ordinary names. This means that we won't show macros
when completing, e.g., member expressions such as "p->".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100555 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 20:02:15 +00:00
Ted Kremenek 2aefcb2e8b Fix ccc-analyzer's handling of quoted arguments in the build command. Fixes PR 6791.[B
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100551 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 19:41:24 +00:00
Douglas Gregor 22f569918d When sending a message to "id", apply some heuristics to try to narrow
down the set of code-completion results based on Objective-C
conventions. 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100548 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 19:22:33 +00:00
Chris Lattner 914803f5d5 add a testcase that the integrated assembler rejects, this verifies
that the integrated assembler is working.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100545 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 18:46:25 +00:00
Chris Lattner 6da9eb6616 teach clang to install the inline asm diagnostic handler,
allowing backend errors to be mapped through clang's 
diagnostics subsystem, including the backend location info.

We now get:

$ clang asm.c -c -o t.o -integrated-as
<inline asm>:1:2: error: unrecognized instruction
        abc incl    %eax
        ^
1 diagnostic generated.

With colors, and correct "# diagnostics generated".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100543 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 18:38:50 +00:00
Chris Lattner cabae68037 reduce indentation, tidy.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100537 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 17:52:14 +00:00
Blaine Garst 69ecbdbe7a improved wording around ABI
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100536 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 17:46:43 +00:00
Douglas Gregor 719770dcfc Make code-completion for Objective-C message sends to "id" work in the
presence of precompiled headers by forcibly loading all of the
methods we know about from the PCH file before constructing our
code-completion list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100535 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 17:30:22 +00:00
Chris Lattner 52d9ae3220 fit in 80 cols
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100534 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 17:29:22 +00:00
Fariborz Jahanian a98344869c Put type restriction on convesion to nonconforming 'id' back in
block pointer type comparison.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100533 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 17:23:39 +00:00
Daniel Dunbar 60a53f24b1 Driver: Add a Tool::hasGoodDiagnostics hook, and use it to simplify logic for
deciding when we need to emit an extra "command failed" diagnostic.
 - This also fixes the case where we were emitting that extra diagnostics, even
   when using clang w/ the integrated assembler, which has good diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100529 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 17:07:49 +00:00
Douglas Gregor 13438f9b9c Implement support for code completion of an Objective-C message send to
"id" or an expression of type "id". In these cases, we produce a list
of all of the (class or instance) methods, respectively, that we know about.

Note that this implementation does not yet work well with precompiled
headers; that's coming soon.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100528 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 16:40:00 +00:00
Douglas Gregor 85372b93d1 Add test for code completion of Objective-C message sends to classes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100527 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 15:27:03 +00:00
Douglas Gregor 64538cfd34 Perform code-completion within ParseCastExpression, which handles,
e.g., the right-hand side of binary expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100526 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 15:09:27 +00:00
Douglas Gregor 7969f936a1 clang-wpa fixes for Diagnostic
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100518 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 04:03:12 +00:00
Zhongxing Xu 7f330856b8 Fix PR 6725. It looks like the copy constructor gets elided during inlining.
This bug only shows up with GCC 4.4.1 Release-Asserts build.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100516 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 03:01:56 +00:00
Douglas Gregor f45d67364e Unbreak build
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100514 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 01:25:58 +00:00
Daniel Dunbar efbf487da8 IRgen: Move BitFieldIsSigned bit into CGBitFieldInfo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100513 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 01:07:44 +00:00
Daniel Dunbar c7a984af71 Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100512 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 01:07:41 +00:00
Daniel Dunbar 8bea3efe46 Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100511 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 01:07:39 +00:00
Douglas Gregor 28019772db Make Diagnostic reference-counted, which is simpler than juggling
maybe-ownership vs. ownership.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100498 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 23:52:57 +00:00
Ted Kremenek e9686572f1 Use cast<> + OpaquePtr.getAs<Decl> to add extra checking of our assumptions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100496 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 23:45:09 +00:00
Chris Lattner 01ae93fde8 inline in MC assembly parsers. clang -integrated-as now
works with inline asm!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100493 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 23:33:20 +00:00
Chris Lattner a0a270c0f1 Match MemoryBuffer API changes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100484 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 22:42:27 +00:00
Ted Kremenek 5fcd52a6c9 Fix possible null dereference by bailing out of CheckObjCPropertyAttributes() early if the Decl* is null.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100483 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 22:39:42 +00:00