Commit Graph

39198 Commits

Author SHA1 Message Date
Richard Smith 0bf93aa6b1 Fix OverloadCandidateSet::clear to not leak PartialDiagnostics, found by Samuel
Panzer. I've not been able to trigger a failure caused by this, so no test yet.
Also included is a small change from Paul Robinson to only consider the
FailureKind if the overload candidate did actually fail.

llvm-svn: 160470
2012-07-18 23:52:59 +00:00
Dmitri Gribenko c16cd2a67b Comment::dump(): show name of inline command
llvm-svn: 160467
2012-07-18 23:20:23 +00:00
Dmitri Gribenko e4a3997d70 Comment parsing: don't parse whitespace before \endverbatim as a separate line of whitespace.
llvm-svn: 160464
2012-07-18 23:01:58 +00:00
Aaron Ballman 462bb9fdf6 Rolling this change back because the fix doesn't fit the symptoms (even if it solves them).
llvm-svn: 160462
2012-07-18 22:38:11 +00:00
Jordan Rose 627b046c88 [analyzer] Combine all ObjC message CallEvents into ObjCMethodCall.
As pointed out by Anna, we only differentiate between explicit message sends

This also adds support for ObjCSubscriptExprs, which are basically the same
as properties in many ways. We were already checking these, but not emitting
nice messages for them.

This depends on the llvm::PointerIntPair change in r160456.

llvm-svn: 160461
2012-07-18 21:59:51 +00:00
Jordan Rose 9003d0d02f [analyzer] Rename addExtraInvalidatedRegions to get...Regions
Per Anna's comment that "add..." sounds like a method that modifies
the receiver, rather than its argument.

No functionality change.

llvm-svn: 160460
2012-07-18 21:59:46 +00:00
Jordan Rose 59e6ce922c [analyzer] Make CallEvent a value object.
We will need to be able to easily reconstruct a CallEvent from an ExplodedNode
for diagnostic purposes, and that's exactly what factory functions are for.
CallEvent objects are small enough (four pointers and a SourceLocation) that
returning them through the stack is fairly cheap. Clients who just need to use
existing CallEvents can continue to do so using const references.

This uses the same sort of "kind-field-dispatch" as SVal, though most of the
nastiness is contained in the DISPATCH and DISPATCH_ARG macros at the end of
the file. (We can't use a template for this because member-pointers to base
class methods don't call derived-class methods even when casting to the
derived class. We can't use variadic macros because they're a C99 feature.)

llvm-svn: 160459
2012-07-18 21:59:41 +00:00
Jordan Rose 074ebb3a6f [analyzer] Remove obsolete ObjCPropRef SVal kind.
ObjC properties are handled through their semantic form of ObjCMessageExprs
and their wrapper PseudoObjectExprs, and have been for quite a while. The
syntactic ObjCPropertyRefExprs do not appear in the CFG and are not visited
by ExprEngine.

No functionality change.

llvm-svn: 160458
2012-07-18 21:59:37 +00:00
Jordan Rose be25b07f67 [analyzer] Remove unused ExprEngine::VisitCXXTemporaryObjectExpr.
llvm-svn: 160457
2012-07-18 21:59:23 +00:00
Aaron Ballman 68777ac253 Fixing up a test case that was failing due to the lack of -std=c++11
llvm-svn: 160455
2012-07-18 21:56:43 +00:00
Dmitri Gribenko b03cc7e9f4 This fits into 80 columns without wrapping.
llvm-svn: 160453
2012-07-18 21:27:38 +00:00
Dmitri Gribenko 05c3c75581 Add caching for TextComment::isWhitespace(), ParagraphComment::isWhitespace().
llvm-svn: 160452
2012-07-18 20:54:32 +00:00
Benjamin Kramer e6f7008534 Remove trivial destructor from SVal.
This enables the faster SmallVector in clang and also allows clang's unused
variable warnings to be more effective. Fix the two instances that popped up.

The RetainCountChecker change actually changes functionality, it would be nice
if someone from the StaticAnalyzer folks could look at it.

llvm-svn: 160444
2012-07-18 19:08:44 +00:00
Dmitri Gribenko 761447cd98 On Darwin, the linker removes functions in CommentDumper.o (Comment::dump())
despite __attribute__(__used__).  As explained by Argyrios,
> .a archive files do some stripping of their own and they remove .o files that
> contain functions that are not referenced by any other .o file.

The fix is to use these functions from another .o file.

Thanks, Argyrios!

llvm-svn: 160437
2012-07-18 16:30:42 +00:00
Alexander Kornienko df36746d52 Reverted custom init hook from r160369.
llvm-svn: 160432
2012-07-18 12:24:51 +00:00
Ted Kremenek 46dcfc9431 Fix crash in RegionStoreManager::evalDerivedToBase() due to not handling references
(in uses of dynamic_cast<>).

Fixes <rdar://problem/11817693>.

llvm-svn: 160427
2012-07-18 05:57:33 +00:00
Ted Kremenek 3d6177306b Teach CFG construction about destructors resulting from references to array types. Fixes crash in <rdar://problem/11671507>.
llvm-svn: 160424
2012-07-18 04:57:57 +00:00
Richard Smith af136f8191 PR13381, part 2: when determining if a defaulted special member function should
be defined as deleted, take cv-qualifiers on class members into account when
looking up the copy or move constructor or assignment operator which will be
used for them.

llvm-svn: 160418
2012-07-18 03:51:16 +00:00
Richard Smith 1c6461ef63 PR13381: consider cv-qualifiers on a class member's type when determining which
constructor will be used for moving that object, in the computation of its
exception specification.

llvm-svn: 160417
2012-07-18 03:36:00 +00:00
Richard Smith 198223b7e6 PR13386: When matching up parameters between a function template declaration
and a function template instantiation, if there's a parameter pack in the
declaration and one at the same place in the instantiation, don't assume that
the pack wasn't expanded -- it may have expanded to nothing. Instead, go ahead
and check whether the parameter pack was expandable. We can do this as a
side-effect of the work we'd need to do anyway, to find how many parameters
were produced.

llvm-svn: 160416
2012-07-18 01:29:05 +00:00
Eli Friedman ea90a40339 Fix test so it works the same way on 32-bit and 64-bit.
llvm-svn: 160415
2012-07-18 01:03:11 +00:00
Dmitri Gribenko 3100519b33 CommentSema: \short is the same as \brief.
llvm-svn: 160414
2012-07-18 00:44:55 +00:00
Douglas Gregor a906ad2f9e When performing the deduced/actual argument type check for C++
[temp.deduct.call]p4 under Objective-C++ ARC, make sure to adjust the
qualifiers to introduce the implicit strong lifetime when
needed. Fixes <rdar://problem/11825671>.

