]> granicus.if.org Git - clang/log
clang
11 years ago[analyzer; new edges] Improve enclosing contexts for logical expressions.
Jordan Rose [Mon, 3 Jun 2013 22:59:53 +0000 (22:59 +0000)]
[analyzer; new edges] Improve enclosing contexts for logical expressions.

The old edge builder didn't have a notion of nested statement contexts,
so there was no special treatment of a logical operator inside an if
(or inside another logical operator). The new edge builder always tries
to establish the full context up to the top-level statement, so it's
important to know how much context has been established already rather
than just checking the innermost context.

This restores some of the old behavior for the old edge generation:
the context of a logical operator's non-controlling expression is the
subexpression in the old edge algorithm, but the entire operator
expression in the new algorithm.

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

11 years ago[analyzer; new edges] Include context for edges to sub-expressions.
Jordan Rose [Mon, 3 Jun 2013 22:59:48 +0000 (22:59 +0000)]
[analyzer; new edges] Include context for edges to sub-expressions.

The current edge-generation algorithm sometimes creates edges from a
top-level statement A to a sub-expression B.1 that's not at the start of B.
This creates a "swoosh" effect where the arrow is drawn on top of the
text at the start of B. In these cases, the results are clearer if we see
an edge from A to B, then another one from B to B.1.

Admittedly, this does create a /lot/ of arrows, some of which merely hop
into a subexpression and then out again for a single note. The next commit
will eliminate these if the subexpression is simple enough.

This updates and reuses some of the infrastructure from the old edge-
generation algorithm to find the "enclosing statement" context for a
given expression. One change in particular marks the context of the
LHS or RHS of a logical binary operator (&&, ||) as the entire operator
expression, rather than the subexpression itself. This matches our behavior
for ?:, and allows us to handle nested context information.

<rdar://problem/13902816>

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

11 years ago[analyzer; new edges] Include a top-level function entry edge while optimizing.
Jordan Rose [Mon, 3 Jun 2013 22:59:45 +0000 (22:59 +0000)]
[analyzer; new edges] Include a top-level function entry edge while optimizing.

Although we don't want to show a function entry edge for a top-level path,
having it makes optimizing edges a little more uniform.

This does not affect any edges now, but will affect context edge generation
(next commit).

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

11 years agoCFG: In a DeclStmt, skip anything that's not a VarDecl.
Jordan Rose [Mon, 3 Jun 2013 22:59:41 +0000 (22:59 +0000)]
CFG: In a DeclStmt, skip anything that's not a VarDecl.

Neither the compiler nor the analyzer are doing anything with non-VarDecl
decls in the CFG, and having them there creates extra nodes in the
analyzer's path diagnostics. Simplify the CFG (and the path edges) by
simply leaving them out. We can always add interesting decls back in when
they become relevant.

Note that this only affects decls declared in a DeclStmt, and then only
those that appear within a function body.

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

11 years agoPacify compilers that think you can drop off a fully covered switch.
Benjamin Kramer [Mon, 3 Jun 2013 21:26:13 +0000 (21:26 +0000)]
Pacify compilers that think you can drop off a fully covered switch.

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

11 years agoUnresolvedMemberExpr should have an expr location of the member (not the base)
David Blaikie [Mon, 3 Jun 2013 19:46:44 +0000 (19:46 +0000)]
UnresolvedMemberExpr should have an expr location of the member (not the base)

This matches the behavior of MemberExpr and makes diagnostics such as
"reference to non-static member function must be called" more legible in
the case that the base & member are split over multiple lines (prior to
this change the diagnostic would point to the base, not the member -
making it very unclear in chained multi-line builder-style calls)

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

11 years ago__uint128_t is only available on 64 bit platforms, only test it when it's around.
Benjamin Kramer [Mon, 3 Jun 2013 19:37:18 +0000 (19:37 +0000)]
__uint128_t is only available on 64 bit platforms, only test it when it's around.

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

11 years agoAdd support for .bind("foo") expressions on the dynamic matchers.
Samuel Benzaquen [Mon, 3 Jun 2013 19:31:08 +0000 (19:31 +0000)]
Add support for .bind("foo") expressions on the dynamic matchers.

Summary: Add support on the parser, registry, and DynTypedMatcher for binding IDs dynamically.

Reviewers: klimek

CC: cfe-commits, revane
Differential Revision: http://llvm-reviews.chandlerc.com/D911

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

11 years agoConvert some Unicode whitespace to ASCII whitespace.
Richard Smith [Mon, 3 Jun 2013 17:00:25 +0000 (17:00 +0000)]
Convert some Unicode whitespace to ASCII whitespace.

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

11 years agoMoved FormatToken to a separate header.
Alexander Kornienko [Mon, 3 Jun 2013 16:45:03 +0000 (16:45 +0000)]
Moved FormatToken to a separate header.

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

