]> granicus.if.org Git - clang/log
clang
11 years ago[Mips] Follow-up to r179481. Consider "single-float" as a separate
Simon Atanasyan [Sun, 14 Apr 2013 14:07:30 +0000 (14:07 +0000)]
[Mips] Follow-up to r179481. Consider "single-float" as a separate
independent of float ABI feature in the MipsTargetInfoBase class.

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

11 years agoAdd driver support for fedora 18 on ARM.
Rafael Espindola [Sun, 14 Apr 2013 10:14:21 +0000 (10:14 +0000)]
Add driver support for fedora 18 on ARM.

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

11 years agoHandle incompatible redeclarations of library builtins better.
John McCall [Sun, 14 Apr 2013 08:50:55 +0000 (08:50 +0000)]
Handle incompatible redeclarations of library builtins better.
Invalid redeclarations of valid explicit declarations shouldn't
take the same path as redeclarations of implicit declarations,
and invalid local extern declarations shouldn't foul things up
for everybody else.

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

11 years ago[Mips] Remove "single" from the list of valid MIPS float ABI names. Add
Simon Atanasyan [Sun, 14 Apr 2013 08:37:15 +0000 (08:37 +0000)]
[Mips] Remove "single" from the list of valid MIPS float ABI names. Add
two new options –msingle-float and –mdouble-float. These options can be
used simultaneously with float ABI selection options (-mfloat-abi,
-mhard-float, -msoft-float). They mark whether a floating-point
coprocessor supports double-precision operations.

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

11 years agoSimplify test so that it is more portable.
Rafael Espindola [Sat, 13 Apr 2013 22:26:02 +0000 (22:26 +0000)]
Simplify test so that it is more portable.

I have checked that the test still fails when the "|| !P.isRegularFile()" from
the original patch is removed.

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

11 years agoRemove duplicated comment.
Simon Atanasyan [Sat, 13 Apr 2013 06:43:15 +0000 (06:43 +0000)]
Remove duplicated comment.

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

11 years agoAnnotate flavor of TLS variable (statically or dynamically initialized) onto the...
Richard Smith [Sat, 13 Apr 2013 02:43:54 +0000 (02:43 +0000)]
Annotate flavor of TLS variable (statically or dynamically initialized) onto the AST.

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

11 years agoUse MapVector rather than simulating it.
Richard Smith [Sat, 13 Apr 2013 01:28:18 +0000 (01:28 +0000)]
Use MapVector rather than simulating it.

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

11 years agoSpeed-up ObjCMethodDecl::getOverriddenMethods().
Argyrios Kyrtzidis [Sat, 13 Apr 2013 01:04:01 +0000 (01:04 +0000)]
Speed-up ObjCMethodDecl::getOverriddenMethods().

Use an newly introduce ASTContext::getBaseObjCCategoriesAfterInterface() which caches its
results instead of re-calculating the categories multiple times.

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

11 years agoIntroduce SourceManager::getDecomposedIncludedLoc, that returns the "included/expande...
Argyrios Kyrtzidis [Sat, 13 Apr 2013 01:03:57 +0000 (01:03 +0000)]
Introduce SourceManager::getDecomposedIncludedLoc, that returns the "included/expanded in" decomposed location of the given FileID.

The main benefit is to speed-up SourceManager::isBeforeInTranslationUnit which is common to query
the included/expanded location of the same FileID multiple times.

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

11 years agoGive this test a triple so that its use of thread_local doesn't make it fail on the...
Richard Smith [Sat, 13 Apr 2013 00:34:48 +0000 (00:34 +0000)]
Give this test a triple so that its use of thread_local doesn't make it fail on the MSVC bot.

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

11 years agoDon't replace an existing decl in the scope chains with its
John McCall [Sat, 13 Apr 2013 00:20:21 +0000 (00:20 +0000)]
Don't replace an existing decl in the scope chains with its
local-extern redeclaration;  type refinements, default arguments,
etc. must all be locally scoped.

rdar://13535367

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

