]> granicus.if.org Git - clang/log
clang
11 years agoCGValue.h: Update one \param to Addr in MakeBitfield(). [-Wdocumentation]
NAKAMURA Takumi [Mon, 24 Dec 2012 01:48:48 +0000 (01:48 +0000)]
CGValue.h: Update one \param to Addr in MakeBitfield(). [-Wdocumentation]

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

11 years agotest/Index/preamble_macro_template.cpp: Tweak for win32.
NAKAMURA Takumi [Mon, 24 Dec 2012 01:23:48 +0000 (01:23 +0000)]
test/Index/preamble_macro_template.cpp: Tweak for win32.

Using the file immediately after "> file 2>&1" causes weird behavior on win32.
For example, "foo > %t 2>&1; FileCheck --input-file=%t"

Use "foo 2>&1 | tee %t" instead.

Note, mixing stdout and stderr to the same handle might cause unexpected behavior, due to buffering.

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

11 years agoTake operator precedence into account when splitting lines.
Daniel Jasper [Mon, 24 Dec 2012 00:13:23 +0000 (00:13 +0000)]
Take operator precedence into account when splitting lines.

With this patch, splitting after binary operators has a panelty corresponding
to the operator's precedence. We used to ignore this and eagerly format like:

  if (aaaaaaaaaaaaaaaaaaaaaaaaa || bbbbbbbbbbbbbbbbbbbbbbbbb &&
      ccccccccccccccccccccccccc) { .. }

With this patch, this becomes:

  if (aaaaaaaaaaaaaaaaaaaaaaaaa ||
      bbbbbbbbbbbbbbbbbbbbbbbbb && ccccccccccccccccccccccccc) { .. }

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

11 years agoDocumentation: PTHInternals: use correct adornments and fix typos
Dmitri Gribenko [Sun, 23 Dec 2012 18:39:54 +0000 (18:39 +0000)]
Documentation: PTHInternals: use correct adornments and fix typos

Fixes PR14014

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

11 years agoDocumentation: fix a syntax error: empty line required after code-block::
Dmitri Gribenko [Sun, 23 Dec 2012 18:36:44 +0000 (18:36 +0000)]
Documentation: fix a syntax error: empty line required after code-block::

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

11 years agoDocumentation: add MemorySanitizer to the toctree
Dmitri Gribenko [Sun, 23 Dec 2012 18:35:58 +0000 (18:35 +0000)]
Documentation: add MemorySanitizer to the toctree

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

11 years agodocs: Convert ReleaseNotes to reST.
Sean Silva [Sun, 23 Dec 2012 01:19:35 +0000 (01:19 +0000)]
docs: Convert ReleaseNotes to reST.

This is the last of the "regular" documents to convert to reST, and so
I'm declaring the initial clang reST conversion "done".

However,

- There are some documents in clang/www/ which probably should
  be migrated into clang/docs/, such as www/OpenProjects.html

  The primary thing blocking me from doing this right now is not knowing
  how to set up a redirect so that the old URL's continue to work.

- LibASTMatchersReference.html is not reST. This page is auto-generated
  by clang/docs/tools/dump_ast_matchers.py from the source and has some
  collapse/expand logic that isn't expressible directly with Sphinx, so
  just converting it to reST is not really a good strategy.

  Manuel Klimek and I discussed this and the general agreed-upon
  direction is making that page data-driven so that it, say, pulls in an
  auto-generated blob of JSON which describes the matchers and builds up
  the "matcher reference" part of the page with a small amount of JS.

- There are some rogue .txt files hanging around.