llvm-svn: 160412
2012-07-18 00:14:59 +00:00
Joel Jones 682150364a More replacing of target-dependent intrinsics with target-indepdent
intrinsics.  The second instruction(s) to be handled are the vector versions 
of count set bits (ctpop).

The changes here are to clang so that it generates a target independent 
vector ctpop when it sees an ARM dependent vector bits set count.  The changes 
in llvm are to match the target independent vector ctpop and in 
VMCore/AutoUpgrade.cpp to update any existing bc files containing ARM 
dependent vector pop counts with target-independent ctpops.  There are also 
changes to an existing test case in llvm for ARM vector count instructions and 
to a test for the bitcode upgrade.

<rdar://problem/11892519>

There is deliberately no test for the change to clang, as so far as I know, no
consensus has been reached regarding how to test neon instructions in clang;
q.v. <rdar://problem/8762292>

llvm-svn: 160409
2012-07-18 00:01:03 +00:00
Douglas Gregor 951de307e4 Remove unnecessary spacing around Objective-C object literal code
completions. Fixes <rdar://problem/11889572>.

llvm-svn: 160407
2012-07-17 23:24:47 +00:00
Aaron Ballman 8f94ac6922 Adding a fixit for includes that cannot be found with angle brackets, but can be found with quoted strings instead. Implements PR13201.
llvm-svn: 160406
2012-07-17 23:19:16 +00:00
Douglas Gregor 4b12ba0ce6 Improve comment for TypeDecl::getTypeForDecl(), from Sean Silva!
llvm-svn: 160405
2012-07-17 23:09:36 +00:00
Douglas Gregor 6bdb8daa76 Eliminating the GCC_CAST hack, take two.
llvm-svn: 160404
2012-07-17 23:07:44 +00:00
Dmitri Gribenko 9fa677c5ce Comment AST nodes: rename Num*Bitfields to Num*Bits to be consistent with Stmt AST nodes.
llvm-svn: 160402
2012-07-17 22:43:26 +00:00
Douglas Gregor 9db5e14349 Reinstate the GCC_CAST hack; I apparently did not appease GCC with r160397.
llvm-svn: 160401
2012-07-17 22:32:15 +00:00
Dmitri Gribenko 82ea947018 Implement an optimization for finding the comment that occurs just after a
given declaration.

It is based on the observation that during parsing the comment that should be
attached to the decl is usually among the last two documentation comments
parsed.

llvm-svn: 160400
2012-07-17 22:01:09 +00:00
Eric Christopher 8b808c0c3d Robustify test in the face of no assertions.
llvm-svn: 160399
2012-07-17 21:52:07 +00:00
Douglas Gregor 0ea5a97dbb Try to eliminate GCC_CAST hack in a manner that should work for both
GCC and MSVC.

llvm-svn: 160397
2012-07-17 21:27:49 +00:00
Dmitri Gribenko c4eb9752d4 CommentBriefParser: use StringSwitch::Cases to group synonyms. Thanks Jordan!
llvm-svn: 160396
2012-07-17 21:21:55 +00:00
Douglas Gregor dd6006f365 Teach the ASTImporter how to handle anonymous structs/unions
better. Fixes <rdar://problem/11466212>; the test (and back-ported
version of this code) were committed to LLDB in r160186.

llvm-svn: 160395
2012-07-17 21:16:27 +00:00
Eli Friedman 4eafb6b77b Don't treat overflow in floating-point conversions as a hard error in constant evaluation. <rdar://problem/11874571>.
llvm-svn: 160394
2012-07-17 21:03:05 +00:00
Rafael Espindola 60a2bba976 Handle the case where the base type is not dependent, but the derived one is.
Fixes pr13353.cpp.

llvm-svn: 160393
2012-07-17 20:24:05 +00:00
Joao Matos 718a883c5f Fixed whitespace issue introduced in r160373.
llvm-svn: 160388
2012-07-17 19:17:58 +00:00
Dmitri Gribenko 831c1e0819 Minor cleanups and additions to the users manual. UsersManual.html now validates as HTML 4.01 Strict.
Patch by Jonathan Sauer!  (With minor edits from me.)

llvm-svn: 160386
2012-07-17 18:51:47 +00:00
Eric Christopher 0cd70b84e2 Fix regexp for this test to properly check.
Patch by Eli Bendersky.

llvm-svn: 160385
2012-07-17 18:40:46 +00:00
Dmitri Gribenko 3e242d6d3c CommentBriefParser: make \short should equivalent to \brief, per Doxygen manual.
llvm-svn: 160383
2012-07-17 18:35:14 +00:00
Fariborz Jahanian 268fec1e2e Issue warning when assigning out-of-range integer values to enums.
Due to performance cost, this is an opt-in option placed
under -Wassign-enum. // rdar://11824807

llvm-svn: 160382
2012-07-17 18:00:08 +00:00
Jordan Rose 63ffaa8c18 -Wobjc-literal-compare: don't warn when comparing against nil.
Checks against nil often appear as guards in macros, and comparing
Objective-C literals to nil has well-defined behavior (if tautological).

On OS X, 'nil' has not been typed as 'id' since 10.6 (possibly earlier),
so the warning was already not firing, but other runtimes continue to use
((id)0) or some variant. This change accepts comparisons to any null pointer;
to keep it simple, it looks through all casts (not just casts to 'id').

PR13276

llvm-svn: 160379
2012-07-17 17:46:48 +00:00
Jordan Rose ea70bf7154 Add -Wobjc-string-compare under -Wobjc-literal-compare.
Suggested by Ted, since string literal comparison is at least slightly more
sensible than comparison of runtime literals. (Ambiguous language on
developer.apple.com implies that strings are guaranteed to be uniqued within
a translation unit and possibly across a linked binary.)

llvm-svn: 160378
2012-07-17 17:46:44 +00:00
Jordan Rose 7660f78fb9 Now that -Wobjc-literal-compare is a warning, put the fixit on a note.
Recovering as if the user had actually called -isEqual: is a bit too far from
the semantics of the program as written, /even though/ it's probably what they
intended.

llvm-svn: 160377
2012-07-17 17:46:40 +00:00
Jordan Rose c4e9d56268 [analyzer] Remove stale result type lvalue code.
This code has been moved around multiple times, but seems to have been
obsolete ever since we started handled references like pointers.

llvm-svn: 160375
2012-07-17 17:27:10 +00:00
Joao Matos 2ce88ef9a7 [Windows] Abstract pure virtual method calls in the ABI. Fix the Windows ABI to forward to the correct function.
llvm-svn: 160373
2012-07-17 17:10:11 +00:00
Alexander Kornienko 11330dc726 Add a custom initialize hook for clang tools + minor fixes in CustomCompilationDatabase.h
llvm-svn: 160369
2012-07-17 16:11:17 +00:00
Rafael Espindola e3a14bb95b Merge visibility from previous decls before looking at visibility pragma. This
is a bit fuzzy, but matches gcc behavior and existing code bases seem to
depend on it.

