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

43618 Коммитов

Автор SHA1 Сообщение Дата
Ryan Govostes 4de561f470 [analyzer] Factor common code from {SymSym,SymInt,IntSym}Expr to BinarySymExpr
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179269 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11 06:04:50 +00:00
NAKAMURA Takumi 8ef8f161f6 ARCMigrate/Transforms.h: Remove \arg in comment. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179261 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11 04:16:11 +00:00
John McCall 93b64571e9 Drop ObjCIndirectCopyRestoreExprs during template instantiation.
It's a kind of implicit conversion, which we generally drop, but
more importantly it's got very specific placement requirements.

rdar://13617051

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179254 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11 02:14:26 +00:00
Argyrios Kyrtzidis 411d33aa0b [libclang] Expose record layout info via new libclang functions:
clang_Type_getAlignOf
clang_Type_getSizeOf
clang_Type_getOffsetOf
clang_Cursor_isBitField

Patch by Loïc Jaquemet!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179251 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11 01:20:11 +00:00
Jordan Rose 1fd1e288d0 Force a load when creating a reference to a temporary copied from a bitfield.
For this source:
  const int &ref = someStruct.bitfield;

We used to generate this AST:

  DeclStmt [...]
  `-VarDecl [...] ref 'const int &'
    `-MaterializeTemporaryExpr [...] 'const int' lvalue
      `-ImplicitCastExpr [...] 'const int' lvalue <NoOp>
        `-MemberExpr [...] 'int' lvalue bitfield .bitfield [...]
          `-DeclRefExpr [...] 'struct X' lvalue ParmVar [...] 'someStruct' 'struct X'

Notice the lvalue inside the MaterializeTemporaryExpr, which is very
confusing (and caused an assertion to fire in the analyzer - PR15694).

We now generate this:

  DeclStmt [...]
  `-VarDecl [...] ref 'const int &'
    `-MaterializeTemporaryExpr [...] 'const int' lvalue
      `-ImplicitCastExpr [...] 'int' <LValueToRValue>
        `-MemberExpr [...] 'int' lvalue bitfield .bitfield [...]
          `-DeclRefExpr [...] 'struct X' lvalue ParmVar [...] 'someStruct' 'struct X'

Which makes a lot more sense. This allows us to remove code in both
CodeGen and AST that hacked around this special case.

The commit also makes Clang accept this (legal) C++11 code:

  int &&ref = std::move(someStruct).bitfield