11 years agoHeaders: Don't try to use RSIZE_MAX unless we are freestanding.
Daniel Dunbar [Fri, 12 Apr 2013 23:41:08 +0000 (23:41 +0000)]
Headers: Don't try to use RSIZE_MAX unless we are freestanding.
 - We don't want to depend on the platforms stdint.h.

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

11 years ago[analyzer] Enable NewDelete checker if NewDeleteLeaks checker is enabled.
Anton Yartsev [Fri, 12 Apr 2013 23:25:40 +0000 (23:25 +0000)]
[analyzer] Enable NewDelete checker if NewDeleteLeaks checker is enabled.

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

11 years agoHeaders: Add support for ISO9899:2011 rsize_t.
Daniel Dunbar [Fri, 12 Apr 2013 23:24:56 +0000 (23:24 +0000)]
Headers: Add support for ISO9899:2011 rsize_t.

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

11 years agoNewDeleteLeaks is a subchecker of NewDelete checker; it is tested in NewDelete-checke...
Anton Yartsev [Fri, 12 Apr 2013 23:18:46 +0000 (23:18 +0000)]
NewDeleteLeaks is a subchecker of NewDelete checker; it is tested in NewDelete-checker-test.cpp

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

11 years agoParsing support for thread_local and _Thread_local. We give them the same
Richard Smith [Fri, 12 Apr 2013 22:46:28 +0000 (22:46 +0000)]
Parsing support for thread_local and _Thread_local. We give them the same
semantics as __thread for now.

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

11 years agotl;dr: Teach Clang to work around g++ changing its workaround to glibc's
Richard Smith [Fri, 12 Apr 2013 22:11:07 +0000 (22:11 +0000)]
tl;dr: Teach Clang to work around g++ changing its workaround to glibc's
implementation of C99's attempt to control the C++ standard. *sigh*

The C99 standard says that certain macros in <stdint.h>, such as SIZE_MAX,
should not be defined when the header is included in C++ mode, unless
__STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS are defined. The C++11 standard
says "Thanks, but no thanks" and C11 removed this rule, but various C library
implementations (such as glibc) follow C99 anyway.

g++ prior to 4.8 worked around the C99 / glibc behavior by defining
__STDC_*_MACROS in <cstdint>, which was incorrect, because <stdint.h> is
supposed to provide these macros too. g++ 4.8 works around it by defining
__STDC_*_MACROS in its builtin <stdint.h> header.

This change makes Clang act like g++ 4.8 in this regard: our <stdint.h> now
countermands any attempt by the C library to implement the undesired C99 rules,
by defining the __STDC_*_MACROS first. Unlike g++, we do this even in C++98
mode, since that was the intent of the C++ committee, matches the behavior
required in C11, and matches our built-in implementation of <stdint.h>.

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

11 years ago<rdar://problem/13643854> Only emit ambiguous-expansion warnings when at least one...
Douglas Gregor [Fri, 12 Apr 2013 21:00:54 +0000 (21:00 +0000)]
<rdar://problem/13643854> Only emit ambiguous-expansion warnings when at least one of the macro definitions comes from a non-system header.

This slightly weakens the heuristic introduced in r178109.

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

11 years ago[analyzer] Makes NewDeleteLeaks checker work independently from NewDelete.
Anton Yartsev [Fri, 12 Apr 2013 20:48:49 +0000 (20:48 +0000)]
[analyzer] Makes NewDeleteLeaks checker work independently from NewDelete.

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

11 years agoDefine Neon intrinsics as "static inline" to avoid warning. rdar://13108414
Bob Wilson [Fri, 12 Apr 2013 20:17:20 +0000 (20:17 +0000)]
Define Neon intrinsics as "static inline" to avoid warning. rdar://13108414

We had been defining Neon intrinsics as "static" with always_inline attributes.
If you use them from an extern inline function, you get a warning, e.g.:

static function 'vadd_u8' is used in an inline function with external linkage

This change simply adds the inline keyword to avoid that warning.

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

11 years agoAdd test case for r179403.
Chad Rosier [Fri, 12 Apr 2013 19:52:07 +0000 (19:52 +0000)]
Add test case for r179403.

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

11 years agoAdd test case for r179399.
Chad Rosier [Fri, 12 Apr 2013 18:54:40 +0000 (18:54 +0000)]
Add test case for r179399.

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

