]> granicus.if.org Git - clang/log
clang
12 years agoAdding a fixit for includes that cannot be found with angle brackets, but can be...
Aaron Ballman [Tue, 17 Jul 2012 23:19:16 +0000 (23:19 +0000)]
Adding a fixit for includes that cannot be found with angle brackets, but can be found with quoted strings instead.  Implements PR13201.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160406 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoImprove comment for TypeDecl::getTypeForDecl(), from Sean Silva!
Douglas Gregor [Tue, 17 Jul 2012 23:09:36 +0000 (23:09 +0000)]
Improve comment for TypeDecl::getTypeForDecl(), from Sean Silva!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160405 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoEliminating the GCC_CAST hack, take two.
Douglas Gregor [Tue, 17 Jul 2012 23:07:44 +0000 (23:07 +0000)]
Eliminating the GCC_CAST hack, take two.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160404 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoComment AST nodes: rename Num*Bitfields to Num*Bits to be consistent with Stmt AST...
Dmitri Gribenko [Tue, 17 Jul 2012 22:43:26 +0000 (22:43 +0000)]
Comment AST nodes: rename Num*Bitfields to Num*Bits to be consistent with Stmt AST nodes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160402 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoReinstate the GCC_CAST hack; I apparently did not appease GCC with r160397.
Douglas Gregor [Tue, 17 Jul 2012 22:32:15 +0000 (22:32 +0000)]
Reinstate the GCC_CAST hack; I apparently did not appease GCC with r160397.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160401 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoImplement an optimization for finding the comment that occurs just after a
Dmitri Gribenko [Tue, 17 Jul 2012 22:01:09 +0000 (22:01 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160400 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRobustify test in the face of no assertions.
Eric Christopher [Tue, 17 Jul 2012 21:52:07 +0000 (21:52 +0000)]
Robustify test in the face of no assertions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160399 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTry to eliminate GCC_CAST hack in a manner that should work for both
Douglas Gregor [Tue, 17 Jul 2012 21:27:49 +0000 (21:27 +0000)]
Try to eliminate GCC_CAST hack in a manner that should work for both
GCC and MSVC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160397 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoCommentBriefParser: use StringSwitch::Cases to group synonyms. Thanks Jordan!
Dmitri Gribenko [Tue, 17 Jul 2012 21:21:55 +0000 (21:21 +0000)]
CommentBriefParser: use StringSwitch::Cases to group synonyms.  Thanks Jordan!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160396 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTeach the ASTImporter how to handle anonymous structs/unions
Douglas Gregor [Tue, 17 Jul 2012 21:16:27 +0000 (21:16 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160395 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDon't treat overflow in floating-point conversions as a hard error in constant evalua...
Eli Friedman [Tue, 17 Jul 2012 21:03:05 +0000 (21:03 +0000)]
Don't treat overflow in floating-point conversions as a hard error in constant evaluation. <rdar://problem/11874571>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160394 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoHandle the case where the base type is not dependent, but the derived one is.
Rafael Espindola [Tue, 17 Jul 2012 20:24:05 +0000 (20:24 +0000)]
Handle the case where the base type is not dependent, but the derived one is.
Fixes pr13353.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160393 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFixed whitespace issue introduced in r160373.
Joao Matos [Tue, 17 Jul 2012 19:17:58 +0000 (19:17 +0000)]
Fixed whitespace issue introduced in r160373.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160388 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMinor cleanups and additions to the users manual. UsersManual.html now validates...
Dmitri Gribenko [Tue, 17 Jul 2012 18:51:47 +0000 (18:51 +0000)]
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.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160386 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix regexp for this test to properly check.
Eric Christopher [Tue, 17 Jul 2012 18:40:46 +0000 (18:40 +0000)]
Fix regexp for this test to properly check.

Patch by Eli Bendersky.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160385 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoCommentBriefParser: make \short should equivalent to \brief, per Doxygen manual.
Dmitri Gribenko [Tue, 17 Jul 2012 18:35:14 +0000 (18:35 +0000)]
CommentBriefParser: make \short should equivalent to \brief, per Doxygen manual.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160383 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIssue warning when assigning out-of-range integer values to enums.
Fariborz Jahanian [Tue, 17 Jul 2012 18:00:08 +0000 (18:00 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160382 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago-Wobjc-literal-compare: don't warn when comparing against nil.
Jordan Rose [Tue, 17 Jul 2012 17:46:48 +0000 (17:46 +0000)]
-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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160379 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd -Wobjc-string-compare under -Wobjc-literal-compare.
Jordan Rose [Tue, 17 Jul 2012 17:46:44 +0000 (17:46 +0000)]
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.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160378 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoNow that -Wobjc-literal-compare is a warning, put the fixit on a note.
Jordan Rose [Tue, 17 Jul 2012 17:46:40 +0000 (17:46 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160377 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Remove stale result type lvalue code.
Jordan Rose [Tue, 17 Jul 2012 17:27:10 +0000 (17:27 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160375 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[Windows] Abstract pure virtual method calls in the ABI. Fix the Windows ABI to forwa...
Joao Matos [Tue, 17 Jul 2012 17:10:11 +0000 (17:10 +0000)]
[Windows] Abstract pure virtual method calls in the ABI. Fix the Windows ABI to forward to the correct function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160373 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd a custom initialize hook for clang tools + minor fixes in CustomCompilationDatabase.h
Alexander Kornienko [Tue, 17 Jul 2012 16:11:17 +0000 (16:11 +0000)]
Add a custom initialize hook for clang tools + minor fixes in CustomCompilationDatabase.h

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160369 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMerge visibility from previous decls before looking at visibility pragma. This
Rafael Espindola [Tue, 17 Jul 2012 15:14:47 +0000 (15:14 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160364 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agotest/Driver/crash-report.c: Remove "REQUIRES: shell". env(1) can be used also with...
NAKAMURA Takumi [Tue, 17 Jul 2012 12:00:24 +0000 (12:00 +0000)]
test/Driver/crash-report.c: Remove "REQUIRES: shell". env(1) can be used also with gnuwin32.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160362 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix unit test dependency in Makefile and remove unneccessary dependency
Daniel Jasper [Tue, 17 Jul 2012 09:12:33 +0000 (09:12 +0000)]
Fix unit test dependency in Makefile and remove unneccessary dependency
again.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160358 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd missing dependency for unit test.
Daniel Jasper [Tue, 17 Jul 2012 08:49:28 +0000 (08:49 +0000)]
Add missing dependency for unit test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160356 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFinishing the move of RefactoringCallbacks and fixing the corresponding
Daniel Jasper [Tue, 17 Jul 2012 08:37:03 +0000 (08:37 +0000)]
Finishing the move of RefactoringCallbacks and fixing the corresponding
buildbot failures.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160355 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRevert commit r160308. We decide to move builtins selection to the backend.
Simon Atanasyan [Tue, 17 Jul 2012 08:15:06 +0000 (08:15 +0000)]
Revert commit r160308. We decide to move builtins selection to the backend.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160353 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMove RefactoringCallbacks to Tooling to avoid dependency from
Daniel Jasper [Tue, 17 Jul 2012 08:03:01 +0000 (08:03 +0000)]
Move RefactoringCallbacks to Tooling to avoid dependency from
ASTMatchers (lower level abstraction) to Tooling (higher level
abstraction).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160351 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFixup for r160345 - uintptr_t is not always unsigned
Alexey Samsonov [Tue, 17 Jul 2012 07:46:40 +0000 (07:46 +0000)]
Fixup for r160345 - uintptr_t is not always unsigned

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160349 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMake the isDerivedFrom matcher more generic.
Daniel Jasper [Tue, 17 Jul 2012 07:39:27 +0000 (07:39 +0000)]
Make the isDerivedFrom matcher more generic.

It now accepts an arbitrary inner matcher but is fully backwards
compatible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160348 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFixed few warnings.
Galina Kistanova [Tue, 17 Jul 2012 06:25:13 +0000 (06:25 +0000)]
Fixed few warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160345 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[Win32] Rework crash-report since r145389.
NAKAMURA Takumi [Tue, 17 Jul 2012 05:09:29 +0000 (05:09 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160343 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agotest/Driver/crash-report.c: Small tweaks. 1) Use %t instead %T for TMP. 2) Set all...
NAKAMURA Takumi [Tue, 17 Jul 2012 05:09:20 +0000 (05:09 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160342 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRecord visibility pragmas when we see a tag declaration. We might use it
Rafael Espindola [Tue, 17 Jul 2012 04:22:25 +0000 (04:22 +0000)]
Record visibility pragmas when we see a tag declaration. We might use it
to build a type before seeing the definition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160339 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUninitialized variables: two little changes:
Richard Smith [Tue, 17 Jul 2012 01:27:33 +0000 (01:27 +0000)]
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;'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160334 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoclang/test/Tooling/clang-ast-dump.cpp: Mark it as REQUIRES: asserts, for now.
NAKAMURA Takumi [Tue, 17 Jul 2012 00:33:36 +0000 (00:33 +0000)]
clang/test/Tooling/clang-ast-dump.cpp: Mark it as REQUIRES: asserts, for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160332 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMove clang_Cursor_getBriefCommentText implementation under `extern "C"'.
Dmitri Gribenko [Tue, 17 Jul 2012 00:17:45 +0000 (00:17 +0000)]
Move clang_Cursor_getBriefCommentText implementation under `extern "C"'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160331 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago-Wuninitialized: Split the classification of DeclRefExprs as initialization or
Richard Smith [Tue, 17 Jul 2012 00:06:14 +0000 (00:06 +0000)]
-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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160330 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Handle new-expressions with initializers for scalars.
Jordan Rose [Mon, 16 Jul 2012 23:38:09 +0000 (23:38 +0000)]
[analyzer] Handle new-expressions with initializers for scalars.

<rdar://problem/11818967>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160328 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoWeaken Unicode fixit test to work even if the character is printed escaped.
Jordan Rose [Mon, 16 Jul 2012 22:18:33 +0000 (22:18 +0000)]
Weaken Unicode fixit test to work even if the character is printed escaped.

This should fix the failure on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160324 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix BlockCommandComment::classof() to return true for objects of derived classes.
Dmitri Gribenko [Mon, 16 Jul 2012 22:13:46 +0000 (22:13 +0000)]
Fix BlockCommandComment::classof() to return true for objects of derived classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160323 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoThis test appears to fail on win32.
Ted Kremenek [Mon, 16 Jul 2012 21:43:16 +0000 (21:43 +0000)]
This test appears to fail on win32.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160322 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd hack (provided by Jonathan Sauer) to fall back to assuming Xcode is installed...
Ted Kremenek [Mon, 16 Jul 2012 21:39:29 +0000 (21:39 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160321 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoThis test appears to be passing on win32.
Ted Kremenek [Mon, 16 Jul 2012 21:17:01 +0000 (21:17 +0000)]
This test appears to be passing on win32.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160320 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDon't crash when emitting fixits following Unicode characters.
Jordan Rose [Mon, 16 Jul 2012 20:52:12 +0000 (20:52 +0000)]
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>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160319 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSimplify float comparison checks by using early return.
David Blaikie [Mon, 16 Jul 2012 20:47:22 +0000 (20:47 +0000)]
Simplify float comparison checks by using early return.

Found while investigating PR13330

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160318 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix copy-paste mistake for CMake dependency.
Ted Kremenek [Mon, 16 Jul 2012 20:22:15 +0000 (20:22 +0000)]
Fix copy-paste mistake for CMake dependency.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160315 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Make CmpRuns external-user friendly.
Anna Zaks [Mon, 16 Jul 2012 20:21:42 +0000 (20:21 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160314 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoLooks like libTooling might also depend on ClangDiagnosticCommon.
Ted Kremenek [Mon, 16 Jul 2012 19:44:15 +0000 (19:44 +0000)]
Looks like libTooling might also depend on ClangDiagnosticCommon.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160313 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd libEdit dependency on ClangDiagnosticCommon. Hopefully this will unbreak the...
Ted Kremenek [Mon, 16 Jul 2012 18:53:42 +0000 (18:53 +0000)]
Add libEdit dependency on ClangDiagnosticCommon.  Hopefully this will unbreak the VS build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160309 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMIPS: Implement __builtin_mips_shll_qb builtin function overloading.
Simon Atanasyan [Mon, 16 Jul 2012 18:52:02 +0000 (18:52 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160308 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix rejects-valid: explicit specialization of redeclared deleted function template.
David Blaikie [Mon, 16 Jul 2012 18:50:45 +0000 (18:50 +0000)]
Fix rejects-valid: explicit specialization of redeclared deleted function template.

Review by Richard Smith.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160306 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agomodern objective-c translator: conditionally include
Fariborz Jahanian [Mon, 16 Jul 2012 16:21:45 +0000 (16:21 +0000)]
modern objective-c translator: conditionally include
<string.h>. // rdar://11847319

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160287 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFixing an MSVC warning -- the compiler did not like the cast added to work around...
Aaron Ballman [Mon, 16 Jul 2012 15:45:33 +0000 (15:45 +0000)]
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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160281 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFixing an obvious bug in a test.
Alexander Kornienko [Mon, 16 Jul 2012 13:31:37 +0000 (13:31 +0000)]
Fixing an obvious bug in a test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160268 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoThe new clang-ast-dump tool for selective AST dumping. Moved common command-line...
Alexander Kornienko [Mon, 16 Jul 2012 12:46:48 +0000 (12:46 +0000)]
The new clang-ast-dump tool for selective AST dumping. Moved common command-line tool stuff to CommandLineClangTool

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160265 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd two more missing parameters in diagnostics.
Daniel Jasper [Mon, 16 Jul 2012 12:12:45 +0000 (12:12 +0000)]
Add two more missing parameters in diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160264 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix diagnostic adding missing parameter.
Daniel Jasper [Mon, 16 Jul 2012 11:51:49 +0000 (11:51 +0000)]
Fix diagnostic adding missing parameter.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160263 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPrevent unused-variable warning in optimized builds.
Daniel Jasper [Mon, 16 Jul 2012 10:25:15 +0000 (10:25 +0000)]
Prevent unused-variable warning in optimized builds.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160257 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd refactoring callbacks to make common kinds of refactorings easy.
Daniel Jasper [Mon, 16 Jul 2012 09:18:17 +0000 (09:18 +0000)]
Add refactoring callbacks to make common kinds of refactorings easy.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160255 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd correct parenthesis range to CXXConstructExprs inside
Daniel Jasper [Mon, 16 Jul 2012 08:05:07 +0000 (08:05 +0000)]
Add correct parenthesis range to CXXConstructExprs inside
CXXFunctionalCastExprs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160252 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPlace checker build at alternate URL.
Ted Kremenek [Mon, 16 Jul 2012 04:18:35 +0000 (04:18 +0000)]
Place checker build at alternate URL.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160247 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMore for PR11848: a pack expansion type isn't necessarily type-dependent (its
Richard Smith [Mon, 16 Jul 2012 01:59:26 +0000 (01:59 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160246 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPR13365: Fix code which was trying to treat an array of DeducedTemplateArgument
Richard Smith [Mon, 16 Jul 2012 01:09:10 +0000 (01:09 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160245 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRelated to PR11848 and core-21989: switch ContainsUnexpandedParameterPack from
Richard Smith [Mon, 16 Jul 2012 00:20:35 +0000 (00:20 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160244 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRevert change accidentally committed in r160240.
Richard Smith [Sun, 15 Jul 2012 23:30:50 +0000 (23:30 +0000)]
Revert change accidentally committed in r160240.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160241 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPR13368: Halve the instantiation depth of this test again. Apparently, FreeBSD
Richard Smith [Sun, 15 Jul 2012 23:29:50 +0000 (23:29 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160240 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUpdate Clang to reflect the move of MDBuilder in r160237.
Chandler Carruth [Sun, 15 Jul 2012 23:28:01 +0000 (23:28 +0000)]
Update Clang to reflect the move of MDBuilder in r160237.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160238 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd test case for tweaks to clang driver.
David Chisnall [Sun, 15 Jul 2012 21:18:01 +0000 (21:18 +0000)]
Add test case for tweaks to clang driver.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160236 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix spelling of anyOf matcher and add missing test.
Daniel Jasper [Sun, 15 Jul 2012 19:57:12 +0000 (19:57 +0000)]
Fix spelling of anyOf matcher and add missing test.

Patch by Sam Panzer!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160233 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoEnable new linker behaviour on FreeBSD.
David Chisnall [Sun, 15 Jul 2012 12:53:06 +0000 (12:53 +0000)]
Enable new linker behaviour on FreeBSD.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160231 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoWithout this patch clang warns on
Rafael Espindola [Sun, 15 Jul 2012 01:33:40 +0000 (01:33 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160227 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMake const the argument of getDefinition.
Rafael Espindola [Sun, 15 Jul 2012 01:05:36 +0000 (01:05 +0000)]
Make const the argument of getDefinition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160226 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUse llvm::APSInt::isSameValue to compare for the same value.
Eric Christopher [Sun, 15 Jul 2012 00:24:00 +0000 (00:24 +0000)]
Use llvm::APSInt::isSameValue to compare for the same value.

Finishes rdar://11875995

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160225 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoReplace IsSameValue with the llvm::APSInt/llvm::APInt versions
Eric Christopher [Sun, 15 Jul 2012 00:23:57 +0000 (00:23 +0000)]
Replace IsSameValue with the llvm::APSInt/llvm::APInt versions
that we just copied from here and replace all uses.

Part of rdar://11875995

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160224 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoCapitalize comment.
Eric Christopher [Sat, 14 Jul 2012 19:29:12 +0000 (19:29 +0000)]
Capitalize comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160220 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRefine CFG so that '&&' and '||' don't lead to extra confluence points when used...
Ted Kremenek [Sat, 14 Jul 2012 05:04:10 +0000 (05:04 +0000)]
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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160218 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoHoist CFG builder logic for '&&' and '||' into helper method. No funcationlity change.
Ted Kremenek [Sat, 14 Jul 2012 05:04:06 +0000 (05:04 +0000)]
Hoist CFG builder logic for '&&' and '||' into helper method.  No funcationlity change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160217 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove unused method declaration.
Ted Kremenek [Sat, 14 Jul 2012 05:04:04 +0000 (05:04 +0000)]
Remove unused method declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160216 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSort prototypes. No functionality change.
Ted Kremenek [Sat, 14 Jul 2012 05:04:01 +0000 (05:04 +0000)]
Sort prototypes.  No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160215 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUpdate Sema diagnostic messages to take advantage of template type diffing.
Richard Trieu [Sat, 14 Jul 2012 00:49:02 +0000 (00:49 +0000)]
Update Sema diagnostic messages to take advantage of template type diffing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160210 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd a per target max vector alignment field (e.g., 32-byte alignment for x86 due to
Chad Rosier [Fri, 13 Jul 2012 23:57:43 +0000 (23:57 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160209 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPR13360: When deciding the earliest point which inevitably leads to an
Richard Smith [Fri, 13 Jul 2012 23:33:44 +0000 (23:33 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160206 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMove option test earlier in the function.
Rafael Espindola [Fri, 13 Jul 2012 23:26:43 +0000 (23:26 +0000)]
Move option test earlier in the function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160202 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoThis is one of the first steps at moving to replace target-dependent
Joel Jones [Fri, 13 Jul 2012 23:26:27 +0000 (23:26 +0000)]
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>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160201 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoComment.h: reword comments
Dmitri Gribenko [Fri, 13 Jul 2012 22:36:49 +0000 (22:36 +0000)]
Comment.h: reword comments

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160197 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoModify tree printing mode for template type diffing. If a diagnostic has
Richard Trieu [Fri, 13 Jul 2012 21:18:32 +0000 (21:18 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160193 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoadd support for conditional expressions in Expr::HasSideEffects()
Nuno Lopes [Fri, 13 Jul 2012 20:48:52 +0000 (20:48 +0000)]
add support for conditional expressions in Expr::HasSideEffects()
This fixes a bug in __builtin_object_size() codegen

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160191 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMove a bunch of the attribute warnings under the IgnoreAttributes group. Cleaned...
Tanya Lattner [Fri, 13 Jul 2012 20:45:35 +0000 (20:45 +0000)]
Move a bunch of the attribute warnings under the IgnoreAttributes group. Cleaned up test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160190 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoComment AST nodes: rename getXXXCount() methods to getNumXXXs() to be in line with...
Dmitri Gribenko [Fri, 13 Jul 2012 19:02:42 +0000 (19:02 +0000)]
Comment AST nodes: rename getXXXCount() methods to getNumXXXs() to be in line with Statement AST nodes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160182 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoApply visibility pragmas to class template declarations. This is needed because
Rafael Espindola [Fri, 13 Jul 2012 18:04:45 +0000 (18:04 +0000)]
Apply visibility pragmas to class template declarations. This is needed because
we might use the declaration to build a type before seeing the definition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160176 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUse -fvisibility-inlines-hidden in inline functions too. This matches gcc
Rafael Espindola [Fri, 13 Jul 2012 14:25:36 +0000 (14:25 +0000)]
Use -fvisibility-inlines-hidden in inline functions too. This matches gcc
behavior since gcc pr30066. Thanks to Benjamin Kramer for pointing it out.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160174 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMove helper class into an anonymous namespace.
Benjamin Kramer [Fri, 13 Jul 2012 13:25:11 +0000 (13:25 +0000)]
Move helper class into an anonymous namespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160172 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMention -ftls-model in release notes and manual.
Hans Wennborg [Fri, 13 Jul 2012 12:47:15 +0000 (12:47 +0000)]
Mention -ftls-model in release notes and manual.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160169 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAllows retrieving all files in a CompilationDatabase.
Manuel Klimek [Fri, 13 Jul 2012 12:31:45 +0000 (12:31 +0000)]
Allows retrieving all files in a CompilationDatabase.

Patch by Tobias Koenig, some test changes by myself.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160167 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoProvide a special-case diagnostic when two class member functions instantiate
Richard Smith [Fri, 13 Jul 2012 04:12:04 +0000 (04:12 +0000)]
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 *'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160161 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix a bug in my previous commit. The problem is not that we were not using the
Rafael Espindola [Fri, 13 Jul 2012 01:19:08 +0000 (01:19 +0000)]
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!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160157 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAttaching comments to declarations during parsing: handle more Objective-C declarations.
Dmitri Gribenko [Fri, 13 Jul 2012 01:06:46 +0000 (01:06 +0000)]
Attaching comments to declarations during parsing: handle more Objective-C declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160156 91177308-0d34-0410-b5e6-96231b3b80d8