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

43694 Коммитов

Автор SHA1 Сообщение Дата
Jordan Rose 6026df1e5d [analyzer] Fix grammar in comment.
By Adam Schnitzer!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179352 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 00:44:24 +00:00
Jordan Rose 7be2245487 [analyzer] Show "Returning from ..." note at caller's depth, not callee's.
Before:
  1. Calling 'foo'
    2. Doing something interesting
    3. Returning from 'foo'
  4. Some kind of error here

After:
  1. Calling 'foo'
    2. Doing something interesting
  3. Returning from 'foo'
  4. Some kind of error here

The location of the note is already in the caller, not the callee, so this
just brings the "depth" attribute in line with that.

This only affects plist diagnostic consumers (i.e. Xcode). It's necessary
for Xcode to associate the control flow arrows with the right stack frame.

<rdar://problem/13634363>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179351 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 00:44:17 +00:00
Jordan Rose 3ea09a802f [analyzer] Don't emit extra context arrow after returning from an inlined call.
In this code

  int getZero() {
    return 0;
  }

  void test() {
    int problem = 1 / getZero(); // expected-warning {{Division by zero}}
  }

we generate these arrows:

    +-----------------+
    |                 v
    int problem = 1 / getZero();
                  ^   |
                  +---+

where the top one represents the control flow up to the first call, and the
bottom one represents the flow to the division.* It turns out, however, that
we were generating the top arrow twice, as if attempting to "set up context"
after we had already returned from the call. This resulted in poor
highlighting in Xcode.

* Arguably the best location for the division is the '/', but that's a
  different problem.

<rdar://problem/13326040>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179350 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 00:44:01 +00:00
Rafael Espindola e9c09701e8 Remove REQUIRES now that r179237 fixed the real problem.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179349 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 00:32:20 +00:00
Douglas Gregor d7fed8e690 Make sure we have the include paths we need
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179347 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 00:23:25 +00:00
Douglas Gregor 31230e6fb3 <rdar://problem/13615607> Include SDK version information in the module hash.
This is a Darwin-SDK-specific hash criteria used to identify a
particular SDK without having to hash the contents of all of its
headers. If other platforms have such versioned files, we should add
those checks here.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179346 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 00:18:53 +00:00
Chad Rosier 5e768cad6a Add test case for r179343.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179344 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11 23:57:29 +00:00
Chad Rosier dbcfa8b955 Test case for r179339.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179340 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11 23:37:53 +00:00
John McCall 759c40e8a4 Flail at trying to appease various linuxy buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179338 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11 23:25:27 +00:00
Manman Ren ca83518041 Struct-path aware TBAA: uniformize scalar tag and path tag.
For struct-path aware TBAA, we used to use scalar type node as the scalar tag,
which has an incompatible format with the struct path tag. We now use the same
format: base type, access type and offset.

We also uniformize the scalar type node and the struct type node: name, a list
of pairs (offset + pointer to MDNode). For scalar type, we have a single pair.
These are to make implementaiton of aliasing rules easier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179335 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11 23:02:56 +00:00
John McCall 8cfb720c85 Fix the driver logic for recent versions of DragonFly.
Patch by John Marino.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179334 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11 22:55:55 +00:00
Chad Rosier 0f9790bb2f Update test case for r179323.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179324 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11 21:49:48 +00:00
Reid Kleckner 49eef34fdf Widen the checks in the ms abi memptr test to work under NDEBUG
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179311 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11 19:01:17 +00:00
Jyotsna Verma 9adcf1c96c Exclude test30 of Sema/return.c for Hexagon since setjmp.h include file
is unavailable for Hexagon.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179310 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11 18:56:34 +00:00
Bob Wilson f6f77bd900 Add a new -mimplicit-float option for symmetry with -mno-implicit-float.
This new option is the default, but it is useful to have a flag to override
-mno-implicit-float by putting -mimplicit-float later on the command line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179309 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11 18:53:25 +00:00
Reid Kleckner 289323f8ea Follow Jordan's advice and use {{^}} and {{$}} for this test
This is a better way of ensuring that we match the output of the
rewriter and not the CHECK line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179308 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11 18:39:10 +00:00
Reid Kleckner a3609b0c76 [ms-cxxabi] Implement member pointer emission and dereferencing
Summary:
Handles all inheritance models for both data and function member
pointers.

Also implements isZeroInitializable() and refactors some of the null
member pointer code.

MSVC supports converting member pointers through virtual bases, which
clang does not (yet?) support.  Implementing that extension is covered
by http://llvm.org/15713

Reviewers: rjmccall

CC: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179305 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11 18:13:19 +00:00
Argyrios Kyrtzidis 413549fbd8 [PCH] Change test/PCH/headersearch.cpp to use -emit-llvm-only instead of -emit-obj
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179301 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11 17:37:48 +00:00
Argyrios Kyrtzidis 5142be6b38 [libclang] Improve a doxygen comment, as suggested by Jordan.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179300 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11 17:31:13 +00:00
Jyotsna Verma 29828082ff Hexagon: Remove -g option from the assembler command line.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179299 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11 17:27:18 +00:00
Argyrios Kyrtzidis 04b6748ee9 [libclang] Have clang_getCXXAccessSpecifier() also return the access control of a C++ declaration within its parent scope.
Suggested by Stefan Seefeld.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179297 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11 17:02:10 +00:00
Daniel Jasper 1407bee187 Change clang-format's affinity for breaking after return types.
Function declarations are now broken with the following preferences:
1) break amongst arguments.
2) break after return type.
3) break after (.
4) break before after nested name specifiers.

Options #2 or #3 are preferred over #1 only if a substantial number of
lines can be saved by that.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179287 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11 14:29:13 +00:00
Reid Kleckner a826298168 Fix failing dependencies-and-pp.c test
The bots seem to do more line wrapping because they have longer absolute
paths.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179284 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11 13:43:19 +00:00
Reid Kleckner a53763f346 Use lit's internal shell runner on Windows for Clang tests
The behavior can be overridden by setting LIT_USE_INTERNAL_SHELL=0 in
the environment.

This fixes issues with /dev/null for me and brings the test suite time
down to 30s.  =D

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179283 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11 13:34:18 +00:00
Reid Kleckner 292285e643 FileCheck-ify more grep tests with quoted double quotes
This required some tedious reordering to match clang's order.
Presumably these ObjC tests were generated based on llvm-gcc's output
ordering.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179282 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11 13:24:56 +00:00
Daniel Jasper 2eb23b73f0 Fix formatting of overloaded assignment operators.
Before: SomeType &operator=(const SomeType & S);
After:  SomeType &operator=(const SomeType &S);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179270 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11 08:48:20 +00:00
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