11 years ago[analyzer] Print a diagnostic note even if the region cannot be printed.
Anna Zaks [Fri, 12 Apr 2013 18:40:27 +0000 (18:40 +0000)]
[analyzer] Print a diagnostic note even if the region cannot be printed.

There are few cases where we can track the region, but cannot print the note,
which makes the testing limited. (Though, I’ve tested this manually by making
all regions non-printable.) Even though the applicability is limited now, the enhancement
will be more relevant as we start tracking more regions.

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

11 years ago[analyzer]Print field region even when the base region is not printable
Anna Zaks [Fri, 12 Apr 2013 18:40:21 +0000 (18:40 +0000)]
[analyzer]Print field region even when the base region is not printable

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

11 years agoAdd test case for r179383 and r179393.
Chad Rosier [Fri, 12 Apr 2013 18:22:08 +0000 (18:22 +0000)]
Add test case for r179383 and r179393.

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

11 years agoDisable following tests for Hexagon:
Jyotsna Verma [Fri, 12 Apr 2013 17:25:02 +0000 (17:25 +0000)]
Disable following tests for Hexagon:

1) Driver/output-file-is-dir.c - Checks for object file which can't
be created for Hexagon since assembler is unavailable.
2) PCH/cxx-typeid.cpp - 'typeinfo' include file is unavailable for Hexagon.

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

11 years ago[libclang] Introduce clang_Location_isInSystemHeader to check if a location resides...
Argyrios Kyrtzidis [Fri, 12 Apr 2013 17:06:51 +0000 (17:06 +0000)]
[libclang] Introduce clang_Location_isInSystemHeader to check if a location resides in a system header.

This is a modified patch provided from Mikołaj Siedlarek!

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

11 years agoSema: Give a typically small DenseMap some inline capacity.
Benjamin Kramer [Fri, 12 Apr 2013 15:22:25 +0000 (15:22 +0000)]
Sema: Give a typically small DenseMap some inline capacity.

Also reflow code a bit, no change in functionality.

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

11 years agoRevamps structural error detection / handling.
Manuel Klimek [Fri, 12 Apr 2013 14:13:36 +0000 (14:13 +0000)]
Revamps structural error detection / handling.

Previously we'd only detect structural errors on the very first level.
This leads to incorrectly balanced braces not being discovered, and thus
incorrect indentation.