11 years agoLet clang-format remove empty lines before "}".
Daniel Jasper [Mon, 3 Jun 2013 16:16:41 +0000 (16:16 +0000)]
Let clang-format remove empty lines before "}".

These lines almost never aid readability.

Before:
void f() {
  int i;  // some variable

}

After:
void f() {
  int i;  // some variable
}

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

11 years agoFix memory leak for APValues that do memory allocation.
Manuel Klimek [Mon, 3 Jun 2013 13:51:33 +0000 (13:51 +0000)]
Fix memory leak for APValues that do memory allocation.

This patch ensures that APValues are deallocated with the ASTContext by
registering a deallocation function for APValues to the ASTContext.

Original version of the patch by James Dennett.

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

11 years agoImprove detection preventing certain kind of formatting patterns.
Daniel Jasper [Mon, 3 Jun 2013 09:54:46 +0000 (09:54 +0000)]
Improve detection preventing certain kind of formatting patterns.

An oversight in this detection made clang-format unable to format
the following nicely:
void aaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaaaaaaaaaaaaaaaaa,
                         bbbbbbbbbbbbbbbbbbbbbbbbbb>(
    cccccccccccccccccccccccccccc);

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

11 years agoFix line-breaking problem caused by comment.
Daniel Jasper [Mon, 3 Jun 2013 08:42:05 +0000 (08:42 +0000)]
Fix line-breaking problem caused by comment.

Before, clang-format would not find a solution for formatting:
if ((aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ||
     bbbbbbbbbbbbbbbbbb) && // aaaaaaaaaaaaaaaa
    cccccc) {
}

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

11 years agoDo not walk through member-accesses on bitfields when looking for the object
Richard Smith [Mon, 3 Jun 2013 07:13:35 +0000 (07:13 +0000)]
Do not walk through member-accesses on bitfields when looking for the object
which is lifetime-extended by a reference binding. An additional temporary is
created for such a bitfield access (although we have no explicit AST
representation for it).

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

11 years agoRefactor constant expression evaluation to associate the complete object of a
Richard Smith [Mon, 3 Jun 2013 05:03:02 +0000 (05:03 +0000)]
Refactor constant expression evaluation to associate the complete object of a
materialized temporary with the corresponding MaterializeTemporaryExpr. This is
groundwork for providing C++11's guaranteed static initialization for global
references bound to lifetime-extended temporaries (if the initialization is a
constant expression).

In passing, fix a couple of bugs where some evaluation failures didn't trigger
diagnostics, and a rejects-valid where potential constant expression testing
would assume that it knew the dynamic type of *this and would reject programs
which relied on it being some derived type.

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

11 years agoFix a couple of bugs where jump diagnostics would not notice that a variable
Richard Smith [Mon, 3 Jun 2013 01:05:37 +0000 (01:05 +0000)]
Fix a couple of bugs where jump diagnostics would not notice that a variable
has an initializer.

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

11 years agoFix handling of pointers-to-members and comma expressions when
Richard Smith [Mon, 3 Jun 2013 00:17:11 +0000 (00:17 +0000)]
Fix handling of pointers-to-members and comma expressions when
lifetime-extending temporaries in reference bindings.

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

11 years agoAllow paren casted throw statements inside of ternary expressions
David Majnemer [Sun, 2 Jun 2013 08:40:42 +0000 (08:40 +0000)]
Allow paren casted throw statements inside of ternary expressions

clang would incorrectly not allow the following:

int x = true ? (throw 1) : 2;

The problem exists because we don't see beyond the parens.
This, in turn, causes us to believe that we are choosing between void
and int which we diagnose as an error.

Instead, allow clang to see the 'throw' inside the parens.

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

11 years agoProperly consider the range of enum for range comparisons in C mode
David Majnemer [Sun, 2 Jun 2013 08:11:22 +0000 (08:11 +0000)]
Properly consider the range of enum for range comparisons in C mode

In some cases, clang applies the C++ rules for computing the range of a
value when said value is an enum.

Instead, apply C semantics when in C mode.

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

11 years agoPR12848: When emitting a local variable declared 'constexpr', always initialize it...
Richard Smith [Sun, 2 Jun 2013 00:09:52 +0000 (00:09 +0000)]
PR12848: When emitting a local variable declared 'constexpr', always initialize it with a store or a memcpy, not by emitting the initializer expression. This is not required for correctness, but more closely aligns with people's expectations, and is cheap (since we've already evaluated the initializer).

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

11 years agoImprove recognition of template parameters.
Daniel Jasper [Sat, 1 Jun 2013 18:56:00 +0000 (18:56 +0000)]
Improve recognition of template parameters.

Before: return a<b &&c> d;
After:  return a < b && c > d;

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