PR15694 / <rdar://problem/13600396>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179250 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11 00:58:58 +00:00
Anton Yartsev 9ae7a92009 [analyzer] Refactoring: better doxygen comment; renaming isTrackedFamily to isTrackedByCurrentChecker
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179242 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11 00:05:20 +00:00
Fariborz Jahanian 75dbdfa6f8 comment parsing. Add couple more needed doxygen tags.
// rdar://12379053


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179238 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 23:10:42 +00:00
Adrian Prantl 01e446be51 get rid of stdio.h include in testcase
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179237 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 23:09:00 +00:00
Adrian Prantl 1fd1403183 add mips target requirement to testcase
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179236 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 23:08:57 +00:00
Anna Zaks 8cf91f7efb [analyzer] Address Jordan’s review of r179219
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179235 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 22:56:33 +00:00
Anna Zaks ee9043ba7c [analyzer] Address Jordan’s code review of r 179221
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179234 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 22:56:30 +00:00
Anton Yartsev 337ad7627c [analyzer] +Testcase: several used-after-free args passed to a function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179232 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 22:36:16 +00:00
Anton Yartsev 55e57a50a3 [analyzer] Switched to checkPreCall interface for detecting usage after free.
Now the check is also applied to arguments for Objective-C method calls and to 'this' pointer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179230 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 22:21:41 +00:00
Jack Carter 6700b003c2 Mips specific inline asm memory operand modifier test case
These changes are based on commit responses for r179135.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179229 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 22:10:45 +00:00
Anna Zaks fececcbc38 [analyzer] Fix a crash in SyntaxCString checker when given a custom strncat.
Fixes PR13476

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179228 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 22:06:29 +00:00
Anna Zaks 7a87e520e4 [analyzer] When reporting a leak in RetainCount checker due to an early exit from init, step into init.
The heuristic here (proposed by Jordan) is that, usually, if a leak is due to an early exit from init, the allocation site will be
a call to alloc. Note that in other cases init resets self to [super init], which becomes the allocation site of the object.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179221 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 21:42:06 +00:00
Anna Zaks 27d99dd714 [analyzer] Cleanup leak warnings: do not print the names of variables from other functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179219 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 21:42:02 +00:00
Eric Christopher 708d72a33d For split dwarf we should also run the objcopy action if we're
just assembling a file and have passed the option.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179218 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 21:30:40 +00:00
Chad Rosier 05422365ba Remove unused arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179217 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 21:30:03 +00:00
Chad Rosier d4fc9de6f7 [driver] Add a -Ofast option, which enables -O3, -ffast-math, and
-fstrict-aliasing.
rdar://13622687


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179216 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 21:26:02 +00:00
Reid Kleckner 2c5a38e3bc FileCheck-ify some clang grep tests that use double quotes
The escaping interaction between Python and grep doesn't work on my
system.  This change fixes the tests for me.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179214 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 21:10:39 +00:00
Dmitri Gribenko 0e7f2bb181 -fparse-all-comments: remove redundant check, as suggested by Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179204 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 18:43:09 +00:00
Chad Rosier b55dd767b2 [ms-inline asm] Move a few test cases from the 32-bit version to the 64-bit
version as lea is only available in 64-bit mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179190 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 18:08:17 +00:00
Chad Rosier a5ceca924c [ms-inline asm] Add a few test cases that were regressed by r179115. That
commit was reverted in r179120, but I do plan on reapplying with a fix shortly.
Part of rdar://13611297


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179182 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 16:33:34 +00:00
Dmitri Gribenko c95468f1a7 Add testcases for -fparse-all-comments
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179181 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 16:31:58 +00:00
Dmitri Gribenko 6fd7d3067d Add an option to parse all comments as documentation comments
Patch by Amin Shali.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179180 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 15:35:17 +00:00
Manuel Klimek 423dd93c80 Fixes recovering from errors when parsing braced init lists.
Before we would build huge unwrapped lines which take a long time
to optimze.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179168 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 09:52:05 +00:00
Daniel Jasper ac3223e45e Fix labels with trailing comments and cleanup.
Before:
class A {
public : // test
};

After:
class A {
public: // test
};

Also remove duplicate methods calculating properties of AnnotatedTokens
and make them members of AnnotatedTokens so that they are in a common
place.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179167 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 09:49:49 +00:00
Ted Kremenek 02be968a08 Handle "typeof" in Objective-C format string checking. This previously crashed.
Yes, this came from actual code.

Fixes <rdar://problem/13557053>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179155 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 06:26:26 +00:00
Richard Smith 0b0ca4724d Add support for computing the exception specification for an inheriting
constructor. This isn't quite perfect (as usual, we don't handle default
arguments correctly yet, and we don't deal with copy/move constructors for
arguments correctly either, but this will be fixed when we implement core issue
1351.

This completes our support for inheriting constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179154 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 06:11:48 +00:00
John McCall 0baaabb717 Don't crash when mangling types defined in ObjC class extensions.
The original test case here was mangling a type name for TBAA,
but we can provoke this in C++11 easily enough.

rdar://13434937

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179153 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 06:08:21 +00:00
Richard Smith 4841ca5f83 C++11 inheriting constructors: support for inheriting constructor templates.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179151 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 05:48:59 +00:00
Douglas Gregor 7e0c22714e <rdar://problem/13605348> Don't consider invalid user-defined literal operators during overload resolution.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179150 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 05:18:00 +00:00
Argyrios Kyrtzidis 03409967bd [frontend] -frewrite-includes: turn implicit module imports into @imports.
rdar://13610250

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179145 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 01:53:50 +00:00
Argyrios Kyrtzidis 15aa81a474 [frontend] When preprocessing, turn implicit module imports into @imports.
part of rdar://13610250

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179144 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 01:53:46 +00:00
Argyrios Kyrtzidis 507d496e18 [frontend] -frewrite-includes: if there was no inclusion, don't add lineinfo that indicates return from another file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179143 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 01:53:37 +00:00
Michael Ilseman 60c99d34cf Repeat some #line directive tests for the GNU line marker directive.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179142 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 01:41:19 +00:00
Michael Ilseman ec27608da7 Improve the diagnostics of the number-reading preprocessor directives.
The GNU line marker directive was sharing code with the #line directive, but some of the warnings/errors were reporting as #line directive diagnostics in both cases.