llvm-svn: 160364
2012-07-17 15:14:47 +00:00
NAKAMURA Takumi 878f1445f9 test/Driver/crash-report.c: Remove "REQUIRES: shell". env(1) can be used also with gnuwin32.
llvm-svn: 160362
2012-07-17 12:00:24 +00:00
Daniel Jasper ef23e2053b Fix unit test dependency in Makefile and remove unneccessary dependency
again.

llvm-svn: 160358
2012-07-17 09:12:33 +00:00
Daniel Jasper 27c163b6ca Add missing dependency for unit test.
llvm-svn: 160356
2012-07-17 08:49:28 +00:00
Daniel Jasper 6389dd145d Finishing the move of RefactoringCallbacks and fixing the corresponding
buildbot failures.

llvm-svn: 160355
2012-07-17 08:37:03 +00:00
Simon Atanasyan 94a6d863a9 Revert commit r160308. We decide to move builtins selection to the backend.
llvm-svn: 160353
2012-07-17 08:15:06 +00:00
Daniel Jasper 1975e03494 Move RefactoringCallbacks to Tooling to avoid dependency from
ASTMatchers (lower level abstraction) to Tooling (higher level
abstraction).

llvm-svn: 160351
2012-07-17 08:03:01 +00:00
Alexey Samsonov 1ad8e98298 Fixup for r160345 - uintptr_t is not always unsigned
llvm-svn: 160349
2012-07-17 07:46:40 +00:00
Daniel Jasper 2b3c7d414b Make the isDerivedFrom matcher more generic.
It now accepts an arbitrary inner matcher but is fully backwards
compatible.

llvm-svn: 160348
2012-07-17 07:39:27 +00:00
Galina Kistanova a9151076a4 Fixed few warnings.
llvm-svn: 160345
2012-07-17 06:25:13 +00:00
NAKAMURA Takumi ed5bbe9020 [Win32] Rework crash-report since r145389.
- lib/Driver/Driver.cpp, tools/driver/driver.cpp: Exit status should not be propagated, although clang driver should catch exceptions.
  - test/Driver/crash-report.c: Add REQUIRES:shell for now.
    FIXME: setenv should work also on Lit.InternalShellRunner.
  - test/Driver/crash-report.c: Remove XFAIL.

Thanks to Chad, To point out the issue.

llvm-svn: 160343
2012-07-17 05:09:29 +00:00
NAKAMURA Takumi 78c0295fcf test/Driver/crash-report.c: Small tweaks. 1) Use %t instead %T for TMP. 2) Set all of $TMPDIR, $TEMP and $TMP, or a certain host might set $TEMP.
llvm-svn: 160342
2012-07-17 05:09:20 +00:00
Rafael Espindola f97c636812 Record visibility pragmas when we see a tag declaration. We might use it
to build a type before seeing the definition.

llvm-svn: 160339
2012-07-17 04:22:25 +00:00
Richard Smith b21dd02e61 Uninitialized variables: two little changes:
* Treat compound assignment as a use, at Jordy's request.
 * Always add compound assignments into the CFG, so we can correctly diagnose the use in 'return x += 1;'