11 years ago[analyzer] Malloc checker should only escape the receiver when “[O init..]” is called.
Anna Zaks [Fri, 31 May 2013 23:47:32 +0000 (23:47 +0000)]
[analyzer] Malloc checker should only escape the receiver when “[O init..]” is called.

Jordan has pointed out that it is valuable to warn in cases when the arguments to init escape.
For example, NSData initWithBytes id not going to free the memory.

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

11 years agoFix the indentation on the AST visitors used in -Wloop-analysis.
Richard Trieu [Fri, 31 May 2013 22:46:45 +0000 (22:46 +0000)]
Fix the indentation on the AST visitors used in -Wloop-analysis.

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

11 years ago[analyzer] Fix a false positive reported on rare strange code, which happens to be...
Anna Zaks [Fri, 31 May 2013 22:39:13 +0000 (22:39 +0000)]
[analyzer] Fix a false positive reported on rare strange code, which happens to be in JSONKit

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

11 years agoObjective-C: Fixes an ivar lookup bug where
Fariborz Jahanian [Fri, 31 May 2013 21:51:12 +0000 (21:51 +0000)]
Objective-C: Fixes an ivar lookup bug where
'ivar' was used inside a record/union used
as argument to __typeof. // rdar14037151 pr5984

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

11 years agoPut the PR16167 tests together
David Majnemer [Fri, 31 May 2013 21:29:50 +0000 (21:29 +0000)]
Put the PR16167 tests together

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

11 years agoFix style bug introduced in r183033.
Ed Schouten [Fri, 31 May 2013 20:12:49 +0000 (20:12 +0000)]
Fix style bug introduced in r183033.

I renamed the function at one point in time, but forgot to fix the
layout of the arguments.

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

11 years agoAdd support for optimized (non-generic) atomic libcalls.
Ed Schouten [Fri, 31 May 2013 19:27:59 +0000 (19:27 +0000)]
Add support for optimized (non-generic) atomic libcalls.

For integer types of sizes 1, 2, 4 and 8, libcompiler-rt (and libgcc)
provide atomic functions that pass parameters by value and return
results directly.

libgcc and libcompiler-rt only provide optimized libcalls for
__atomic_fetch_*, as generic libcalls on non-integer types would make
little sense. This means that we can finally make __atomic_fetch_* work
on architectures for which we don't provide these operations as builtins
(e.g. ARM).

This should fix the dreaded "cannot compile this atomic library call
yet" error that would pop up once every while.

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

11 years agoSlightly extend matching for atomic loads.
Ed Schouten [Fri, 31 May 2013 19:18:14 +0000 (19:18 +0000)]
Slightly extend matching for atomic loads.

Also add the "=" to the matched pattern, to see whether we actually save
the loaded value.

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

11 years agoTestcase for r183015.
Benjamin Kramer [Fri, 31 May 2013 17:01:30 +0000 (17:01 +0000)]
Testcase for r183015.

I hate svn add.

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

11 years ago[analyzer; new edges] add simplifySimpleBranches() to reduce edges for branches.
Ted Kremenek [Fri, 31 May 2013 16:56:54 +0000 (16:56 +0000)]
[analyzer; new edges] add simplifySimpleBranches() to reduce edges for branches.

In many cases, the edge from the "if" to the condition, followed by an edge from the branch condition to the target code, is uninteresting.

In such cases, we should fold the two edges into one from the "if" to the target.

This also applies to loops.

Implements <rdar://problem/14034763>.

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

11 years agoDisable non-standard library builtins in non-gnu language modes.
Benjamin Kramer [Fri, 31 May 2013 16:29:28 +0000 (16:29 +0000)]
Disable non-standard library builtins in non-gnu language modes.

Fixes PR16138.

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

11 years agoImprove clang-format's c-style cast detection.
Daniel Jasper [Fri, 31 May 2013 16:14:28 +0000 (16:14 +0000)]
Improve clang-format's c-style cast detection.

Before:
  x[(uint8) y];
  x = (uint8) y;
  void f() { x = (uint8) y; }
  #define AA(X) sizeof(((X *) NULL)->a)

After:
  x[(uint8)y];
  x = (uint8)y;
  void f() { x = (uint8)y; }
  #define AA(X) sizeof(((X *)NULL)->a)

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

11 years agoFix test error caused by r183008.
Daniel Jasper [Fri, 31 May 2013 15:15:41 +0000 (15:15 +0000)]
Fix test error caused by r183008.

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

11 years agoImprove clang-format's error recovery.
Daniel Jasper [Fri, 31 May 2013 14:56:29 +0000 (14:56 +0000)]
Improve clang-format's error recovery.

If a "}" is found inside parenthesis, this is probably a case of
missing parenthesis. This enables continuing to format after stuff code
like:

class A {
  void f(
};
..

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

11 years agoMake formatting of empty blocks more consistent.
Daniel Jasper [Fri, 31 May 2013 14:56:20 +0000 (14:56 +0000)]
Make formatting of empty blocks more consistent.

With this patch, the simplified rule is:
If the block is part of a declaration (class, namespace, function,
enum, ..), merge an empty block onto a single line. Otherwise
(specifically for the compound statements of if, for, while, ...),
keep the braces on two separate lines.

The reasons are:
- Mostly the formatting of empty blocks does not matter much.
- Empty compound statements are really rare and are usually just
  inserted while still working on the code. If they are on two lines,
  inserting code is easier. Also, overlooking the "{}" of an
  "if (...) {}" can be really bad.
- Empty declarations are not uncommon, e.g. empty constructors. Putting
  them on one line saves vertical space at no loss of readability.

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

11 years agoProperly format nested conditional operators.
Daniel Jasper [Fri, 31 May 2013 14:56:12 +0000 (14:56 +0000)]
Properly format nested conditional operators.

Before:
bool aaaaaa = aaaaaaaaaaaaa //
                  ? aaaaaaaaaaaaaaa
                  : bbbbbbbbbbbbbbb //
                  ? ccccccccccccccc
                  : ddddddddddddddd;

After:
bool aaaaaa = aaaaaaaaaaaaa //
                  ? aaaaaaaaaaaaaaa
                  : bbbbbbbbbbbbbbb //
                        ? ccccccccccccccc
                        : ddddddddddddddd;

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

11 years agoFix detection/formatting of braced lists in ternary expressions.
Daniel Jasper [Fri, 31 May 2013 10:09:55 +0000 (10:09 +0000)]
Fix detection/formatting of braced lists in ternary expressions.

Before:
foo = aaaaaaaaaaa ? vector<int> {
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaa
}
: vector<int>{ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, bbbbb };

After:
foo = aaaaaaaaaaa ? vector<int>{ aaaaaaaaaaaaaaaaaaaaaaaaaaa,
                                 aaaaaaaaaaaaaaaaaaaa, aaaaa }
                  : vector<int>{ bbbbbbbbbbbbbbbbbbbbbbbbbbb,
                                 bbbbbbbbbbbbbbbbbbbb, bbbbb };

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

11 years ago[analyzer; new edges] in splitBranchConditionEdges() do not check that predecessor...
Ted Kremenek [Fri, 31 May 2013 06:11:17 +0000 (06:11 +0000)]
[analyzer; new edges] in splitBranchConditionEdges() do not check that predecessor edge has source in the same lexical scope as the target branch.

Fixes <rdar://problem/14031292>.

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

11 years ago[analyzer;alternate arrows] Rename 'adjustBranchEdges' to 'splitBranchConditionEdges'.
Ted Kremenek [Fri, 31 May 2013 06:11:11 +0000 (06:11 +0000)]
[analyzer;alternate arrows] Rename 'adjustBranchEdges' to 'splitBranchConditionEdges'.

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

11 years agoFix handling of braced-init-list as reference initializer within aggregate
Richard Smith [Fri, 31 May 2013 02:56:17 +0000 (02:56 +0000)]
Fix handling of braced-init-list as reference initializer within aggregate
initialization. Previously we would incorrectly require an extra set of braces
around such initializers.

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

11 years ago[analyzer] Always use ccc-analyzer when running scan-build on buildbot
Anna Zaks [Fri, 31 May 2013 02:31:09 +0000 (02:31 +0000)]
[analyzer] Always use ccc-analyzer when running scan-build on buildbot

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

11 years ago[analyzer] Add --override-compiler option to scan-build.
Anna Zaks [Fri, 31 May 2013 02:31:07 +0000 (02:31 +0000)]
[analyzer] Add --override-compiler option to scan-build.

The new advanced option ensures ccc-analyze is used even when better
interposition methods are available.

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

11 years ago[PCH] Fix crash with valid code, related to anonymous field initializers.
Argyrios Kyrtzidis [Thu, 30 May 2013 23:59:46 +0000 (23:59 +0000)]
[PCH] Fix crash with valid code, related to anonymous field initializers.

In a certain code-path we were not deserializing an anonymous field initializer correctly,
leading to a crash when trying to IRGen it.

This is a simpler version of a patch by Yunzhong Gao!

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

11 years agoWalk over MaterializeTemporaryExpr when reverting an initializer to its
Richard Smith [Thu, 30 May 2013 22:40:16 +0000 (22:40 +0000)]
Walk over MaterializeTemporaryExpr when reverting an initializer to its
syntactic form in template instantiation. Previously, this blocked the
reversion and we ended up losing inner CXXBindTemporaryExprs (and thus
forgetting to call destructors!).

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

11 years agofixes a comment in my last patch.
Fariborz Jahanian [Thu, 30 May 2013 21:52:50 +0000 (21:52 +0000)]
fixes a comment in my last patch.

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

11 years agoObjective-C: Implements gcc's -Wselector option
Fariborz Jahanian [Thu, 30 May 2013 21:48:58 +0000 (21:48 +0000)]
Objective-C: Implements gcc's -Wselector option
which diagnoses type mismatches of identical
selectors declared in classes throughout.
// rdar://14007194

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

11 years agoRevert "[analyzer; alternate edges] don't add an edge incoming from the start of...
Jordan Rose [Thu, 30 May 2013 21:30:17 +0000 (21:30 +0000)]
Revert "[analyzer; alternate edges] don't add an edge incoming from the start of a function"

...and make this work correctly in the current codebase.

After living on this for a while, it turns out to look very strange for
inlined functions that have only a single statement, and somewhat strange
for inlined functions in general (since they are still conceptually in the
middle of the path, and there is a function-entry path note).

It's worth noting that this only affects inlined functions; in the new
arrow generation algorithm, the top-level function still starts at the
first real statement in the function body, not the enclosing CompoundStmt.

This reverts r182078 / dbfa950abe0e55b173286a306ee620eff5f72ea.

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

11 years agoFix PR16060.
Rafael Espindola [Thu, 30 May 2013 21:23:15 +0000 (21:23 +0000)]
Fix PR16060.

The testcase in PR16060 points out that while template arguments can
show that a type is not externally visible, the standards still says
they have external linkage.

In terms of our implementation, it means that we should merge just the
isExternallyVisible bit, not the formal linkage.

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

11 years agoFix potential infinite loop when iterating over redeclarations of an ObjMethodDecl...
Argyrios Kyrtzidis [Thu, 30 May 2013 18:53:21 +0000 (18:53 +0000)]
Fix potential infinite loop when iterating over redeclarations of an ObjMethodDecl, resulting from invalid code.

Check for invalid decls in ObjCMethodDecl::getNextRedeclaration(); otherwise if we start from an invalid redeclaration
of an @implementation we would move to the @interface and not reach the original declaration again.

Fixes rdar://14024851

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

11 years ago[analyzer] Don't crash if a block's signature just has the return type.
Jordan Rose [Thu, 30 May 2013 18:14:27 +0000 (18:14 +0000)]
[analyzer] Don't crash if a block's signature just has the return type.

It is okay to declare a block without an argument list: ^ {} or ^void {}.
In these cases, the BlockDecl's signature-as-written will just contain
the return type, rather than the entire function type. It is unclear if
this is intentional, but the analyzer shouldn't crash because of it.

<rdar://problem/14018351>

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

11 years agoDo not reuse the debug location of the return value's store if there is autorelease...
Adrian Prantl [Thu, 30 May 2013 18:12:23 +0000 (18:12 +0000)]
Do not reuse the debug location of the return value's store if there is autorelease code to be emitted between store and return instructions. This is analoguous to what we do for lexical scope cleanups.

rdar://problem/13977888

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

11 years agofix formatting.
Adrian Prantl [Thu, 30 May 2013 18:12:20 +0000 (18:12 +0000)]
fix formatting.

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

11 years agoMore fixes for clang-format's multiline comment breaking.
Daniel Jasper [Thu, 30 May 2013 17:27:48 +0000 (17:27 +0000)]
More fixes for clang-format's multiline comment breaking.

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

11 years agoMicrosoft has a language extension which allows union members to be
Aaron Ballman [Thu, 30 May 2013 16:20:00 +0000 (16:20 +0000)]
Microsoft has a language extension which allows union members to be
references.  What's more, they use this language extension in their
ATL header files (which come as part of MFC and the Win32 SDK).  This patch implements support for the Microsoft extension, and addresses PR13737.

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

11 years agoFix typo in comment.
Benjamin Kramer [Thu, 30 May 2013 15:36:53 +0000 (15:36 +0000)]
Fix typo in comment.

Found by -Wdocumentation.

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

11 years agoFix another clang-format crasher related to multi-line comments.
Daniel Jasper [Thu, 30 May 2013 15:20:29 +0000 (15:20 +0000)]
Fix another clang-format crasher related to multi-line comments.

This fixes:
/*
*
* something long going over the column limit.
*/

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

11 years agoCoding style fix for SourceFileCallbacks
Edwin Vane [Thu, 30 May 2013 13:59:44 +0000 (13:59 +0000)]
Coding style fix for SourceFileCallbacks

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

11 years agoFixed typo.
Serge Pavlov [Thu, 30 May 2013 12:37:57 +0000 (12:37 +0000)]
Fixed typo.

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

11 years agoFix default value of clang-format-diff's -p option.
Daniel Jasper [Thu, 30 May 2013 11:50:20 +0000 (11:50 +0000)]
Fix default value of clang-format-diff's -p option.

This way, it has the same default as 'patch' and also the example in the
code makes more sense as it is explicitly setting -p 1.

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

11 years agoAdd asserts to guard against regressions.
Manuel Klimek [Thu, 30 May 2013 07:45:53 +0000 (07:45 +0000)]
Add asserts to guard against regressions.

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

11 years agoFix crasher when formatting certain block comments.
Daniel Jasper [Thu, 30 May 2013 06:40:07 +0000 (06:40 +0000)]
Fix crasher when formatting certain block comments.

Smallest reproduction:
/*
**
*/

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

11 years agoAdded documentation to TypeVisitor. No code changes.
Serge Pavlov [Thu, 30 May 2013 05:04:43 +0000 (05:04 +0000)]
Added documentation to TypeVisitor. No code changes.

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

11 years agoSwitching the tests to use size_t instead of unsigned int to hopefully appease the...
Aaron Ballman [Thu, 30 May 2013 02:17:14 +0000 (02:17 +0000)]
Switching the tests to use size_t instead of unsigned int to hopefully appease the Linux x64 build bot (take 2, forgot this test case).

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

11 years agoSwitching the tests to use size_t instead of unsigned int to hopefully appease the...
Aaron Ballman [Thu, 30 May 2013 02:02:23 +0000 (02:02 +0000)]
Switching the tests to use size_t instead of unsigned int to hopefully appease the Linux x64 build bot.

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

11 years agoAdd support to fallback on operator new when a placement operator new[] is called...
Aaron Ballman [Thu, 30 May 2013 01:55:39 +0000 (01:55 +0000)]
Add support to fallback on operator new when a placement operator new[] is called for which there is no valid declaration.  This fallback only happens in Microsoft compatibility mode.  This patch addresses PR13164, and improves support for the WDK.

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

11 years ago[analyzer; new edges] In for(;;), use the ForStmt itself for loop notes.
Jordan Rose [Thu, 30 May 2013 01:05:58 +0000 (01:05 +0000)]
[analyzer; new edges] In for(;;), use the ForStmt itself for loop notes.

Most loop notes (like "entering loop body") are attached to the condition
expression guarding a loop or its equivalent. For loops may not have a
condition expression, though. Rather than crashing, just use the entire
ForStmt as the location. This is probably the best we can do.

<rdar://problem/14016063>

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

11 years ago[libclang] When indexing a @synthesize, don't consider that it defines a getter/sette...
Argyrios Kyrtzidis [Wed, 29 May 2013 23:58:31 +0000 (23:58 +0000)]
[libclang] When indexing a @synthesize, don't consider that it defines a getter/setter if one is already defined by the user.

Fixes rdar://13925258

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

11 years agoDocument -fno-sanitize-recover and -fsanitize-undefined-trap-on-error and attempt...
Richard Smith [Wed, 29 May 2013 22:57:31 +0000 (22:57 +0000)]
Document -fno-sanitize-recover and -fsanitize-undefined-trap-on-error and attempt to explain the difference between them.

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

11 years agoFixes error when splitting block comments.
Manuel Klimek [Wed, 29 May 2013 22:06:18 +0000 (22:06 +0000)]
Fixes error when splitting block comments.

When trying to fall back to search from the end onwards, we
would still find leading whitespace if the leading whitespace
went on after the end of the line.

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

11 years agoSplit off casts to void* for -Wint-to-pointer-cast to subgroup -Wint-to-void-pointer...
Ted Kremenek [Wed, 29 May 2013 21:50:46 +0000 (21:50 +0000)]
Split off casts to void* for -Wint-to-pointer-cast to subgroup -Wint-to-void-pointer-cast.

This change is motivated from user feedback that some APIs use
void* as an opaque "context" object that may not really be a pointer.
Such users want an ability to turn off the warning for casts
to void* while preserving the warning for other cases.

Implements <rdar://problem/14016721>.

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

11 years agoAdd another test case for r182814.
David Majnemer [Wed, 29 May 2013 21:09:52 +0000 (21:09 +0000)]
Add another test case for r182814.

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

11 years agoTurn CLANG_ENABLE_{ARCMT,REWRITER,STATIC_ANALYZER} into proper options so that
Roman Divacky [Wed, 29 May 2013 21:09:18 +0000 (21:09 +0000)]
Turn CLANG_ENABLE_{ARCMT,REWRITER,STATIC_ANALYZER} into proper options so that
users can disable those. Just like in autoconf generated makefiles.

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

11 years ago[analyzer] Accept references to variables declared "extern void" (C only).
Jordan Rose [Wed, 29 May 2013 20:50:34 +0000 (20:50 +0000)]
[analyzer] Accept references to variables declared "extern void" (C only).

In C, 'void' is treated like any other incomplete type, and though it is
never completed, you can cast the address of a void-typed variable to do
something useful. (In C++ it's illegal to declare a variable with void type.)

Previously we asserted on this code; now we just treat it like any other
incomplete type.

And speaking of incomplete types, we don't know their extent. Actually
check that in TypedValueRegion::getExtent, though that's not being used
by any checkers that are on by default.

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

11 years agoRemove unused field.
Rafael Espindola [Wed, 29 May 2013 19:51:12 +0000 (19:51 +0000)]
Remove unused field.

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

11 years ago[libclang] For "@import .." code-completion results, associate a CXCursor_ModuleImpor...
Argyrios Kyrtzidis [Wed, 29 May 2013 18:50:15 +0000 (18:50 +0000)]
[libclang] For "@import .." code-completion results, associate a CXCursor_ModuleImportDecl cursor instead of CXCursor_NotImplemented.

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

11 years ago[ms-cxxabi] Implement MSVC virtual base adjustment
Reid Kleckner [Wed, 29 May 2013 18:02:47 +0000 (18:02 +0000)]
[ms-cxxabi] Implement MSVC virtual base adjustment

While we can't yet emit vbtables, this allows us to find virtual bases
of objects constructed in other TUs.

This make iostream hello world work, since basic_ostream virtually
inherits from basic_ios.

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

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

11 years ago[ms-cxxabi] Fix r182865 to have an actual Itanium-style key function
Reid Kleckner [Wed, 29 May 2013 16:51:17 +0000 (16:51 +0000)]
[ms-cxxabi] Fix r182865 to have an actual Itanium-style key function

Peter pointed out that C::f() is not a key function.  C's key function
is actually C::~C().

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

11 years ago[ms-cxxabi] There are no key functions in the Microsoft C++ ABI
Reid Kleckner [Wed, 29 May 2013 16:18:30 +0000 (16:18 +0000)]
[ms-cxxabi] There are no key functions in the Microsoft C++ ABI

MSVC's class data is always comdat, so clang's should always be
linkonce_odr in LLVM IR.

Reviewers: pcc

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

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

11 years agoTooling: Call back for both begin and end of sources
Edwin Vane [Wed, 29 May 2013 16:01:10 +0000 (16:01 +0000)]
Tooling: Call back for both begin and end of sources

newFrontendActionFactory() took a pointer to a callback to call when a source
file was done being processed by an action. This revision updates the callback
to include an ante-processing callback as well.

Callback-providing class renamed and callback functions themselves renamed.
Functions are no longer pure-virtual so users aren't forced to implement both
callbacks if one isn't needed.

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

11 years agoUse a non-recursive implementation to reconstruct line breaks.
Manuel Klimek [Wed, 29 May 2013 15:10:11 +0000 (15:10 +0000)]
Use a non-recursive implementation to reconstruct line breaks.

Now that the TokenAnnotator does not require stack space anymore,
reconstructing the lines has become the limiting factor. This patch
fixes that problem, allowing large files with multiple megabytes of
single unwrapped lines to be formatted.

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

11 years agoThe second step in the token refactoring.
Manuel Klimek [Wed, 29 May 2013 14:47:47 +0000 (14:47 +0000)]
The second step in the token refactoring.

Gets rid of AnnotatedToken, putting everything into FormatToken.
FormatTokens are created once, and only referenced by pointer.  This
enables multiple future features, like having tokens shared between
multiple UnwrappedLines (while there's still work to do to fully enable
that).

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

11 years agoAdd return missing in r182855.
Daniel Jasper [Wed, 29 May 2013 14:09:17 +0000 (14:09 +0000)]
Add return missing in r182855.

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

11 years agoLeave some macros on their own line
Daniel Jasper [Wed, 29 May 2013 13:16:10 +0000 (13:16 +0000)]
Leave some macros on their own line

If an identifier is on its own line and it is all upper case, it is highly
likely that this is a macro that is meant to stand on a line by itself.

Before:
class A : public QObject {
  Q_OBJECT A() {}
};

Ater:
class A : public QObject {
  Q_OBJECT

  A() {}
};

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

11 years agoAdd option to always break template declarations.
Daniel Jasper [Wed, 29 May 2013 12:07:31 +0000 (12:07 +0000)]
Add option to always break template declarations.

With option enabled (e.g. in Google-style):
template <typename T>
void f() {}

With option disabled:
template <typename T> void f() {}

Enabling this for Google-style and Chromium-style, not sure which other
styles would prefer that.

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

11 years agoDon't compute the visibility unless we really have to.
Rafael Espindola [Wed, 29 May 2013 04:55:30 +0000 (04:55 +0000)]
Don't compute the visibility unless we really have to.

This brings the number of linkage computations in "clang -cc1" in SemaExpr.ii
from 58426 to 43134. With -emit-llvm the number goes from 161045 to 145461.

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

11 years agoFix bad indentation.
Jakob Stoklund Olesen [Wed, 29 May 2013 03:57:23 +0000 (03:57 +0000)]
Fix bad indentation.

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

11 years agoAdd a testcase from pr16059.
Rafael Espindola [Wed, 29 May 2013 03:10:01 +0000 (03:10 +0000)]
Add a testcase from pr16059.

It was fixed back in r182750, but this is a nice testcase to have.

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

11 years agoDisallow extern decls of type void in C++ mode
David Majnemer [Wed, 29 May 2013 00:56:45 +0000 (00:56 +0000)]
Disallow extern decls of type void in C++ mode

C++ and C differ with respect to the handling of extern void
declarations. Enforce the C++ behavior in C++ mode.

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

11 years agoObjective-C [qoi]: Improve on diagnostic when a method used
Fariborz Jahanian [Tue, 28 May 2013 23:49:32 +0000 (23:49 +0000)]
Objective-C [qoi]: Improve on diagnostic when a method used
in an @selector expression has no implementation.
// rdar://14002507

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

11 years agoRemove links to old checker builds.
Ted Kremenek [Tue, 28 May 2013 23:30:24 +0000 (23:30 +0000)]
Remove links to old checker builds.

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

11 years ago[analyzer] Use the expression’s type instead of region’s type in ArrayToPointer decay...
Anna Zaks [Tue, 28 May 2013 23:24:01 +0000 (23:24 +0000)]
[analyzer] Use the expression’s type instead of region’s type in ArrayToPointer decay evaluation

This gives slightly better precision, specifically, in cases where a non-typed region represents the array
or when the type is a non-array type, which can happen when an array is a result of a reinterpret_cast.

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

11 years ago[analyzer] Re-enable reasoning about CK_LValueBitCast
Anna Zaks [Tue, 28 May 2013 22:32:08 +0000 (22:32 +0000)]
[analyzer] Re-enable reasoning about CK_LValueBitCast

It’s important for us to reason about the cast as it is used in std::addressof. The reason we did not
handle the cast previously was a crash on a test case (see commit r157478). The crash was in
processing array to pointer decay when the region type was not an array. Address the issue, by
just returning an unknown in that case.

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

11 years agoCheck the linkage cache at every recursive step.
Rafael Espindola [Tue, 28 May 2013 19:43:11 +0000 (19:43 +0000)]
Check the linkage cache at every recursive step.

Before this patch the linkage cache was only used by the entry level function
(getLinkage). The function that does the actual computation (getLVForDecl),
never looked at it.

This means that we would not reuse an entry in the cache when getLVForDecl did
a recursive call. This patch fixes that by adding another computation enum
value for when we don't care about the linkage at all and having getLVForDecl
check the cache in that case.

When running "clang -cc1" over SemaExpr.ii this brings the number of linkage
computations from 93749 to 58426. When running "clang -cc1 -emit-llvm -O3" it
goes from 198708 to 161444.

For SemaExpr.ii at least linkage computation is a small enough percentage of
the work that the time difference was in the noise.

When asserts are enabled this patch also causes clang to check the linkage
cache even on recursive calls.

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

11 years agoAdd an overridable MatchCallback::onEndOfTranslationUnit() function.
Peter Collingbourne [Tue, 28 May 2013 19:21:51 +0000 (19:21 +0000)]
Add an overridable MatchCallback::onEndOfTranslationUnit() function.

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

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

11 years agoRemove obsolete variable as discovered in post-commit review.
Daniel Jasper [Tue, 28 May 2013 19:11:43 +0000 (19:11 +0000)]
Remove obsolete variable as discovered in post-commit review.

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

11 years agoSupport uniform inits in braced lists.
Daniel Jasper [Tue, 28 May 2013 18:50:02 +0000 (18:50 +0000)]
Support uniform inits in braced lists.

This made it necessary to remove an error detection which would let us
bail out of braced lists in certain situations of missing "}". However,
as we always entirely escape from the braced list on finding ";", this
should not be a big problem.

With this, we can no format braced lists with uniformat inits:

return { arg1, SomeType { parameter } };

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

11 years agoPatch to issue error when target of MacOS and iOS
Fariborz Jahanian [Tue, 28 May 2013 17:37:39 +0000 (17:37 +0000)]
Patch to issue error when target of MacOS and iOS
does not support large load/store of atomic objects.
// rdar://13973577

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

11 years ago[analyzer] Use a more generic MemRegion.getAsOffset to evaluate bin operators on...
Anna Zaks [Tue, 28 May 2013 17:31:43 +0000 (17:31 +0000)]
[analyzer] Use a more generic MemRegion.getAsOffset to evaluate bin operators on MemRegions

In addition to enabling more code reuse, this suppresses some false positives by allowing us to
compare an element region to its base. See the ptr-arith.cpp test cases for an example.

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