Previously:
#line 11foo1   ==> "#line directive requires a simple digit sequence"
# 11foo1       ==> "#line directive requires a simple digit sequence"

Now, we get:
#line 11foo1   ==> "#line directive requires a simple digit sequence"
# 11foo1       ==> "GNU line marker directive requires a simple digit sequence"




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179139 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 01:04:18 +00:00
Matt Beaumont-Gay 19b6a707a8 Suppress -Wunused-variable for variables declared in headers, which may in
fact be defined and used in another TU.

Reshuffle some test cases because we suppress -Wunused-variable after we've
emitted an error.

This fixes PR15558.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179138 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-10 00:47:10 +00:00
Richard Trieu 8da488dc0b Remove outdated run lines from tests.
These run lines originally tested that the fix-its were properly applied.
Originally, the fixits were attached to warnings and were applied by -fixit.
Now, the fixits are attached to notes, so nothing happens.  These run lines
still manage to pass since Clang will produce an empty output which gets piped
back to Clang.  Then Clang produces no error on an empty input.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179131 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-09 22:06:27 +00:00
Edwin Vane 1cf97e71de Updating cpp11-migrate transform list in ClangTools docs
Author: Philip Dunstan <phil@phildunstan.com>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179128 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-09 20:51:47 +00:00
Edwin Vane 5771a2f083 Adding new AST Matchers isVirtual and isOverride
isVirtual - matches CXXMethodDecl nodes for virtual methods
isOverride - matches CXXMethodDecl nodes for methods that override virtual methods from a base class.

Author: Philip Dunstan <phil@philipdunstan.com>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179126 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-09 20:46:36 +00:00
Argyrios Kyrtzidis cd6dcb3434 [c-index-test] Enable 'display diagnostics' when using the -test-load functionality.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179123 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-09 20:29:24 +00:00
Argyrios Kyrtzidis 84347225fc [libclang] In cxtu::getASTUnit(), check for a null CXTranslationUnit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179121 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-09 20:03:03 +00:00
Fariborz Jahanian 3c9a0240b6 Objective-C: This patch fixes a none-issuance of warning
when result type of protocol property and getter method
differ by fixing a more serious problem. When a forward
protocol declaration comes between its definition and
its use in class protocol list, the forward protocol
ast was being used in building the protocol list.
// rdar://12522752


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179108 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-09 17:52:29 +00:00
Daniel Jasper 5999f7634e Fix comments before labels.
Before:
switch (...) {
  // a
  // b
// c
case first:
  break;
}

After:
switch (...) {
// a
// b
// c
case first:
  break;
}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179107 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-09 17:46:55 +00:00
Alexander Kornienko 99b0e14691 Again macros without trailing semicolons: don't care about declaration context.
Summary:
Some codebases use these kinds of macros in functions, e.g. Chromium's
IPC_BEGIN_MESSAGE_MAP, IPC_BEGIN_MESSAGE_HANDLER, etc.

Reviewers: djasper, klimek

Reviewed By: klimek

CC: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179099 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-09 16:15:19 +00:00
Daniel Jasper 63911838bf Improvements to clang-format integrations.
This adds an emacs editor integration (thanks to Ami Fischman). Also
pulls out the style into a variable for the vi integration and just
uses clang-formats defaults style in clang-format-diff.py.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179098 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-09 15:23:04 +00:00
Rafael Espindola 40db5155fb Mention the changes in the handling of language linkage in the release notes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179094 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-09 12:51:24 +00:00
Reid Kleckner cb5949d1cd [ms-cxxabi] Add "$$C" when mangling template arg QualTypes
Credit goes to Timur Iskhodzhanov for finding the problem and solution.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179093 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-09 12:47:38 +00:00