Also, I dropped the little dragon logo at the top because Sphinx was
warning about an external image reference (not sure why, but meh, I
didn't want to fight it). If anything, we would want such a logo
integrated into the site's overall theme, rather than hardcoded here.

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

11 years agolibFormat: Teach the *& usage heuristic that "return" starts a rhs too.
Nico Weber [Sun, 23 Dec 2012 01:07:46 +0000 (01:07 +0000)]
libFormat: Teach the *& usage heuristic that "return" starts a rhs too.

"return a*b;" was formatted as "return a *b;" and is now formatted as "return a * b;".

Fixes PR14687 partially.

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

11 years agoMove a declaration closer to its use. No functionality change.
Nico Weber [Sun, 23 Dec 2012 00:40:46 +0000 (00:40 +0000)]
Move a declaration closer to its use. No functionality change.

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

11 years agoClean out release notes for clang 3.3
Benjamin Kramer [Sat, 22 Dec 2012 16:12:31 +0000 (16:12 +0000)]
Clean out release notes for clang 3.3

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

11 years ago[libclang] Fix crash when code-completing a macro invocation that
Argyrios Kyrtzidis [Sat, 22 Dec 2012 04:48:10 +0000 (04:48 +0000)]
[libclang] Fix crash when code-completing a macro invocation that
reached EOF and did not expand the argument into the source context.

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

11 years ago[libclang] Don't try to translate diagnostics from the precompiled preamble to the
Argyrios Kyrtzidis [Sat, 22 Dec 2012 04:48:08 +0000 (04:48 +0000)]
[libclang] Don't try to translate diagnostics from the precompiled preamble to the
code-completion results, the SourceManager state may be slightly
different when code-completing.

And we don't even care for diagnostics when code-completing, anyway.

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

11 years ago[libclang] Check for the 'LIBCLANG_NOTHREADS' environment variable before creating
Argyrios Kyrtzidis [Sat, 22 Dec 2012 04:48:07 +0000 (04:48 +0000)]
[libclang] Check for the 'LIBCLANG_NOTHREADS' environment variable before creating
a separate thread for code-completion.

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

11 years agoPR14695: Fix assert from bad cast<>. Not every namespace is a NamespaceDecl; it might...
Richard Smith [Sat, 22 Dec 2012 02:46:14 +0000 (02:46 +0000)]
PR14695: Fix assert from bad cast<>. Not every namespace is a NamespaceDecl; it might instead be a TranslationUnitDecl.

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

11 years agoAdd back -Wduplicate-enum which I mistakenly removed.
Ted Kremenek [Sat, 22 Dec 2012 01:34:09 +0000 (01:34 +0000)]
Add back -Wduplicate-enum which I mistakenly removed.

This was removed with -Wunique-enum, which is still removed.  The
corresponding thread on cfe-comments for that warning is here:

  http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-September/024224.html

If we get specific user feedback for -Wduplicate-enum we can evaluate
whether or not to keep it.

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

11 years agoFix typo: objc_no_direct_instance_variable_assignmemt => objc_no_direct_instance_vari...
Ted Kremenek [Sat, 22 Dec 2012 00:34:48 +0000 (00:34 +0000)]
Fix typo: objc_no_direct_instance_variable_assignmemt => objc_no_direct_instance_variable_assignment.

Fixes <rdar://problem/12927551>.

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

11 years ago[analyzer] Convert SimpleStreamChecker to use the PointerEscape callback
Anna Zaks [Sat, 22 Dec 2012 00:18:39 +0000 (00:18 +0000)]
[analyzer] Convert SimpleStreamChecker to use the PointerEscape callback

The new callback greatly simplifies the checker.

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

11 years agoUse a safe default width for template-diff'ing integral arguments, in
Douglas Gregor [Fri, 21 Dec 2012 23:03:27 +0000 (23:03 +0000)]
Use a safe default width for template-diff'ing integral arguments, in
case we can't find an exact width to use. Fixes crash in
<rdar://problem/12456626>.

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

11 years agoAdding to FormatTest.cpp test for a very long ObjC method
Fariborz Jahanian [Fri, 21 Dec 2012 22:51:18 +0000 (22:51 +0000)]
Adding to FormatTest.cpp test for a very long ObjC method
declaration requiring formatting of wrap-arounds.

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

11 years agoTweak Sema::CheckLiteralKind() to also include block literals
Ted Kremenek [Fri, 21 Dec 2012 22:46:35 +0000 (22:46 +0000)]
Tweak Sema::CheckLiteralKind() to also include block literals

This simplifies some diagnostic logic in checkUnsafeAssignLiteral(),
hopefully making it less error prone.

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

11 years agoInsulate this test from the whims of the random number generator.
Matt Beaumont-Gay [Fri, 21 Dec 2012 22:43:20 +0000 (22:43 +0000)]
Insulate this test from the whims of the random number generator.

Our internal buildbot just failed because the tempfile happened to be named
'nodefaultlib-lcGA7k.o', which contains the substring '-lc'.

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

11 years agoAdd comments back that were accidentally removed in r170933.
Chad Rosier [Fri, 21 Dec 2012 22:38:37 +0000 (22:38 +0000)]
Add comments back that were accidentally removed in r170933.

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

11 years agoFix a warning due to an extraneous comma.
Chad Rosier [Fri, 21 Dec 2012 22:33:20 +0000 (22:33 +0000)]
Fix a warning due to an extraneous comma.

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

11 years agoRemove unused arguments and rename to conform to coding standards.
Chad Rosier [Fri, 21 Dec 2012 22:24:43 +0000 (22:24 +0000)]
Remove unused arguments and rename to conform to coding standards.

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

11 years agoChange checkUnsafeAssignLiteral() to use the new Sema::CheckLiteralKind().
Ted Kremenek [Fri, 21 Dec 2012 21:59:39 +0000 (21:59 +0000)]
Change checkUnsafeAssignLiteral() to use the new Sema::CheckLiteralKind().

Along the way, fix a bug in CheckLiteralKind(), previously in diagnoseObjCLiteralComparison, where we didn't ignore parentheses
in boxed expressions for purpose of classification.

In other words, both @42 and @(42) should be classified as numeric
literals.

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

11 years agoHoist logic for classifying Objective-C literals into Sema (proper) for use with...
Ted Kremenek [Fri, 21 Dec 2012 21:59:36 +0000 (21:59 +0000)]
Hoist logic for classifying Objective-C literals into Sema (proper) for use with other diagnostics.

No immediate (intended) functionality change.

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

11 years agoSwitch FrontendOptions to using an initializer list rather than initializing
Richard Smith [Fri, 21 Dec 2012 21:52:01 +0000 (21:52 +0000)]
Switch FrontendOptions to using an initializer list rather than initializing
the values in the constructor.  The constructor implementation is trivial
beyond the value initialisations. Patch by Saleem Abdulrasool!

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

11 years agoFixes couple of friend declaration -ast-print bug
Fariborz Jahanian [Fri, 21 Dec 2012 21:43:05 +0000 (21:43 +0000)]
Fixes couple of friend declaration -ast-print bug
found by running -ast-print on all-std-headers.cpp
which caused it to go into infinite loop. Now
-ast-print prints all declarations found in
all-std-headers.cpp.

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

11 years agoIndent.
Chad Rosier [Fri, 21 Dec 2012 21:27:13 +0000 (21:27 +0000)]
Indent.

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

11 years agoRemove unnecessary checks.
Chad Rosier [Fri, 21 Dec 2012 21:22:20 +0000 (21:22 +0000)]
Remove unnecessary checks.

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

11 years agoUse descriptive enum instead of raw integers for checkUnsafeAssignLiteral().
Ted Kremenek [Fri, 21 Dec 2012 19:45:33 +0000 (19:45 +0000)]
Use descriptive enum instead of raw integers for checkUnsafeAssignLiteral().

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

11 years agoSink call to checkUnsafeAssignLiteral() into checkUnsafeAssignObject().
Ted Kremenek [Fri, 21 Dec 2012 19:45:30 +0000 (19:45 +0000)]
Sink call to checkUnsafeAssignLiteral() into checkUnsafeAssignObject().

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

11 years agoFix indent.
Chad Rosier [Fri, 21 Dec 2012 19:43:33 +0000 (19:43 +0000)]
Fix indent.

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

11 years ago[analyzer] Don't perform an expensive assertion in release builds.
Jordan Rose [Fri, 21 Dec 2012 18:26:48 +0000 (18:26 +0000)]
[analyzer] Don't perform an expensive assertion in release builds.

Unfortunately, we don't seem to have a standard way to do this. I'm using
the __OPTIMIZE__ GNU extension that Clang also defines, but that doesn't
help MSVC. I suppose we could remove the check entirely, but it's useful
for developing new constraint managers.

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

11 years agoformat: Handle #import as include directive too.
Nico Weber [Fri, 21 Dec 2012 18:21:56 +0000 (18:21 +0000)]
format: Handle #import as include directive too.

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

11 years agoAdd a testcase for ARM cortex-r5 subtarget
Quentin Colombet [Fri, 21 Dec 2012 18:00:32 +0000 (18:00 +0000)]
Add a testcase for ARM cortex-r5 subtarget

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

11 years agoclang-format: No spaces around directory specifiers
Daniel Jasper [Fri, 21 Dec 2012 17:58:39 +0000 (17:58 +0000)]
clang-format: No spaces around directory specifiers

This fixes PR14683. We used to format like this:
  #include <a / b>

And this patch changes this to:
  #include <a/b>

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

11 years agoAdd ARM cortex-r5 subtarget as available mcpu
Quentin Colombet [Fri, 21 Dec 2012 17:57:47 +0000 (17:57 +0000)]
Add ARM cortex-r5 subtarget as available mcpu

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

11 years ago[analyzer] Fix typos.
Anna Zaks [Fri, 21 Dec 2012 17:27:04 +0000 (17:27 +0000)]
[analyzer] Fix typos.

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

11 years ago[analyzer] Re-apply r170826 and make the dumping of the GallGraph
Anna Zaks [Fri, 21 Dec 2012 17:27:01 +0000 (17:27 +0000)]
[analyzer] Re-apply r170826 and make the dumping of the GallGraph
deterministic.

Commit message for r170826:

[analyzer] Traverse the Call Graph in topological order.

Modify the call graph by removing the parentless nodes. Instead all
nodes are children of root to ensure they are all reachable. Remove the
tracking of nodes that are "top level" or global. This information is
not used and can be obtained from the Decls stored inside
CallGraphNodes.

Instead of existing ordering hacks, analyze the functions in topological
order over the Call Graph.

Together with the addition of devirtualizable ObjC message sends and
blocks to the call graph, this gives around 6% performance improvement
on several large ObjC benchmarks.

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

11 years agoSort the includes according to the coding standard.
Roman Divacky [Fri, 21 Dec 2012 17:23:52 +0000 (17:23 +0000)]
Sort the includes according to the coding standard.

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

11 years agoFix typo.
Fariborz Jahanian [Fri, 21 Dec 2012 17:14:23 +0000 (17:14 +0000)]
Fix typo.

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

11 years agoRemove duplicate includes.
Roman Divacky [Fri, 21 Dec 2012 17:07:08 +0000 (17:07 +0000)]
Remove duplicate includes.

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

11 years agoBasic support for formatting for-loops.
Daniel Jasper [Fri, 21 Dec 2012 14:37:20 +0000 (14:37 +0000)]
Basic support for formatting for-loops.

We used to not really format them. Now we do:

  for (MachineBasicBlock::succ_iterator SI = BB->succ_begin(),
                                        SE = BB->succ_end();
       SI != SE; ++SI) {

This is just one example and I am sure we still mess some of them up, but it
is a step forward.

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

11 years agoUpdate comments.
Rafael Espindola [Fri, 21 Dec 2012 13:22:55 +0000 (13:22 +0000)]
Update comments.

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

11 years agoTemporary fix of tests to make buildbots happy.
Daniel Jasper [Fri, 21 Dec 2012 12:10:20 +0000 (12:10 +0000)]
Temporary fix of tests to make buildbots happy.

Permanent solution coming up after checking back with Fariborz/Douglas.

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

11 years agoSlight rewording of -fsanitize=memory docs.
Evgeniy Stepanov [Fri, 21 Dec 2012 10:53:20 +0000 (10:53 +0000)]
Slight rewording of -fsanitize=memory docs.

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

11 years agoUser manual chapter on MemorySanitizer.
Evgeniy Stepanov [Fri, 21 Dec 2012 10:50:00 +0000 (10:50 +0000)]
User manual chapter on MemorySanitizer.

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

11 years agoUse OperatorPrecedence.h in clang-format
Daniel Jasper [Fri, 21 Dec 2012 10:20:02 +0000 (10:20 +0000)]
Use OperatorPrecedence.h in clang-format

No indented functional changes other than handling more operators
correctly.

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

11 years agoFormatting fixes for PR14680
Daniel Jasper [Fri, 21 Dec 2012 09:41:31 +0000 (09:41 +0000)]
Formatting fixes for PR14680

Also, some (automated) formatting fixes and slight cleanups.

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

11 years agoRemove the working that ThreadSanitizer is *experimental*.
Dmitry Vyukov [Fri, 21 Dec 2012 08:21:25 +0000 (08:21 +0000)]
Remove the working that ThreadSanitizer is *experimental*.

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

11 years agoFix regression in r170489: when instantiating a direct initializer which is a
Richard Smith [Fri, 21 Dec 2012 08:13:35 +0000 (08:13 +0000)]
Fix regression in r170489: when instantiating a direct initializer which is a
CXXScalarValueInitExpr (or an ImplicitValueInitExpr), strip it back down to an
empty pair of parentheses so that the initialization code can tell that we're
performing value-initialization.

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

11 years agoExtend checkUnsafeAssigns() to also handle assigning an object literal to a weak...
Ted Kremenek [Fri, 21 Dec 2012 08:04:28 +0000 (08:04 +0000)]
Extend checkUnsafeAssigns() to also handle assigning an object literal to a weak reference.

Thanks to Jordan Rose and John McCall for their sage code review.

Fixes <rdar://problem/12569201>.

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

11 years agoRefactor checkUnsafeAssigns() to avoid code duplication with while loop.
Ted Kremenek [Fri, 21 Dec 2012 08:04:20 +0000 (08:04 +0000)]
Refactor checkUnsafeAssigns() to avoid code duplication with while loop.

This is just a minor bit of refactoring, but it is nice cleanup for
the subsequent patch that adds warning support for assigning literals
to weak variables.

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

11 years agoReinstate r170806, reverted in r170835, with a fix use i1 instead of i8 for a value...
Richard Smith [Fri, 21 Dec 2012 03:17:28 +0000 (03:17 +0000)]
Reinstate r170806, reverted in r170835, with a fix use i1 instead of i8 for a value-initialized bool!

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

11 years agoRevert r170806, "Fix some bugs where we would sometimes use 0, not -1, when emitting...
NAKAMURA Takumi [Fri, 21 Dec 2012 02:50:38 +0000 (02:50 +0000)]
Revert r170806, "Fix some bugs where we would sometimes use 0, not -1, when emitting a null constant of type pointer-to-data-member."

It broke stage2.

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

11 years ago[libclang] Follow-up to r170824, provide the correct number of arguments for
Argyrios Kyrtzidis [Fri, 21 Dec 2012 01:51:12 +0000 (01:51 +0000)]
[libclang] Follow-up to r170824, provide the correct number of arguments for
a not-fully-formed macro invocation during code-completion.

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

11 years ago[analyzer] Address Jordan's nitpicks as per code review of r170625.
Anna Zaks [Fri, 21 Dec 2012 01:50:14 +0000 (01:50 +0000)]
[analyzer] Address Jordan's nitpicks as per code review of r170625.

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

11 years agoRevert r170826. The output of
Rafael Espindola [Fri, 21 Dec 2012 01:30:23 +0000 (01:30 +0000)]
Revert r170826. The output of

./bin/clang -cc1 -internal-isystem /home/espindola/llvm/build/lib/clang/3.3/include/ -analyze -analyzer-checker=debug.DumpCallGraph /home/espindola/llvm/clang/test/Analysis/debug-CallGraph.c -fblocks

changes in each run.

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

11 years agoDon't eagerly emit a global static merged with a local extern.
Rafael Espindola [Fri, 21 Dec 2012 01:21:33 +0000 (01:21 +0000)]
Don't eagerly emit a global static merged with a local extern.

When we are visiting the extern declaration of 'i' in

static int i = 99;
int foo() {
  extern int i;
  return i;
}

We should not try to handle it as if it was an function static. That is, we
must consider the written storage class.

Fixing this then exposes that the assert in EmitGlobalVarDeclLValue and the
if leading to its call are not completely accurate. They were passing before
because the second decl was marked as having external storage. I changed them
to check the linkage, which I find easier to understand.

Last but not least, there is something strange going on with cuda and opencl.
My guess is that the linkage computation for these languages needs to be
audited, but I didn't want to change that in this patch so I just updated
the storage classes to keep the current behavior.

Thanks to Reed Kotler for reporting this.

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

11 years ago[analyzer] Traverse the Call Graph in topological order.
Anna Zaks [Fri, 21 Dec 2012 01:19:22 +0000 (01:19 +0000)]
[analyzer] Traverse the Call Graph in topological order.

Modify the call graph by removing the parentless nodes. Instead all
nodes are children of root to ensure they are all reachable. Remove the
tracking of nodes that are "top level" or global. This information is
not used and can be obtained from the Decls stored inside
CallGraphNodes.

Instead of existing ordering hacks, analyze the functions in topological
order over the Call Graph.

Together with the addition of devirtualizable ObjC message sends and
blocks to the call graph, this gives around 6% performance improvement
on several large ObjC benchmarks.

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

11 years ago[analyzer] Add blocks and ObjC messages to the call graph.
Anna Zaks [Fri, 21 Dec 2012 01:19:15 +0000 (01:19 +0000)]
[analyzer] Add blocks and ObjC messages to the call graph.

This paves the road for constructing a better function dependency graph.
If we analyze a function before the functions it calls and inlines,
there is more opportunity for optimization.

Note, we add call edges to the called methods that correspond to
function definitions (declarations with bodies).

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

11 years ago[libclang] Make sure we can code-complete inside a macro argument even though
Argyrios Kyrtzidis [Fri, 21 Dec 2012 01:17:20 +0000 (01:17 +0000)]
[libclang] Make sure we can code-complete inside a macro argument even though
the macro invocation is not fully formed.

rdar://11290992

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

11 years agoEditedSource.cpp: Appease msvc, to add <cctype>.
NAKAMURA Takumi [Fri, 21 Dec 2012 00:21:02 +0000 (00:21 +0000)]
EditedSource.cpp: Appease msvc, to add <cctype>.

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

11 years agodocs: Convert ObjectiveCLiterals to reST.
Sean Silva [Fri, 21 Dec 2012 00:17:02 +0000 (00:17 +0000)]
docs: Convert ObjectiveCLiterals to reST.

Sphinx's syntax highlighter doesn't recognize the new literals, so the
syntax highlighting is pretty pathetic.

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

11 years agodocs: fix Sphinx toctree warning.
Sean Silva [Fri, 21 Dec 2012 00:16:58 +0000 (00:16 +0000)]
docs: fix Sphinx toctree warning.

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

11 years agodocs: Convert DriverInternals to reST.
Sean Silva [Fri, 21 Dec 2012 00:16:53 +0000 (00:16 +0000)]
docs: Convert DriverInternals to reST.

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

11 years agoFix some bugs where we would sometimes use 0, not -1, when emitting a null constant...
Richard Smith [Thu, 20 Dec 2012 23:49:09 +0000 (23:49 +0000)]
Fix some bugs where we would sometimes use 0, not -1, when emitting a null constant of type pointer-to-data-member.

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

11 years agoRevert r170801, which breaks the mingw build.
Douglas Gregor [Thu, 20 Dec 2012 23:36:52 +0000 (23:36 +0000)]
Revert r170801, which breaks the mingw build.

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

11 years agoEliminate errors when running the 'PrintFunctionNames' plugin, from Li Qun!
Douglas Gregor [Thu, 20 Dec 2012 23:11:42 +0000 (23:11 +0000)]
Eliminate errors when running the 'PrintFunctionNames' plugin, from Li Qun!

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

11 years agoRevert "Warn if a __weak variable is initialized with an Objective-C object literal."
Ted Kremenek [Thu, 20 Dec 2012 22:31:27 +0000 (22:31 +0000)]
Revert "Warn if a __weak variable is initialized with an Objective-C object literal."

Per code feedback, I want to see if there is a more general way to do this.

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

11 years agoUse some heuristics so that when a fixit removes a source range, we try
Argyrios Kyrtzidis [Thu, 20 Dec 2012 21:05:53 +0000 (21:05 +0000)]
Use some heuristics so that when a fixit removes a source range, we try
to also remove a trailing space if possible.

For example, removing '__bridge' from:

i = (__bridge I*)p;

should result in:

i = (I*)p;

not:

i = ( I*)p;

rdar://11314821

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

11 years agoWarn if a __weak variable is initialized with an Objective-C object literal.
Ted Kremenek [Thu, 20 Dec 2012 20:55:03 +0000 (20:55 +0000)]
Warn if a __weak variable is initialized with an Objective-C object literal.

Such variables may immediately become nil or may have unpredictable
behavior.

Fixes <rdar://problem/12569201>.

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

11 years agoDocumentation: use monospaced font in BlockLanguageSpec, and fix a link to this
Dmitri Gribenko [Thu, 20 Dec 2012 20:51:59 +0000 (20:51 +0000)]
Documentation: use monospaced font in BlockLanguageSpec, and fix a link to this
document

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

11 years agoUse the MaybeParseMicrosoftAttributes function.
Chad Rosier [Thu, 20 Dec 2012 20:37:53 +0000 (20:37 +0000)]
Use the MaybeParseMicrosoftAttributes function.

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

11 years agoRemove namespace qualifier that lead to build breakage.
Daniel Jasper [Thu, 20 Dec 2012 20:31:38 +0000 (20:31 +0000)]
Remove namespace qualifier that lead to build breakage.

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

11 years agoMove operator precedence calculation to new header
Daniel Jasper [Thu, 20 Dec 2012 20:25:19 +0000 (20:25 +0000)]
Move operator precedence calculation to new header

Thereby, it can be reused by clang-format and others.
Review: http://llvm-reviews.chandlerc.com/D229

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

11 years agoAdd objective-C style formatting to clang format and
Fariborz Jahanian [Thu, 20 Dec 2012 19:54:13 +0000 (19:54 +0000)]
Add objective-C style formatting to clang format and
use it to format xml declaration tags.
// rdar://12378714

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

11 years agoUpdate RetainCountChecker to understand attribute ns_returns_autoreleased.
Ted Kremenek [Thu, 20 Dec 2012 19:36:22 +0000 (19:36 +0000)]
Update RetainCountChecker to understand attribute ns_returns_autoreleased.

Fixes <rdar://problem/12887356>.

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

11 years agoAttribute 'cf_returns_autoreleased' doesn't really exist.
Ted Kremenek [Thu, 20 Dec 2012 19:36:20 +0000 (19:36 +0000)]
Attribute 'cf_returns_autoreleased' doesn't really exist.

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

11 years agoRename llvm::Attributes to llvm::Attribute.
Bill Wendling [Thu, 20 Dec 2012 19:27:06 +0000 (19:27 +0000)]
Rename llvm::Attributes to llvm::Attribute.

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

11 years agoRevert r170500. It over-zealously converted *ALL* things named Attributes, which...
Bill Wendling [Thu, 20 Dec 2012 19:22:21 +0000 (19:22 +0000)]
Revert r170500. It over-zealously converted *ALL* things named Attributes, which is wrong here.

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

11 years agoFix Generic_GCC::GCCVersion::operator<
Rafael Espindola [Thu, 20 Dec 2012 16:15:07 +0000 (16:15 +0000)]
Fix Generic_GCC::GCCVersion::operator<

Without this patch comparing two equal versions without patch numbers (4.7 for
example) will result in A < B and B < A.

Patch by Simon Atanasyan.

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

11 years agoc-index-test/Makefile: Add clangFormat to USEDLIBS for libclang-unavailable hosts.
NAKAMURA Takumi [Thu, 20 Dec 2012 13:30:10 +0000 (13:30 +0000)]
c-index-test/Makefile: Add clangFormat to USEDLIBS for libclang-unavailable hosts.

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

11 years agoc-index-test/Makefile: Reformat.
NAKAMURA Takumi [Thu, 20 Dec 2012 13:30:05 +0000 (13:30 +0000)]
c-index-test/Makefile: Reformat.

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

11 years agoMinor coding style issue: NULL -> 0
Alexander Kornienko [Thu, 20 Dec 2012 12:23:54 +0000 (12:23 +0000)]
Minor coding style issue: NULL -> 0

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

11 years agoAdd __has_feature(memory_sanitizer).
Evgeniy Stepanov [Thu, 20 Dec 2012 12:03:13 +0000 (12:03 +0000)]
Add __has_feature(memory_sanitizer).

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

11 years agoASTDumper coding style fixes.
Alexander Kornienko [Thu, 20 Dec 2012 11:08:38 +0000 (11:08 +0000)]
ASTDumper coding style fixes.
http://llvm-reviews.chandlerc.com/D226

Patch by Philip Craig!

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

11 years agoclang/test/Driver/warning-options.cpp: Appease MSYS bash.
NAKAMURA Takumi [Thu, 20 Dec 2012 11:08:13 +0000 (11:08 +0000)]
clang/test/Driver/warning-options.cpp: Appease MSYS bash.

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

11 years agoclang/test/Misc/ast-dump-decl.c: Add triple. __thread is not supported on all targets.
NAKAMURA Takumi [Thu, 20 Dec 2012 03:30:30 +0000 (03:30 +0000)]
clang/test/Misc/ast-dump-decl.c: Add triple. __thread is not supported on all targets.

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

11 years agoUpdated link in LanguageExtensions.rst to point to BlockLanguageSpec.rst instead...
Michael Gottesman [Thu, 20 Dec 2012 03:23:52 +0000 (03:23 +0000)]
Updated link in LanguageExtensions.rst to point to BlockLanguageSpec.rst instead of BlockLanguageSpec.txt.

Thanks to Jean-Daniel Dupas for comments!

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

11 years agoChanged UTF-8 emdashes to --- ala Dmitri Gribenko's comments.
Michael Gottesman [Thu, 20 Dec 2012 03:23:49 +0000 (03:23 +0000)]
Changed UTF-8 emdashes to --- ala Dmitri Gribenko's comments.

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

11 years agoFix another uninitialized bool member bug found by -fsanitize=bool. This one
Richard Smith [Thu, 20 Dec 2012 02:47:01 +0000 (02:47 +0000)]
Fix another uninitialized bool member bug found by -fsanitize=bool. This one
appears to currently be benign (we happen to test the flags in the right
order, so we never depend on the uninitialized value).

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

11 years agoRobustify the @encode code and add support for _Atomic.
John McCall [Thu, 20 Dec 2012 02:45:14 +0000 (02:45 +0000)]
Robustify the @encode code and add support for _Atomic.

Fixes PR14628.

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

11 years agoFix code that attempted to produce a diagnostic with one DiagnosticEngine, then
Richard Smith [Thu, 20 Dec 2012 02:22:15 +0000 (02:22 +0000)]
Fix code that attempted to produce a diagnostic with one DiagnosticEngine, then
produce a note for that diagnostic either with a different DiagnosticEngine or
after calling DiagnosticEngine::Reset(). That didn't make any sense, and did the
wrong thing if the original diagnostic was suppressed.

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

11 years agoProvide couple of DeclPrint tests for my last patch.
Fariborz Jahanian [Thu, 20 Dec 2012 02:20:09 +0000 (02:20 +0000)]
Provide couple of DeclPrint tests for my last patch.

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

11 years agoImplement AST dumper for Decls.
Alexander Kornienko [Thu, 20 Dec 2012 02:09:13 +0000 (02:09 +0000)]
Implement AST dumper for Decls.
http://llvm-reviews.chandlerc.com/D52

Patch by Philip Craig!

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

11 years ago[analyzer] Add the pointer escaped callback.
Anna Zaks [Thu, 20 Dec 2012 00:38:25 +0000 (00:38 +0000)]
[analyzer] Add the pointer escaped callback.

Instead of using several callbacks to identify the pointer escape event,
checkers now can register for the checkPointerEscape.

Converted the Malloc checker to use the new callback.
SimpleStreamChecker will be converted next.

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

11 years ago[preprocessor] When "merging" macro argument tokens into one SLocEntry chunk,
Argyrios Kyrtzidis [Wed, 19 Dec 2012 23:55:44 +0000 (23:55 +0000)]
[preprocessor] When "merging" macro argument tokens into one SLocEntry chunk,
make sure they came from the same kind of FileIDs.

Thanks to Abramo Bagnara for providing the test case.

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

11 years agoTypo.
Chad Rosier [Wed, 19 Dec 2012 23:47:16 +0000 (23:47 +0000)]
Typo.

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