llvm-svn: 160334
2012-07-17 01:27:33 +00:00
NAKAMURA Takumi b7fa0d58fa clang/test/Tooling/clang-ast-dump.cpp: Mark it as REQUIRES: asserts, for now.
llvm-svn: 160332
2012-07-17 00:33:36 +00:00
Dmitri Gribenko f290b0d137 Move clang_Cursor_getBriefCommentText implementation under `extern "C"'.
llvm-svn: 160331
2012-07-17 00:17:45 +00:00
Richard Smith 6376d1fd9c -Wuninitialized: Split the classification of DeclRefExprs as initialization or
use out of TransferFunctions, and compute it in advance rather than on-the-fly.

This allows us to handle compound assignments with DeclRefExprs on the RHS
correctly, and also makes it trivial to treat const& function parameters as not
initializing the argument. The patch also makes both of those changes.

llvm-svn: 160330
2012-07-17 00:06:14 +00:00
Jordan Rose 5089f3b398 [analyzer] Handle new-expressions with initializers for scalars.
<rdar://problem/11818967>

llvm-svn: 160328
2012-07-16 23:38:09 +00:00
Jordan Rose aa9f35a6b6 Weaken Unicode fixit test to work even if the character is printed escaped.
This should fix the failure on Windows.

llvm-svn: 160324
2012-07-16 22:18:33 +00:00
Dmitri Gribenko a0473ab8bc Fix BlockCommandComment::classof() to return true for objects of derived classes.
llvm-svn: 160323
2012-07-16 22:13:46 +00:00
Ted Kremenek a0d18e51f9 This test appears to fail on win32.
llvm-svn: 160322
2012-07-16 21:43:16 +00:00
Ted Kremenek 4abbade558 Add hack (provided by Jonathan Sauer) to fall back to assuming Xcode is installed in /Developer
when using Python < 2.7.0.  This is the case on Snow Leopard, where the tools are always
installed in /Developer.  This isn't a proper fix for really figuring out where Xcode
is installed, but should work to fix an obvious problem on Snow Leopard.

llvm-svn: 160321
2012-07-16 21:39:29 +00:00
Ted Kremenek cf74cef104 This test appears to be passing on win32.
llvm-svn: 160320
2012-07-16 21:17:01 +00:00
Jordan Rose fb12a53d5d Don't crash when emitting fixits following Unicode characters.
This code is very sensitive to the difference between "columns" as printed
and "bytes" (SourceManager columns). All variables are now named explicitly
and our assumptions are (hopefully) documented as both comment and assertion.

Whether parseable fixits should use byte offsets or Unicode character counts
is pending discussion on the mailing list; currently the implementation uses
bytes (and has no problems on lines containing multibyte characters).
This has been added to the user manual.

<rdar://problem/11877454>

llvm-svn: 160319
2012-07-16 20:52:12 +00:00
David Blaikie 1f4ff15c91 Simplify float comparison checks by using early return.
Found while investigating PR13330

llvm-svn: 160318
2012-07-16 20:47:22 +00:00
Ted Kremenek 816255dc39 Fix copy-paste mistake for CMake dependency.
llvm-svn: 160315
2012-07-16 20:22:15 +00:00
Anna Zaks 9b7d7140ef [analyzer] Make CmpRuns external-user friendly.
CmpRuns can be used for static analyzer bug report comparison. However,
we want to make sure external users do not rely on the way bugs are
represented (plist files). Make sure that we have a user
friendly/documented API for CmpRuns script.

llvm-svn: 160314
2012-07-16 20:21:42 +00:00
Ted Kremenek 42bff962b6 Looks like libTooling might also depend on ClangDiagnosticCommon.
llvm-svn: 160313
2012-07-16 19:44:15 +00:00
Ted Kremenek 25bdee6b5b Add libEdit dependency on ClangDiagnosticCommon. Hopefully this will unbreak the VS build.
llvm-svn: 160309
2012-07-16 18:53:42 +00:00
Simon Atanasyan a06d06b660 MIPS: Implement __builtin_mips_shll_qb builtin function overloading.
This function has two versions. The first one is used for a register operand.
The second one is used for an immediate number.

llvm-svn: 160308
2012-07-16 18:52:02 +00:00
David Blaikie 5a0956e98d Fix rejects-valid: explicit specialization of redeclared deleted function template.
Review by Richard Smith.

llvm-svn: 160306
2012-07-16 18:50:45 +00:00
Fariborz Jahanian 6c7dbf5858 modern objective-c translator: conditionally include
<string.h>. // rdar://11847319

llvm-svn: 160287
2012-07-16 16:21:45 +00:00
Aaron Ballman 1206a91155 Fixing an MSVC warning -- the compiler did not like the cast added to work around a g++ bug (it would claim to possibly emit incorrect code).
llvm-svn: 160281
2012-07-16 15:45:33 +00:00
Alexander Kornienko 277f6cf805 Fixing an obvious bug in a test.
llvm-svn: 160268
2012-07-16 13:31:37 +00:00
Alexander Kornienko f2f82550fd The new clang-ast-dump tool for selective AST dumping. Moved common command-line tool stuff to CommandLineClangTool
llvm-svn: 160265
2012-07-16 12:46:48 +00:00
Daniel Jasper b45e7e9191 Add two more missing parameters in diagnostics.
llvm-svn: 160264
2012-07-16 12:12:45 +00:00
Daniel Jasper 1c2f27c062 Fix diagnostic adding missing parameter.
llvm-svn: 160263
2012-07-16 11:51:49 +00:00
Daniel Jasper 6b5a4fcc07 Prevent unused-variable warning in optimized builds.
llvm-svn: 160257
2012-07-16 10:25:15 +00:00
Daniel Jasper 7e22282b68 Add refactoring callbacks to make common kinds of refactorings easy.
llvm-svn: 160255
2012-07-16 09:18:17 +00:00
Daniel Jasper 3e1a9cf3b8 Add correct parenthesis range to CXXConstructExprs inside
CXXFunctionalCastExprs.

llvm-svn: 160252
2012-07-16 08:05:07 +00:00
Ted Kremenek a8c2c10f16 Place checker build at alternate URL.
llvm-svn: 160247
2012-07-16 04:18:35 +00:00
Richard Smith 3beb930cfd More for PR11848: a pack expansion type isn't necessarily type-dependent (its
pattern might be an alias template which doesn't use its arguments). It's always
instantiation-dependent, though.

llvm-svn: 160246
2012-07-16 01:59:26 +00:00
Richard Smith 8093465a0b PR13365: Fix code which was trying to treat an array of DeducedTemplateArgument
as an array of its base class TemplateArgument. Switch the const
TemplateArgument* parameters of InstantiatingTemplate's constructors to
ArrayRef<TemplateArgument> to prevent this from happening again in the future.

llvm-svn: 160245
2012-07-16 01:09:10 +00:00
Richard Smith 68eea507fa Related to PR11848 and core-21989: switch ContainsUnexpandedParameterPack from
being a property of a canonical type to being a property of the fully-sugared
type. This should only make a difference in the case where an alias template
ignores one of its parameters, and that parameter is an unexpanded parameter
pack.

llvm-svn: 160244
2012-07-16 00:20:35 +00:00
Richard Smith 9db53d7d68 Revert change accidentally committed in r160240.
llvm-svn: 160241
2012-07-15 23:30:50 +00:00
Richard Smith 7dfc0240ea PR13368: Halve the instantiation depth of this test again. Apparently, FreeBSD
has a much lower default stack limit than the systems I have access to.

llvm-svn: 160240
2012-07-15 23:29:50 +00:00
Chandler Carruth cc8f2a6ab5 Update Clang to reflect the move of MDBuilder in r160237.
llvm-svn: 160238
2012-07-15 23:28:01 +00:00
David Chisnall d5ca836c01 Add test case for tweaks to clang driver.
llvm-svn: 160236
2012-07-15 21:18:01 +00:00
Daniel Jasper 84c763edbe Fix spelling of anyOf matcher and add missing test.
Patch by Sam Panzer!

llvm-svn: 160233
2012-07-15 19:57:12 +00:00
David Chisnall df3045f0e3 Enable new linker behaviour on FreeBSD.
llvm-svn: 160231
2012-07-15 12:53:06 +00:00
Rafael Espindola faf556b745 Without this patch clang warns on
struct __attribute__((visibility("hidden"))) zed {
};
struct __attribute__((visibility("hidden"))) zed;

Which is a bit silly and got a lot noisier now that we correctly handle
visibility pragmas. This patch fixes that and also has some extra quality
improvements:

* We now produce an error instead of a warning for

struct __attribute__((visibility("hidden"))) zed {
};
struct __attribute__((visibility("default"))) zed;

* The "after definition" warning now points to the new attribute that is
  ignored instead of pointing to the declaration.

llvm-svn: 160227
2012-07-15 01:33:40 +00:00
Rafael Espindola a5bba70c9c Make const the argument of getDefinition.
llvm-svn: 160226
2012-07-15 01:05:36 +00:00
Eric Christopher 11d08bd931 Use llvm::APSInt::isSameValue to compare for the same value.
Finishes rdar://11875995

llvm-svn: 160225
2012-07-15 00:24:00 +00:00
Eric Christopher 6dcc3762a0 Replace IsSameValue with the llvm::APSInt/llvm::APInt versions
that we just copied from here and replace all uses.

Part of rdar://11875995

llvm-svn: 160224
2012-07-15 00:23:57 +00:00
Eric Christopher 934a1c0231 Capitalize comment.
llvm-svn: 160220
2012-07-14 19:29:12 +00:00
Ted Kremenek b50e716bac Refine CFG so that '&&' and '||' don't lead to extra confluence points when used in a branch, but
instead push the terminator for the branch down into the basic blocks of the subexpressions of '&&' and '||'
respectively.  This eliminates some artifical control-flow from the CFG and results in a more
compact CFG.

Note that this patch only alters the branches 'while', 'if' and 'for'.  This was complex enough for
one patch.  The remaining branches (e.g., do...while) can be handled in a separate patch, but they
weren't immediately tackled because they were less important.

It is possible that this patch introduces some subtle bugs, particularly w.r.t. to destructor placement.
I've tried to audit these changes, but it is also known that the destructor logic needs some refinement
in the area of '||' and '&&' regardless (i.e., their are known bugs).

llvm-svn: 160218
2012-07-14 05:04:10 +00:00
Ted Kremenek a16436f51e Hoist CFG builder logic for '&&' and '||' into helper method. No funcationlity change.
llvm-svn: 160217
2012-07-14 05:04:06 +00:00
Ted Kremenek e86723866d Remove unused method declaration.
llvm-svn: 160216
2012-07-14 05:04:04 +00:00
Ted Kremenek 6f40024d9e Sort prototypes. No functionality change.
llvm-svn: 160215
2012-07-14 05:04:01 +00:00
Richard Trieu c22e8d1192 Update Sema diagnostic messages to take advantage of template type diffing.
llvm-svn: 160210
2012-07-14 00:49:02 +00:00
Chad Rosier cc40ea7f9a Add a per target max vector alignment field (e.g., 32-byte alignment for x86 due to
AVX).  Currently, if no aligned attribute is specified the alignment of a vector is
inferred from its size.  Thus, very large vectors will be over-aligned with no 
benefit.  Target owners should set this target max.

llvm-svn: 160209
2012-07-13 23:57:43 +00:00
Richard Smith 130b8d4e97 PR13360: When deciding the earliest point which inevitably leads to an
uninitialized variable use, walk back over branches where we've reached all the
non-null successors, not just cases where we've reached all successors.

llvm-svn: 160206
2012-07-13 23:33:44 +00:00
Rafael Espindola 5cc7890cac Move option test earlier in the function.
llvm-svn: 160202
2012-07-13 23:26:43 +00:00
Joel Jones 3e00e9d5c1 This is one of the first steps at moving to replace target-dependent
intrinsics with target-indepdent intrinsics.  The first instruction(s) to be 
handled are the vector versions of count leading zeros (ctlz).

The changes here are to clang so that it generates a target independent 
vector ctlz when it sees an ARM dependent vector ctlz.  The changes in llvm 
are to match the target independent vector ctlz and in VMCore/AutoUpgrade.cpp 
to update any existing bc files containing ARM dependent vector ctlzs with 
target-independent ctlzs.  There are also changes to an existing test case in 
llvm for ARM vector count instructions and a new test for the bitcode upgrade.

<rdar://problem/11831778>

There is deliberately no test for the change to clang, as so far as I know, no
consensus has been reached regarding how to test neon instructions in clang;
q.v. <rdar://problem/8762292>

llvm-svn: 160201
2012-07-13 23:26:27 +00:00
Dmitri Gribenko 7594b8f618 Comment.h: reword comments
llvm-svn: 160197
2012-07-13 22:36:49 +00:00
Richard Trieu a4056004bf Modify tree printing mode for template type diffing. If a diagnostic has
multiple %diff's, only print the first tree and fallback to inline printing
for the rest of the diagnostic.

llvm-svn: 160193
2012-07-13 21:18:32 +00:00
Nuno Lopes e61e9dbf73 add support for conditional expressions in Expr::HasSideEffects()
This fixes a bug in __builtin_object_size() codegen

llvm-svn: 160191
2012-07-13 20:48:52 +00:00
Tanya Lattner 72db6d04e1 Move a bunch of the attribute warnings under the IgnoreAttributes group. Cleaned up test case.
llvm-svn: 160190
2012-07-13 20:45:35 +00:00
Dmitri Gribenko 619e75eb96 Comment AST nodes: rename getXXXCount() methods to getNumXXXs() to be in line with Statement AST nodes.
llvm-svn: 160182
2012-07-13 19:02:42 +00:00
Rafael Espindola 385c04269f Apply visibility pragmas to class template declarations. This is needed because
we might use the declaration to build a type before seeing the definition.

llvm-svn: 160176
2012-07-13 18:04:45 +00:00
Rafael Espindola c7c7ad5f7e Use -fvisibility-inlines-hidden in inline functions too. This matches gcc
behavior since gcc pr30066. Thanks to Benjamin Kramer for pointing it out.

llvm-svn: 160174
2012-07-13 14:25:36 +00:00
Benjamin Kramer 7ca3b7c977 Move helper class into an anonymous namespace.
llvm-svn: 160172
2012-07-13 13:25:11 +00:00
Hans Wennborg 04f5eacaf4 Mention -ftls-model in release notes and manual.
llvm-svn: 160169
2012-07-13 12:47:15 +00:00
Manuel Klimek 60b8016197 Allows retrieving all files in a CompilationDatabase.
Patch by Tobias Koenig, some test changes by myself.

llvm-svn: 160167
2012-07-13 12:31:45 +00:00
Richard Smith 57e7ff9c0c Provide a special-case diagnostic when two class member functions instantiate
to the same signature. Fix a bug in the type printer which would cause this
diagnostic to print wonderful types like 'const const int *'.

llvm-svn: 160161
2012-07-13 04:12:04 +00:00
Rafael Espindola eca5cd20a1 Fix a bug in my previous commit. The problem is not that we were not using the
canonical decl for the template, but that we were not merging attributes for
templates at all!

llvm-svn: 160157
2012-07-13 01:19:08 +00:00
Dmitri Gribenko e7bb944c85 Attaching comments to declarations during parsing: handle more Objective-C declarations.
llvm-svn: 160156
2012-07-13 01:06:46 +00:00
Dmitri Gribenko e00ffc7bb8 Comment parsing: repaint the bikesched: rename 'HTML open tags' to 'HTML start tags' and 'HTML close tags' to 'HTML end tags' according to HTML spec.
llvm-svn: 160153
2012-07-13 00:44:24 +00:00
Dmitri Gribenko 9460fbf219 Make concepts of optional and forbidden end tags separate. Thanks Jordan for pointing this!
llvm-svn: 160149
2012-07-12 23:37:09 +00:00
Rafael Espindola 6140847647 Use the canonical template decl when trying to find if it has a visibility
attribute.

llvm-svn: 160139
2012-07-12 20:05:04 +00:00
Manuel Klimek 05b56315d5 Updates the example to the latest incarnation of clang-check and
adds a paragraph on builtin headers.

llvm-svn: 160138
2012-07-12 18:32:50 +00:00
Dmitri Gribenko c06cbd14e3 Always initialize variable. If opening quote is the last character in comment, we will be using an uninitialized value. There is already a test for that in unittests/AST/CommentLexer.cpp, but it seems like we were lucky with the value that got loaded into the variable so the test passed.
llvm-svn: 160133
2012-07-12 16:34:32 +00:00
Alexander Kornienko 8480d420d3 Updated -help message in clang-check.
Summary: Provide more information on usage in -help

Test Plan: ran once

Reviewers: klimek, chandlerc, djasper

Reviewed By: klimek

CC: cfe-commits

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

llvm-svn: 160132
2012-07-12 14:34:23 +00:00
Timur Iskhodzhanov 3f7e9d2b45 [Windows] Split the back reference tests into two separate files as the templates are getting hairy
llvm-svn: 160131
2012-07-12 14:33:58 +00:00
NAKAMURA Takumi ff4cd7792a test/CodeGen/rdrand-builtins.c: Define __MM_MALLOC_H before including <*mmintrin.h> .
Rawr!

llvm-svn: 160125
2012-07-12 10:36:27 +00:00
Benjamin Kramer 72ec3756f9 Don't include mm_malloc.h in test, it pulls in system headers on msvc.
llvm-svn: 160122
2012-07-12 09:56:18 +00:00
Timur Iskhodzhanov c5098ad371 [Windows] Use thiscall as the default calling convention for class methods. PR12785
llvm-svn: 160121
2012-07-12 09:50:54 +00:00
Benjamin Kramer a43b6999ff Add _rdrand{16,32,64}_step intrinsics to immintrin.h
llvm-svn: 160118
2012-07-12 09:33:03 +00:00
Daniel Jasper 4e566c4aed This commit combines three patches to the ASTMatchers.
One adds matchers for the various parts of a for loop (initializer, condition,
increment), as well as extending the hasBody matcher to work for while and
do-while loops. The second patch adds an isInteger matcher for types.
The third patch fixes a bug in allOf, where a few of the name chages
(AllOf --> allOf) had been missed.

All matchers come with unit tests.

Patches by Sam Panzer!

llvm-svn: 160115
2012-07-12 08:50:38 +00:00
Benjamin Kramer 20863e3692 Be lax about trailing whitespace when checking fixit formatting, this depends on locale settings.
If a non-unicode locale is used, the unicode character is escaped and any
byte that is in the escaped representation but not the semicolon will
become whitespace.

llvm-svn: 160113
2012-07-12 08:34:31 +00:00
Benjamin Kramer 29f90e804d PR13312: Don't crash when printing a fixit that ends in a unicode character.
llvm-svn: 160112
2012-07-12 08:20:49 +00:00
Gregory Szorc 9a2cb42451 [clang.py] Implement Token API
llvm-svn: 160111
2012-07-12 07:21:12 +00:00
Gregory Szorc bdbb73d276 [clang.py] Add TranslationUnit.get_{file,source_location,source_range}
llvm-svn: 160107
2012-07-12 05:05:56 +00:00
Gregory Szorc f1b7e3c7ba [clang.py] Refactor how ctypes functions are registered
llvm-svn: 160106
2012-07-12 04:56:46 +00:00
Rafael Espindola 4dedd0ceb8 Process #pragma visibility early in the parsing of class definitions. Fixes
pr13338.

llvm-svn: 160105
2012-07-12 04:47:34 +00:00
Rafael Espindola 06e1b13209 Ignore visibility attributes after definitions. This matches newer (4.7) gcc's
behavior and is the first step in fixing pr13338.

llvm-svn: 160104
2012-07-12 04:32:30 +00:00
NAKAMURA Takumi e5494ffe4f Revert r160052, "Default to -std=c++11 on Windows.", for now.
Failing Tests (3):
    Clang :: Index/complete-cxx-inline-methods.cpp
    Clang :: Index/recursive-cxx-member-calls.cpp
    Clang :: SemaTemplate/inject-templated-friend-post.cpp

llvm-svn: 160103
2012-07-12 03:14:56 +00:00
John McCall 775086e67c Add the ObjFW runtime. Patch by Jonathan Schleifer!
llvm-svn: 160102
2012-07-12 02:07:58 +00:00
NAKAMURA Takumi 0e449c4e54 AST/CommentSema.cpp: Fix signess in abs() to appease msvc. It would not make sense to pass (unsigned)-(unsigned) to abs().
llvm-svn: 160097
2012-07-12 00:45:08 +00:00
NAKAMURA Takumi 7073024ffd clang/lib/Basic/CMakeLists.txt: Add missing dependency, ClangDiagnosticComment.
llvm-svn: 160096
2012-07-12 00:27:55 +00:00
Jordan Rose d66bee3f76 [analyzer] Don't inline virtual calls unless we can devirtualize properly.
Previously we were using the static type of the base object to inline
methods, whether virtual or non-virtual. Now, we try to see if the base
object has a known type, and if so ask for its implementation of the method.

llvm-svn: 160094
2012-07-12 00:16:25 +00:00
Tanya Lattner 7445ada9c8 Add OpenCL metadata for kernel arg names. This output is controlled via a flag as noted in the OpenCL Spec.
Includes a test case.

llvm-svn: 160092
2012-07-11 23:02:10 +00:00
Nico Weber 1325384b32 Don't try to do RVO on block variables that refer to an enclosing local.
Fixes PR13314, clang crashing on blocks refering to an enclosing local
when the enclosing function returns void.

llvm-svn: 160089
2012-07-11 22:50:15 +00:00
Richard Smith ded9c2ee92 Stop instantiating a class if we hit a static_assert failure. Also, if the
static_assert fails when parsing the template, don't diagnose it again on every
instantiation.

llvm-svn: 160088
2012-07-11 22:37:56 +00:00
Richard Smith 3d46052d90 Fix warning.
llvm-svn: 160087
2012-07-11 22:33:59 +00:00
Dmitri Gribenko f26054f0fb Enable comment parsing and semantic analysis to emit diagnostics. A few
diagnostics implemented -- see testcases.

I created a new TableGen file for comment diagnostics,
DiagnosticCommentKinds.td, because comment diagnostics don't logically
fit into AST diagnostics file.  But I don't feel strongly about it.

This also implements support for self-closing HTML tags in comment
lexer and parser (for example, <br />).

In order to issue precise diagnostics CommentSema needs to know the
declaration the comment is attached to.  There is no easy way to find a decl by 
comment, so we match comments and decls in lockstep: after parsing one
declgroup we check if we have any new, not yet attached comments.  If we do --
then we do the usual comment-finding process.

It is interesting that this automatically handles trailing comments.
We pick up not only comments that precede the declaration, but also
comments that *follow* the declaration -- thanks to the lookahead in
the lexer: after parsing the declgroup we've consumed the semicolon
and looked ahead through comments.

Added -Wdocumentation-html flag for semantic HTML errors to allow the user to 
disable only HTML warnings (but not HTML parse errors, which we emit as
warnings in -Wdocumentation).

llvm-svn: 160078
2012-07-11 21:38:39 +00:00
Argyrios Kyrtzidis 6d7833f1b6 Introduce a flag in SourceManager to treat non-system source files
as "volatile", meaning there's a high enough chance that they may
change while we are trying to use them.

This flag is only enabled by libclang.
Currently "volatile" source files will be stat'ed immediately
before opening them, because the file size stat info
may not be accurate since when we got it (e.g. from the PCH).
This avoids crashes when trying to reference mmap'ed memory
from a file whose size is not what we expect.

Note that there's still a window for a racing issue to occur
but the window for it should be way smaller than before.
We can consider later on to avoid mmap completely on such files.

rdar://11612916

llvm-svn: 160074
2012-07-11 20:59:04 +00:00
Jordan Rose 1fa2acaed4 Start testing some commented-out cases of badly-formed __has_include.
Filed PR13334 for the cases that cause the compiler to crash, and
PR13335 for the cases where we should be recovering more gracefully.

llvm-svn: 160070
2012-07-11 20:12:19 +00:00
Jordan Rose b13eb8dca5 Allow -verify directives to be filtered by preprocessing.
This is accomplished by making VerifyDiagnosticsConsumer a CommentHandler,
which then only reads the -verify directives that are actually in live
blocks of code. It also makes it simpler to handle -verify directives that
appear in header files, though we still have to manually reparse some files
depending on how they are generated.

This requires some test changes. In particular, all PCH tests now have their
-verify directives outside the "header" portion of the file, using the @line
syntax added in r159978. Other tests have been modified mostly to make it
clear what is being tested, and to prevent polluting the expected output with
the directives themselves.

Patch by Andy Gibbs! (with slight modifications)

The new Frontend/verify-* tests exercise the functionality of this commit,
as well as r159978, r159979, and r160053 (Andy's other -verify enhancements).

llvm-svn: 160068
2012-07-11 19:58:23 +00:00
Daniel Jasper 30cd116039 Move CompileAssert into namespace clang::ast_matchers:: to avoid naming
collisions until it is properly integrated in llvm/Support.

llvm-svn: 160063
2012-07-11 19:22:37 +00:00
Daniel Jasper bb89ae9392 Add a hook to supply a custom CompilationDatabase. To add a custom CompilationDatabase, make it implement findCompilationDatabaseForDirectory in CustomCompilationDatabase.h and set USE_COSTUM_COMPILATION_DATABASE.
Differential Revision: http://llvm-reviews.chandlerc.com/D4

llvm-svn: 160061
2012-07-11 19:13:13 +00:00
Chad Rosier 4dce73af05 [driver] Fix so that clang can find correct path prefix for libc object files
from GNU binutils supporting multi-arch folder for ARM target.
Patch by Jiangning Liu <jiangning.liu@arm.com>.

llvm-svn: 160060
2012-07-11 19:08:21 +00:00
Rafael Espindola 1fa9fade38 Handle #pragma visibility in explicit specializations and enums.
llvm-svn: 160057
2012-07-11 18:14:09 +00:00
Nico Weber 50661442a9 Mention -fms-compatibility and -fdelayed-template-parsing in UsersManual.
Also mention that -std=c++11 is now on by default on windows.

llvm-svn: 160054
2012-07-11 16:56:28 +00:00
Jordan Rose 6f524ac9f0 Emit -verify diagnostics even when we have a fatal error.
Previously we'd halt at the fatal error as expected, but not actually emit
any -verify-related diagnostics. This lets us catch cases that emit a
/different/ fatal error from the one we expected.

This is implemented by adding a "force emit" mode to DiagnosticBuilder, which
will cause diagnostics to immediately be emitted regardless of current
suppression. Needless to say this should probably be used /very/ sparingly.

Patch by Andy Gibbs! Tests for all of Andy's -verify patches coming soon.

llvm-svn: 160053
2012-07-11 16:50:36 +00:00
Nico Weber cc19aec7ae Default to -std=c++11 on Windows.
llvm-svn: 160052
2012-07-11 16:46:17 +00:00
Nico Weber 6320b5213e Remove unused override of CompilerInvocation::setLangDefaults().
llvm-svn: 160051
2012-07-11 16:15:04 +00:00
Justin Holewinski 5fafdd9d1d Fix handling of curly braces in NVPTX inline asm
Fixes bug 13322

Patch by Dmitry Mikushin

llvm-svn: 160050
2012-07-11 15:34:55 +00:00
Eric Christopher f8b9809fab Temporarily revert this to see if it brings the gdb bot back.
llvm-svn: 160049
2012-07-11 15:32:13 +00:00
Daniel Jasper 1808bbedaf Fix usage instructions for clang-check.
llvm-svn: 160048
2012-07-11 15:05:24 +00:00
Alexander Kornienko 442b55fc28 How to set up clang tools for llvm
Summary: How to guide for setting up clang tooling for llvm repo.

Test Plan: this is untested

Reviewers: klimek, djasper

Reviewed By: klimek

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

llvm-svn: 160047
2012-07-11 14:27:44 +00:00
NAKAMURA Takumi b59973e6cd clang/test/Misc/diag-template-diffing-color.cpp: Introduce the feature 'ansi-escape-sequences'.
llvm-svn: 160043
2012-07-11 11:44:00 +00:00
Axel Naumann 23c1676dee LLVM_ON_WIN32 case: use the proper key in the UniqueFiles map.
llvm-svn: 160041
2012-07-11 09:41:34 +00:00
Rafael Espindola 5f0a1b89d7 Don't process #pragma visibility during instantiation. The visibility of the
instantiation depends on the template, its arguments and parameters, but not
where it is instantiated.

llvm-svn: 160034
2012-07-11 02:15:51 +00:00
Eric Christopher 2977378974 The end of a block doesn't necessarily need a line table entry unless
there's something going on there. Remove the unconditional line entry
and only add one if we're emitting cleanups (any other statements
would be handled normally).

Fixes rdar://9199234

llvm-svn: 160033
2012-07-11 01:49:26 +00:00
Eric Christopher 296a710b5b FileCheck-ize.
llvm-svn: 160032
2012-07-11 01:49:24 +00:00
Jordan Rose 8889cf008d [analyzer] Add debug.DumpCalls, which prints out any CallEvents it sees.
This is probably not so useful yet because it is not path-sensitive, though
it does try to show inlining with indentation.

This also adds a dump() method to CallEvent, which should be useful for
debugging.

llvm-svn: 160030
2012-07-10 23:56:23 +00:00
Jordan Rose 6cd16c5152 [analyzer] Guard against C++ member functions that look like system functions.
C++ method calls and C function calls both appear as CallExprs in the AST.
This was causing crashes for an object that had a 'free' method.

<rdar://problem/11822244>

llvm-svn: 160029
2012-07-10 23:13:01 +00:00
Richard Smith 9fce7bc721 Fix crash when constant-evaluating a CXXConstructExpr representing
value-initialization for an array of class type with a trivial default
constructor.

llvm-svn: 160024
2012-07-10 22:12:55 +00:00
Jordan Rose eab627b951 [analyzer] Construct stack variables directly in their VarDecl.
Also contains a number of tweaks to inlining that are necessary
for constructors and destructors. (I have this enabled on a private
branch, but it is very much unstable.)

llvm-svn: 160023
2012-07-10 22:08:01 +00:00
Jordan Rose d1d54aa131 [analyzer] Use CallEvent for building inlined stack frames.
In order to accomplish this, we now build the callee's stack frame
as part of the CallEnter node, rather than the subsequent BlockEdge node.
This should not have any effect on perceived behavior or diagnostics.

This makes it safe to re-enable inlining of member overloaded operators.

llvm-svn: 160022
2012-07-10 22:07:57 +00:00
Jordan Rose fbe6dba15a [analyzer] Make CallEnter, CallExitBegin, and CallExitEnd not be StmtPoints
These ProgramPoints are used in inlining calls,
and not all calls have associated statements anymore.

llvm-svn: 160021
2012-07-10 22:07:52 +00:00
Jordan Rose 4ee71b8a18 [analyzer] Add a CXXDestructorCall CallEvent.
While this work is still fairly tentative (destructors are still left out of
the CFG by default), we now handle destructors in the same way as any other
calls, instead of just automatically trying to inline them.

llvm-svn: 160020
2012-07-10 22:07:47 +00:00
Jordan Rose 681cce9908 [analyzer] Add new PreImplicitCall and PostImplicitCall ProgramPoints.
These are currently unused, but are intended to be used in lieu of PreStmt
and PostStmt when the call is implicit (e.g. an automatic object destructor).

This also modifies the Data1 field of ProgramPoints to allow storing any
pointer-sized value, as opposed to only aligned pointers. This is necessary
to store SourceLocations.

There is currently no BugReporter support for these; they should be skipped
over in any diagnostic output.

This commit also tags checkers that currently rely on function calls only
occurring at StmtPoints.

llvm-svn: 160019
2012-07-10 22:07:42 +00:00
DeLesley Hutchins 868830f727 Thread safety analysis: impove handling of trylock expressions.
llvm-svn: 160018
2012-07-10 21:47:55 +00:00
Chad Rosier 67055f5ddc 80-column violations and whitespace.
llvm-svn: 160017
2012-07-10 21:35:27 +00:00
Daniel Jasper 1dad183b38 Add more matchers and do cleanups.
Reviewers: klimek

    Differential Revision: http://ec2-50-18-127-156.us-west-1.compute.amazonaws.com/D2

llvm-svn: 160013
2012-07-10 20:20:19 +00:00
Benjamin Kramer 60d7f5a1d7 Disable death tests on platforms which don't support them.
llvm-svn: 160000
2012-07-10 17:30:44 +00:00
Arnaud A. de Grandmaison 617f5269c3 Adds support for auto-detection of compilation databases, looking in a directory and all its parents.
llvm-svn: 159998
2012-07-10 16:56:35 +00:00
Axel Naumann b307400326 Improve r159256 following Chandler's comments:
Implement UniqueFileContainer::erase(), camelCase, add comment on future optimizations of the cache versus de-optimizations of invalidations.

llvm-svn: 159997
2012-07-10 16:50:27 +00:00
Anna Zaks 8698dd63d7 [analyzer] Remove redundant check (scalar type is a superset of integer)
PR13319 Reported by Jozsef Mihalicza.

llvm-svn: 159996
2012-07-10 16:27:55 +00:00
Axel Naumann b2f1a46402 Clear diagnostic counts after processing the diagnostics.
The consumer might see multiple input files (e.g. for cling) and since r159977 the count is maintained across input files.

llvm-svn: 159995
2012-07-10 16:24:07 +00:00
Manuel Klimek a9c86c980b Fixes the MSVC build.
llvm-svn: 159992
2012-07-10 14:21:30 +00:00
Manuel Klimek 65fd0e1fd3 Adds support for auto-detection of compilation databases
from a source file and changes clang-check to make use of this.

This makes clang-check just work on in-tree builds, and allows
easy setup via a symlink per source directory to make clang-check
work without any extra configuration.

llvm-svn: 159990
2012-07-10 13:10:51 +00:00
Manuel Klimek af18d52c09 Update the docs with specifics about escaping of compile commands.
llvm-svn: 159987
2012-07-10 08:05:54 +00:00
Chris Lattner 209ad6baa0 Jordan points out that this was incorrect: clang should recover from
*errors* with fixits on them by following the recovery advised by the
fixit, but if it is a fixit on a warning, then obviously the AST 
should be for the code as-written.

llvm-svn: 159980
2012-07-10 05:03:05 +00:00
Jordan Rose b8b2ca6ffb Allow -verify directives to specify a min and max count, not just "+".
void f(); // expected-note 0+ {{previous declaration is here}}
  void g(); // expected-note 0-1 {{previous declaration is here}}

The old "+" syntax is still an alias for "1+", and single numbers still work.

Patch by Andy Gibbs!

llvm-svn: 159979
2012-07-10 02:57:26 +00:00
Jordan Rose e1572eb3e2 Allow line numbers on -verify directives.
// expected-warning@10 {{some text}}

The line number may be absolute (as above), or relative to the current
line by prefixing the number with either '+' or '-'.

Patch by Andy Gibbs!

llvm-svn: 159978
2012-07-10 02:57:03 +00:00
Jordan Rose 6dae761810 Clean up VerifyDiagnosticsConsumer in preparation for upcoming enhancements.
Patch by Andy Gibbs!

llvm-svn: 159977
2012-07-10 02:56:15 +00:00
Richard Trieu 50f5f46a93 Properly update the FormattedArgs vector when the template type diffing falls
back to regular type printing.

llvm-svn: 159976
2012-07-10 01:46:04 +00:00
Jordan Rose 6ea25fe9ce Add an explanation of -Wobjc-literal-compare to the "Objective-C Literals" page
(per Jean-Daniel's suggestion to keep around an explanation of why
direct comparisons on ObjC literals are a bad idea)

llvm-svn: 159972
2012-07-10 00:20:57 +00:00
Arnaud A. de Grandmaison cdccafa53c [cindex.py] Make CompileCommand.arguments usage consistent with CompileCommand.directory and the rest of the python binding
Patch by David Röthlisberger

llvm-svn: 159970
2012-07-10 00:00:05 +00:00