This change fixes the problem by:
- changing the parser to use an error state that can be detected
  anywhere inside the productions, for example if we get an eof on
  SOME_MACRO({ some block <eof>
- previously we'd never break lines when we discovered a structural
  error; now we break even in the case of a structural error if there
  are two unwrapped lines within the same line; thus,
  void f() { while (true) { g(); y(); } }
  will still be re-formatted, even if there's missing braces somewhere
  in the file
- still exclude macro definitions from generating structural error;
  macro definitions are inbalanced snippets

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

11 years agoFix clang-format-diff.py script.
Daniel Jasper [Fri, 12 Apr 2013 13:42:36 +0000 (13:42 +0000)]
Fix clang-format-diff.py script.

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

11 years agoProvide better emacs integration.
Daniel Jasper [Fri, 12 Apr 2013 10:12:01 +0000 (10:12 +0000)]
Provide better emacs integration.

The new emacs integration is simpler, does not save the current file
before reformatting and ensures that emacs does not scroll as a result
of formatting.

Also explicitly set the style in clang-format tests to make them more
robust.

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

11 years ago[analyzer] Fix grammar in comment.
Jordan Rose [Fri, 12 Apr 2013 00:44:24 +0000 (00:44 +0000)]
[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

11 years ago[analyzer] Show "Returning from ..." note at caller's depth, not callee's.
Jordan Rose [Fri, 12 Apr 2013 00:44:17 +0000 (00:44 +0000)]
[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

11 years ago[analyzer] Don't emit extra context arrow after returning from an inlined call.
Jordan Rose [Fri, 12 Apr 2013 00:44:01 +0000 (00:44 +0000)]
[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

11 years agoRemove REQUIRES now that r179237 fixed the real problem.
Rafael Espindola [Fri, 12 Apr 2013 00:32:20 +0000 (00:32 +0000)]
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

11 years agoMake sure we have the include paths we need
Douglas Gregor [Fri, 12 Apr 2013 00:23:25 +0000 (00:23 +0000)]
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

11 years ago<rdar://problem/13615607> Include SDK version information in the module hash.
Douglas Gregor [Fri, 12 Apr 2013 00:18:53 +0000 (00:18 +0000)]
<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

11 years agoAdd test case for r179343.
Chad Rosier [Thu, 11 Apr 2013 23:57:29 +0000 (23:57 +0000)]
Add test case for r179343.

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

11 years agoTest case for r179339.
Chad Rosier [Thu, 11 Apr 2013 23:37:53 +0000 (23:37 +0000)]
Test case for r179339.

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

11 years agoFlail at trying to appease various linuxy buildbots.
John McCall [Thu, 11 Apr 2013 23:25:27 +0000 (23:25 +0000)]
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

11 years agoStruct-path aware TBAA: uniformize scalar tag and path tag.
Manman Ren [Thu, 11 Apr 2013 23:02:56 +0000 (23:02 +0000)]
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

11 years agoFix the driver logic for recent versions of DragonFly.
John McCall [Thu, 11 Apr 2013 22:55:55 +0000 (22:55 +0000)]
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

11 years agoUpdate test case for r179323.
Chad Rosier [Thu, 11 Apr 2013 21:49:48 +0000 (21:49 +0000)]
Update test case for r179323.

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

11 years agoWiden the checks in the ms abi memptr test to work under NDEBUG
Reid Kleckner [Thu, 11 Apr 2013 19:01:17 +0000 (19:01 +0000)]
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

11 years agoExclude test30 of Sema/return.c for Hexagon since setjmp.h include file
Jyotsna Verma [Thu, 11 Apr 2013 18:56:34 +0000 (18:56 +0000)]
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

11 years agoAdd a new -mimplicit-float option for symmetry with -mno-implicit-float.
Bob Wilson [Thu, 11 Apr 2013 18:53:25 +0000 (18:53 +0000)]
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

11 years agoFollow Jordan's advice and use {{^}} and {{$}} for this test
Reid Kleckner [Thu, 11 Apr 2013 18:39:10 +0000 (18:39 +0000)]
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

11 years ago[ms-cxxabi] Implement member pointer emission and dereferencing
Reid Kleckner [Thu, 11 Apr 2013 18:13:19 +0000 (18:13 +0000)]
[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

11 years ago[PCH] Change test/PCH/headersearch.cpp to use -emit-llvm-only instead of -emit-obj
Argyrios Kyrtzidis [Thu, 11 Apr 2013 17:37:48 +0000 (17:37 +0000)]
[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

11 years ago[libclang] Improve a doxygen comment, as suggested by Jordan.
Argyrios Kyrtzidis [Thu, 11 Apr 2013 17:31:13 +0000 (17:31 +0000)]
[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

11 years agoHexagon: Remove -g option from the assembler command line.
Jyotsna Verma [Thu, 11 Apr 2013 17:27:18 +0000 (17:27 +0000)]
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

11 years ago[libclang] Have clang_getCXXAccessSpecifier() also return the access control of a...
Argyrios Kyrtzidis [Thu, 11 Apr 2013 17:02:10 +0000 (17:02 +0000)]
[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

11 years agoChange clang-format's affinity for breaking after return types.
Daniel Jasper [Thu, 11 Apr 2013 14:29:13 +0000 (14:29 +0000)]
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

11 years agoFix failing dependencies-and-pp.c test
Reid Kleckner [Thu, 11 Apr 2013 13:43:19 +0000 (13:43 +0000)]
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

11 years agoUse lit's internal shell runner on Windows for Clang tests
Reid Kleckner [Thu, 11 Apr 2013 13:34:18 +0000 (13:34 +0000)]
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

11 years agoFileCheck-ify more grep tests with quoted double quotes
Reid Kleckner [Thu, 11 Apr 2013 13:24:56 +0000 (13:24 +0000)]
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

11 years agoFix formatting of overloaded assignment operators.
Daniel Jasper [Thu, 11 Apr 2013 08:48:20 +0000 (08:48 +0000)]
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

11 years ago[analyzer] Factor common code from {SymSym,SymInt,IntSym}Expr to BinarySymExpr
Ryan Govostes [Thu, 11 Apr 2013 06:04:50 +0000 (06:04 +0000)]
[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

11 years agoARCMigrate/Transforms.h: Remove \arg in comment. [-Wdocumentation]
NAKAMURA Takumi [Thu, 11 Apr 2013 04:16:11 +0000 (04:16 +0000)]
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

11 years agoDrop ObjCIndirectCopyRestoreExprs during template instantiation.
John McCall [Thu, 11 Apr 2013 02:14:26 +0000 (02:14 +0000)]
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

11 years ago[libclang] Expose record layout info via new libclang functions:
Argyrios Kyrtzidis [Thu, 11 Apr 2013 01:20:11 +0000 (01:20 +0000)]
[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

11 years agoForce a load when creating a reference to a temporary copied from a bitfield.
Jordan Rose [Thu, 11 Apr 2013 00:58:58 +0000 (00:58 +0000)]
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

11 years ago[analyzer] Refactoring: better doxygen comment; renaming isTrackedFamily to isTracked...
Anton Yartsev [Thu, 11 Apr 2013 00:05:20 +0000 (00:05 +0000)]
[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

11 years agocomment parsing. Add couple more needed doxygen tags.
Fariborz Jahanian [Wed, 10 Apr 2013 23:10:42 +0000 (23:10 +0000)]
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

11 years agoget rid of stdio.h include in testcase
Adrian Prantl [Wed, 10 Apr 2013 23:09:00 +0000 (23:09 +0000)]
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

11 years agoadd mips target requirement to testcase
Adrian Prantl [Wed, 10 Apr 2013 23:08:57 +0000 (23:08 +0000)]
add mips target requirement to testcase

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

11 years ago[analyzer] Address Jordan’s review of r179219
Anna Zaks [Wed, 10 Apr 2013 22:56:33 +0000 (22:56 +0000)]
[analyzer] Address Jordan’s review of r179219

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

11 years ago[analyzer] Address Jordan’s code review of r 179221
Anna Zaks [Wed, 10 Apr 2013 22:56:30 +0000 (22:56 +0000)]
[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

11 years ago[analyzer] +Testcase: several used-after-free args passed to a function.
Anton Yartsev [Wed, 10 Apr 2013 22:36:16 +0000 (22:36 +0000)]
[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

11 years ago[analyzer] Switched to checkPreCall interface for detecting usage after free.
Anton Yartsev [Wed, 10 Apr 2013 22:21:41 +0000 (22:21 +0000)]
[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

11 years agoMips specific inline asm memory operand modifier test case
Jack Carter [Wed, 10 Apr 2013 22:10:45 +0000 (22:10 +0000)]
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

11 years ago[analyzer] Fix a crash in SyntaxCString checker when given a custom strncat.
Anna Zaks [Wed, 10 Apr 2013 22:06:29 +0000 (22:06 +0000)]
[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

11 years ago[analyzer] When reporting a leak in RetainCount checker due to an early exit from...
Anna Zaks [Wed, 10 Apr 2013 21:42:06 +0000 (21:42 +0000)]
[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

11 years ago[analyzer] Cleanup leak warnings: do not print the names of variables from other...
Anna Zaks [Wed, 10 Apr 2013 21:42:02 +0000 (21:42 +0000)]
[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

11 years agoFor split dwarf we should also run the objcopy action if we're
Eric Christopher [Wed, 10 Apr 2013 21:30:40 +0000 (21:30 +0000)]
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

11 years agoRemove unused arguments.
Chad Rosier [Wed, 10 Apr 2013 21:30:03 +0000 (21:30 +0000)]
Remove unused arguments.

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

11 years ago[driver] Add a -Ofast option, which enables -O3, -ffast-math, and
Chad Rosier [Wed, 10 Apr 2013 21:26:02 +0000 (21:26 +0000)]
[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

11 years agoFileCheck-ify some clang grep tests that use double quotes
Reid Kleckner [Wed, 10 Apr 2013 21:10:39 +0000 (21:10 +0000)]
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

11 years ago-fparse-all-comments: remove redundant check, as suggested by Fariborz Jahanian
Dmitri Gribenko [Wed, 10 Apr 2013 18:43:09 +0000 (18:43 +0000)]
-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

11 years ago[ms-inline asm] Move a few test cases from the 32-bit version to the 64-bit
Chad Rosier [Wed, 10 Apr 2013 18:08:17 +0000 (18:08 +0000)]
[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

11 years ago[ms-inline asm] Add a few test cases that were regressed by r179115. That
Chad Rosier [Wed, 10 Apr 2013 16:33:34 +0000 (16:33 +0000)]
[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

11 years agoAdd testcases for -fparse-all-comments
Dmitri Gribenko [Wed, 10 Apr 2013 16:31:58 +0000 (16:31 +0000)]
Add testcases for -fparse-all-comments

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

11 years agoAdd an option to parse all comments as documentation comments
Dmitri Gribenko [Wed, 10 Apr 2013 15:35:17 +0000 (15:35 +0000)]
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

11 years agoFixes recovering from errors when parsing braced init lists.
Manuel Klimek [Wed, 10 Apr 2013 09:52:05 +0000 (09:52 +0000)]
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

11 years agoFix labels with trailing comments and cleanup.
Daniel Jasper [Wed, 10 Apr 2013 09:49:49 +0000 (09:49 +0000)]
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

11 years agoHandle "typeof" in Objective-C format string checking. This previously crashed.
Ted Kremenek [Wed, 10 Apr 2013 06:26:26 +0000 (06:26 +0000)]
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

11 years agoAdd support for computing the exception specification for an inheriting
Richard Smith [Wed, 10 Apr 2013 06:11:48 +0000 (06:11 +0000)]
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

11 years agoDon't crash when mangling types defined in ObjC class extensions.
John McCall [Wed, 10 Apr 2013 06:08:21 +0000 (06:08 +0000)]
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

11 years agoC++11 inheriting constructors: support for inheriting constructor templates.
Richard Smith [Wed, 10 Apr 2013 05:48:59 +0000 (05:48 +0000)]
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

11 years ago<rdar://problem/13605348> Don't consider invalid user-defined literal operators durin...
Douglas Gregor [Wed, 10 Apr 2013 05:18:00 +0000 (05:18 +0000)]
<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

11 years ago[frontend] -frewrite-includes: turn implicit module imports into @imports.
Argyrios Kyrtzidis [Wed, 10 Apr 2013 01:53:50 +0000 (01:53 +0000)]
[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

11 years ago[frontend] When preprocessing, turn implicit module imports into @imports.
Argyrios Kyrtzidis [Wed, 10 Apr 2013 01:53:46 +0000 (01:53 +0000)]
[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

11 years ago[frontend] -frewrite-includes: if there was no inclusion, don't add lineinfo that...
Argyrios Kyrtzidis [Wed, 10 Apr 2013 01:53:37 +0000 (01:53 +0000)]
[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

11 years agoRepeat some #line directive tests for the GNU line marker directive.
Michael Ilseman [Wed, 10 Apr 2013 01:41:19 +0000 (01:41 +0000)]
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

11 years agoImprove the diagnostics of the number-reading preprocessor directives.
Michael Ilseman [Wed, 10 Apr 2013 01:04:18 +0000 (01:04 +0000)]
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

11 years agoSuppress -Wunused-variable for variables declared in headers, which may in
Matt Beaumont-Gay [Wed, 10 Apr 2013 00:47:10 +0000 (00:47 +0000)]
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

11 years agoRemove outdated run lines from tests.
Richard Trieu [Tue, 9 Apr 2013 22:06:27 +0000 (22:06 +0000)]
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

11 years agoUpdating cpp11-migrate transform list in ClangTools docs
Edwin Vane [Tue, 9 Apr 2013 20:51:47 +0000 (20:51 +0000)]
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

11 years agoAdding new AST Matchers isVirtual and isOverride
Edwin Vane [Tue, 9 Apr 2013 20:46:36 +0000 (20:46 +0000)]
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