Commit Graph

44764 Commits

Author SHA1 Message Date
John McCall 67517f0bc9 Flail at trying to appease various linuxy buildbots.
llvm-svn: 179338
2013-04-11 23:25:27 +00:00
Manman Ren e1ad74e6fd 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.

llvm-svn: 179335
2013-04-11 23:02:56 +00:00
John McCall 65b8da0623 Fix the driver logic for recent versions of DragonFly.
Patch by John Marino.

llvm-svn: 179334
2013-04-11 22:55:55 +00:00
Chad Rosier 76154684e9 Update test case for r179323.
llvm-svn: 179324
2013-04-11 21:49:48 +00:00
Reid Kleckner dac9342a52 Widen the checks in the ms abi memptr test to work under NDEBUG
llvm-svn: 179311
2013-04-11 19:01:17 +00:00
Jyotsna Verma 2147a3d039 Exclude test30 of Sema/return.c for Hexagon since setjmp.h include file
is unavailable for Hexagon.

llvm-svn: 179310
2013-04-11 18:56:34 +00:00
Bob Wilson 9c8af45a0c 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.

llvm-svn: 179309
2013-04-11 18:53:25 +00:00
Reid Kleckner 96cf7adce2 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.

llvm-svn: 179308
2013-04-11 18:39:10 +00:00
Reid Kleckner 2341ae3856 [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

llvm-svn: 179305
2013-04-11 18:13:19 +00:00
Argyrios Kyrtzidis e055d27e65 [PCH] Change test/PCH/headersearch.cpp to use -emit-llvm-only instead of -emit-obj
llvm-svn: 179301
2013-04-11 17:37:48 +00:00
Argyrios Kyrtzidis f646408ed5 [libclang] Improve a doxygen comment, as suggested by Jordan.
llvm-svn: 179300
2013-04-11 17:31:13 +00:00
Jyotsna Verma 2ddb2c825f Hexagon: Remove -g option from the assembler command line.
llvm-svn: 179299
2013-04-11 17:27:18 +00:00
Argyrios Kyrtzidis 1ab09cc883 [libclang] Have clang_getCXXAccessSpecifier() also return the access control of a C++ declaration within its parent scope.
Suggested by Stefan Seefeld.

llvm-svn: 179297
2013-04-11 17:02:10 +00:00
Daniel Jasper 6728fc11bc 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.

llvm-svn: 179287
2013-04-11 14:29:13 +00:00
Reid Kleckner 9643a313ac Fix failing dependencies-and-pp.c test
The bots seem to do more line wrapping because they have longer absolute
paths.

llvm-svn: 179284
2013-04-11 13:43:19 +00:00
Reid Kleckner 0675f85ef2 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

llvm-svn: 179283
2013-04-11 13:34:18 +00:00
Reid Kleckner 37e8fe13e0 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.

llvm-svn: 179282
2013-04-11 13:24:56 +00:00
Daniel Jasper 6e8f4edf2d Fix formatting of overloaded assignment operators.
Before: SomeType &operator=(const SomeType & S);
After:  SomeType &operator=(const SomeType &S);
llvm-svn: 179270
2013-04-11 08:48:20 +00:00
Ryan Govostes 8c4c126653 [analyzer] Factor common code from {SymSym,SymInt,IntSym}Expr to BinarySymExpr
llvm-svn: 179269
2013-04-11 06:04:50 +00:00
NAKAMURA Takumi 2cc16a18cc ARCMigrate/Transforms.h: Remove \arg in comment. [-Wdocumentation]
llvm-svn: 179261
2013-04-11 04:16:11 +00:00
John McCall bc48989d0d 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

llvm-svn: 179254
2013-04-11 02:14:26 +00:00
Argyrios Kyrtzidis e822f58db4 [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!

llvm-svn: 179251
2013-04-11 01:20:11 +00:00
Jordan Rose b1312a5495 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>

llvm-svn: 179250
2013-04-11 00:58:58 +00:00
Anton Yartsev 1e2bc9b53b [analyzer] Refactoring: better doxygen comment; renaming isTrackedFamily to isTrackedByCurrentChecker
llvm-svn: 179242
2013-04-11 00:05:20 +00:00
Fariborz Jahanian ccd66d259a comment parsing. Add couple more needed doxygen tags.
// rdar://12379053

llvm-svn: 179238
2013-04-10 23:10:42 +00:00
Adrian Prantl 751a5e1802 get rid of stdio.h include in testcase
llvm-svn: 179237
2013-04-10 23:09:00 +00:00
Adrian Prantl 5686668776 add mips target requirement to testcase
llvm-svn: 179236
2013-04-10 23:08:57 +00:00
Anna Zaks 07804ef87e [analyzer] Address Jordan’s review of r179219
llvm-svn: 179235
2013-04-10 22:56:33 +00:00
Anna Zaks 3f303be636 [analyzer] Address Jordan’s code review of r 179221
llvm-svn: 179234
2013-04-10 22:56:30 +00:00
Anton Yartsev 8fc29db312 [analyzer] +Testcase: several used-after-free args passed to a function.
llvm-svn: 179232
2013-04-10 22:36:16 +00:00
Anton Yartsev cb2ccd6b79 [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.

llvm-svn: 179230
2013-04-10 22:21:41 +00:00
Jack Carter d62445dce4 Mips specific inline asm memory operand modifier test case
These changes are based on commit responses for r179135.

llvm-svn: 179229
2013-04-10 22:10:45 +00:00
Anna Zaks 60d98befe8 [analyzer] Fix a crash in SyntaxCString checker when given a custom strncat.
Fixes PR13476

llvm-svn: 179228
2013-04-10 22:06:29 +00:00
Anna Zaks e51362e7f7 [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.

llvm-svn: 179221
2013-04-10 21:42:06 +00:00
Anna Zaks 7c19abeba6 [analyzer] Cleanup leak warnings: do not print the names of variables from other functions.
llvm-svn: 179219
2013-04-10 21:42:02 +00:00
Eric Christopher a75018aeba For split dwarf we should also run the objcopy action if we're
just assembling a file and have passed the option.

llvm-svn: 179218
2013-04-10 21:30:40 +00:00
Chad Rosier f2d396439a Remove unused arguments.
llvm-svn: 179217
2013-04-10 21:30:03 +00:00
Chad Rosier 153d7c616c [driver] Add a -Ofast option, which enables -O3, -ffast-math, and
-fstrict-aliasing.
rdar://13622687

llvm-svn: 179216
2013-04-10 21:26:02 +00:00
Reid Kleckner e494399203 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.

llvm-svn: 179214
2013-04-10 21:10:39 +00:00
Dmitri Gribenko c922b71d60 -fparse-all-comments: remove redundant check, as suggested by Fariborz Jahanian
llvm-svn: 179204
2013-04-10 18:43:09 +00:00
Chad Rosier ea1d1a2d05 [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.

llvm-svn: 179190
2013-04-10 18:08:17 +00:00
Chad Rosier e6956c3ec5 [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

llvm-svn: 179182
2013-04-10 16:33:34 +00:00
Dmitri Gribenko 061f32847f Add testcases for -fparse-all-comments
llvm-svn: 179181
2013-04-10 16:31:58 +00:00
Dmitri Gribenko a7d16ceee6 Add an option to parse all comments as documentation comments
Patch by Amin Shali.

llvm-svn: 179180
2013-04-10 15:35:17 +00:00
Manuel Klimek a3ff45ebed Fixes recovering from errors when parsing braced init lists.
Before we would build huge unwrapped lines which take a long time
to optimze.

llvm-svn: 179168
2013-04-10 09:52:05 +00:00
Daniel Jasper c04baae34a 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.

llvm-svn: 179167
2013-04-10 09:49:49 +00:00
Ted Kremenek 3365e52fa5 Handle "typeof" in Objective-C format string checking. This previously crashed.
Yes, this came from actual code.

Fixes <rdar://problem/13557053>.

llvm-svn: 179155
2013-04-10 06:26:26 +00:00
Richard Smith b7151b910c 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.

llvm-svn: 179154
2013-04-10 06:11:48 +00:00
John McCall 924046f1ec 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

llvm-svn: 179153
2013-04-10 06:08:21 +00:00
Richard Smith 185be185b2 C++11 inheriting constructors: support for inheriting constructor templates.
llvm-svn: 179151
2013-04-10 05:48:59 +00:00