Richard Smith [Sun, 11 Mar 2012 03:06:00 +0000 (03:06 +0000)]
cxx_status: No compiler changes are required for 'minimal support for garbage
collection'. Keep it in the table to match gcc's table, but mark it N/A.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152528
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Sun, 11 Mar 2012 02:23:56 +0000 (02:23 +0000)]
Add a missing 'template' keyword.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152526
91177308-0d34-0410-b5e6-
96231b3b80d8
Jordy Rose [Sun, 11 Mar 2012 00:08:24 +0000 (00:08 +0000)]
[analyzer] Replace a static helper with existing logic. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152521
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Sat, 10 Mar 2012 23:52:41 +0000 (23:52 +0000)]
When determining whether an identifier followed by a '<' in a member
access expression is the start of a template-id, ignore function
templates found in the context of the entire postfix-expression. Fixes
PR11856.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152520
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sat, 10 Mar 2012 23:40:02 +0000 (23:40 +0000)]
Fix crash & accepts-invalid for array of arrays of user defined type.
Test case/other help by Richard Smith.
Code review by John McCall.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152519
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Sat, 10 Mar 2012 22:52:10 +0000 (22:52 +0000)]
Updated the test so that it checks for ms-compatibility in addition to ms-extensions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152516
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Sat, 10 Mar 2012 22:28:45 +0000 (22:28 +0000)]
Adding namespace qualifiers to the visualizers and improving their behavior.
Patch thanks to Nikola Smiljanic
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152514
91177308-0d34-0410-b5e6-
96231b3b80d8
Gregory Szorc [Sat, 10 Mar 2012 22:23:27 +0000 (22:23 +0000)]
[clang.py] Implement Cursor.objc_type_encoding
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152513
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Sat, 10 Mar 2012 22:21:14 +0000 (22:21 +0000)]
No longer defining GNUC mode when compiling for Microsoft compatibility. This allows people's cross-platform compiler-specific macros to work properly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152512
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Sat, 10 Mar 2012 22:20:11 +0000 (22:20 +0000)]
Clarify even further that the lambda-to-block-pointer conversion is only available in Objective-C++
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152511
91177308-0d34-0410-b5e6-
96231b3b80d8
Gregory Szorc [Sat, 10 Mar 2012 22:19:05 +0000 (22:19 +0000)]
[clang.py] Refactor get_tu and get_cursor test helper functions into util.py
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152510
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Sat, 10 Mar 2012 22:18:57 +0000 (22:18 +0000)]
PR12225: The requirement that literal operators be namespace-scope functions
does not imply that such functions can't be declared at block scope.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152509
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 10 Mar 2012 20:55:36 +0000 (20:55 +0000)]
Use VersionTuple to manage macosx versions in the driver. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152504
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 10 Mar 2012 20:38:56 +0000 (20:38 +0000)]
Simplify code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152503
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Sat, 10 Mar 2012 18:25:06 +0000 (18:25 +0000)]
objective-c modern rewriter: add __declspec(dllexport) to forward
declaration of class metadata when they are defined later.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152500
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Sat, 10 Mar 2012 17:45:38 +0000 (17:45 +0000)]
objc modern rewriter: Define __OBJC2__ in written file.
// rdar://
11024543
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152496
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 10 Mar 2012 15:08:09 +0000 (15:08 +0000)]
Replace a map of boolean values with a set.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152494
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Sat, 10 Mar 2012 13:01:40 +0000 (13:01 +0000)]
The type of a definition should not increase its visibility. Fixes PR12221.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152493
91177308-0d34-0410-b5e6-
96231b3b80d8
John McCall [Sat, 10 Mar 2012 09:33:50 +0000 (09:33 +0000)]
Remove BlockDeclRefExpr and introduce a bit on DeclRefExpr to
track whether the referenced declaration comes from an enclosing
local context. I'm amenable to suggestions about the exact meaning
of this bit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152491
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Sat, 10 Mar 2012 07:47:07 +0000 (07:47 +0000)]
Slightly tweak this condition. "isTransparentContext()" was checking whether an
enum is scoped or not, which is not relevant here. Instead, phrase the loop in
the same terms that the standard uses, instead of this awkward set of
conditions that is *nearly* equal.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152489
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Sat, 10 Mar 2012 07:45:33 +0000 (07:45 +0000)]
Could not find this in C99. Perhaps this rule comes from a DR, but in any case
please annotate it with a note explaining why this wrong-seeming behaviour is
correct.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152488
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Sat, 10 Mar 2012 06:53:13 +0000 (06:53 +0000)]
Only make a call to a copy constructor elidable if in fact we are
doing a copy. Fixes PR12139.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152485
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Sat, 10 Mar 2012 03:20:58 +0000 (03:20 +0000)]
[Sema] A tag decl that is marked as invalid and is used in a decl-spec,
should not impede creating a proper TypeLoc info for the decl-spec.
This improves our semantic error recovery.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152481
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Sat, 10 Mar 2012 03:20:52 +0000 (03:20 +0000)]
Remove the part of test/Sema/pragma-pack-2.c that has irregular "#pragma pack"s.
Before r151307 this part worked without compiler errors but now it only verifies
that our handling of irregular pragmas is broken compared to gcc, it has no
practical usefulness; it creates invalid structs that cannot be used for 'offsetof' testing.
If we later decide to handle irregular pragmas without compiler errors we can
put back this part.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152480
91177308-0d34-0410-b5e6-
96231b3b80d8
John McCall [Sat, 10 Mar 2012 03:05:10 +0000 (03:05 +0000)]
Unify the BlockDeclRefExpr and DeclRefExpr paths so that
we correctly emit loads of BlockDeclRefExprs even when they
don't qualify as ODR-uses. I think I'm adequately convinced
that BlockDeclRefExpr can die.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152479
91177308-0d34-0410-b5e6-
96231b3b80d8
John McCall [Sat, 10 Mar 2012 03:04:55 +0000 (03:04 +0000)]
Fix the dumping of BlockExprs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152478
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Sat, 10 Mar 2012 03:02:29 +0000 (03:02 +0000)]
test/Rewriter/rewrite-modern-ivars-2.mm: Add "-triple i386-apple-darwin9".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152476
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 10 Mar 2012 02:06:27 +0000 (02:06 +0000)]
Fix a use of the C99 PRI format macros not to conflict with C++11 UDLs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152475
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Sat, 10 Mar 2012 01:39:01 +0000 (01:39 +0000)]
Make sure the accessors for overridden methods don't return inherited constructors. Fixes PR12219.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152470
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Sat, 10 Mar 2012 01:34:42 +0000 (01:34 +0000)]
objc modern rewriter: don't export @package ivar symbols.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152469
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Sat, 10 Mar 2012 01:34:17 +0000 (01:34 +0000)]
[analyzer] fix regression in analyzer of NOT actually aborting on Stmts it doesn't understand. We registered
as aborted, but didn't treat such cases as sinks in the ExplodedGraph.
Along the way, add basic support for CXXCatchStmt, expanding the set of code we actually analyze (hopefully correctly).
Fixes: <rdar://problem/10892489>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152468
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sat, 10 Mar 2012 01:03:58 +0000 (01:03 +0000)]
IRgen/ABI/x86_64: Avoid passing small structs using byval sometimes.
- We do this when it is easy to determine that the backend will pass them on
the stack properly by itself.
Currently LLVM codegen is really bad in some cases with byval, for example, on
the test case here (which is derived from Sema code, which likes to pass
SourceLocations around)::
struct s47 { unsigned a; };
void f47(int,int,int,int,int,int,struct s47);
void test47(int a, struct s47 b) { f47(a, a, a, a, a, a, b); }
we used to emit code like this::
...
movl %esi, -8(%rbp)
movl -8(%rbp), %ecx
movl %ecx, (%rsp)
...
to handle moving the struct onto the stack, which is just appalling.
Now we generate::
movl %esi, (%rsp)
which seems better, no?
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152462
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Sat, 10 Mar 2012 00:53:02 +0000 (00:53 +0000)]
Minor change to my last rewrite patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152461
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Sat, 10 Mar 2012 00:39:34 +0000 (00:39 +0000)]
objc modern rewriter: Mark class and ivar definitions with __declspec(dllexport)
// rdar://
11023563
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152459
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Sat, 10 Mar 2012 00:29:33 +0000 (00:29 +0000)]
Qualifiers on a canonical array type go on the outermost type, not the
innermost type. Fixes PR12142.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152456
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Sat, 10 Mar 2012 00:28:11 +0000 (00:28 +0000)]
Assign APValues by swapping from a temporary. Removes a bunch of unnecessary
copy-construction, which Daniel Dunbar reports as giving a 0.75% speedup on
403.gcc/combine.c. The performance differences on my constexpr torture tests
are below the noise floor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152455
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Fri, 9 Mar 2012 23:46:23 +0000 (23:46 +0000)]
objective-c modern rewriter. More fixes related to rewriting
ivars in the modern rewriter.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152451
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 9 Mar 2012 23:34:08 +0000 (23:34 +0000)]
Teach RetainCountChecker about mixing method families with explicit annotations. Fixes <rdar://problem/
10824732>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152448
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 9 Mar 2012 23:24:48 +0000 (23:24 +0000)]
Document the conversion from a lambda closure type to a block pointer
in Objective-C++.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152446
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 9 Mar 2012 22:27:51 +0000 (22:27 +0000)]
Improve diagnostics for UCNs referring to control characters and members of the
basic source character set in C++98. Add -Wc++98-compat diagnostics for same in
literals in C++11. Extend such support to cover string literals as well as
character literals, and mark N2170 as done.
This seems too minor to warrant a release note to me. Let me know if you disagree.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152444
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Fri, 9 Mar 2012 21:38:22 +0000 (21:38 +0000)]
[Sema] Fix a diag change to include a range that appeared intended, but never
actually happened.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152442
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Fri, 9 Mar 2012 21:19:44 +0000 (21:19 +0000)]
Update comment after r152140. Clarify a bit too.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152441
91177308-0d34-0410-b5e6-
96231b3b80d8
Anna Zaks [Fri, 9 Mar 2012 21:14:01 +0000 (21:14 +0000)]
[analyzer] Add support for NoRedundancy inlining mode.
We do not reanalyze a function, which has already been analyzed as an
inlined callee. As per PRELIMINARY testing, this gives over
50% run time reduction on some benchmarks without decreasing of the
number of bugs found.
Turning the mode on by default.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152440
91177308-0d34-0410-b5e6-
96231b3b80d8
Anna Zaks [Fri, 9 Mar 2012 21:13:53 +0000 (21:13 +0000)]
CallGraph: Add getNode() method, constify.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152439
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Fri, 9 Mar 2012 21:09:04 +0000 (21:09 +0000)]
Allow serializing an invalid ParmVarDecl and don't set access to public for
invalid ParmVarDecls.
Part of rdar://
11007039.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152437
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Fri, 9 Mar 2012 20:41:19 +0000 (20:41 +0000)]
Revert r152430 "[AST] Mark ASTContext::getTypeInfo and some friends as
LLVM_READONLY.", getTypeInfo() is totally not READONLY, which I should have
probably noticed given that I made it so mere hours ago. Oops.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152434
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Beaumont-Gay [Fri, 9 Mar 2012 20:36:34 +0000 (20:36 +0000)]
Add a helper to get a CXXConstructExpr from a CXXNewExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152433
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Fri, 9 Mar 2012 20:10:30 +0000 (20:10 +0000)]
Improve our semantic error recovery.
When an error made a record member invalid, the record would stay as "isBeingDefined" and
not "completeDefinition". Even easily recoverable errors ended up propagating records in
such "beingDefined" state, for example:
struct A {
~A() const; // expected-error {{'const' qualifier is not allowed on a destructor}}
};
struct B : A {}; // A & B would stay as "not complete definition" and "being defined".
This weird state was impending lookups in the records and hitting assertion in the ASTWriter.
Part of rdar://
11007039
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152432
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Fri, 9 Mar 2012 20:02:56 +0000 (20:02 +0000)]
[AST] Mark Expr::Ignore*() functions as LLVM_READONLY.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152431
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Fri, 9 Mar 2012 20:02:54 +0000 (20:02 +0000)]
[AST] Mark ASTContext::getTypeInfo and some friends as LLVM_READONLY.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152430
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Fri, 9 Mar 2012 20:02:51 +0000 (20:02 +0000)]
[AST] Mark Expr::getExprLoc() as LLVM_READONLY.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152429
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Fri, 9 Mar 2012 20:02:47 +0000 (20:02 +0000)]
[Sema] Remove dead getSourceRange() call, caught by Clang after marking
LLVM_READONLY.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152428
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Fri, 9 Mar 2012 19:35:29 +0000 (19:35 +0000)]
[AST/etc] Mark {getSourceRange(),getStartLoc(),getEndLoc()} as LLVM_READONLY.
- The theory here is that we have these functions sprinkled in all over the
place. This should allow the optimizer to at least realize it can still do
load CSE across these calls.
- I blindly marked all instances as such, even though the optimizer can infer
this attribute in some instances (some of the inline ones) as that was easier
and also, when given the choice between thinking and not thinking, I prefer
the latter.
You might think this is mere frivolity, but actually this is good for a .7 -
1.1% speedup on 403.gcc/combine.c, JSC/Interpreter.cpp,
OGF/NSBezierPath-OAExtensions.m.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152426
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 9 Mar 2012 19:09:47 +0000 (19:09 +0000)]
Add user-defined literals to release notes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152424
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Fri, 9 Mar 2012 18:47:16 +0000 (18:47 +0000)]
lldb support: under debugger support flag, when sending message
to forward class, and assigning to an 'id' type var, message
sends default to 'id'. // rdar"//
10988847
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152420
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Fri, 9 Mar 2012 18:35:03 +0000 (18:35 +0000)]
[AST/Sema/libclang] Replace getSourceRange().getBegin() with getLocStart().
- getSourceRange().getBegin() is about as awesome a pattern as .copy().size().
I already killed the hot paths so this doesn't seem to impact performance on my
tests-of-the-day, but it is a much more sensible (and shorter) pattern.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152419
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Fri, 9 Mar 2012 18:34:54 +0000 (18:34 +0000)]
[AST/Sema] Add {CXXBaseSpecifier,Declarator,DeclSpec,TypeLoc,UnqualifiedId}::getLoc{Start,End}.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152418
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Fri, 9 Mar 2012 15:39:24 +0000 (15:39 +0000)]
[AST] Define a few more key getLocStart() implementations.
- This cuts the # of getSourceRange calls by 60% on
OGF/NSBezierPath-OAExtensions.m.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152412
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Fri, 9 Mar 2012 15:39:19 +0000 (15:39 +0000)]
[AST] Reimplement Stmt::getLoc{Start,End} to dispatch to subclass overloads.
- getSourceRange() can be very expensive, we should try to avoid it if at all possible.
In conjunction with the previous commit I measured a ~2% speedup on 403.gcc/combine.c and a 3% speedup on OmniGroupFrameworks/NSBezierPath-OAExtensions.m.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152411
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Fri, 9 Mar 2012 15:39:15 +0000 (15:39 +0000)]
[AST] Add {DeclRefExpr,MemberExpr,ImplicitCastExpr}::{getLocStart,getLocEnd} methods.
- There are probably a lot more of these worth adding, but these are a start at hitting some of the exprs for which getSourceRange().getBegin() is a poor substitute for getLocStart().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152410
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Fri, 9 Mar 2012 15:39:11 +0000 (15:39 +0000)]
[AST] Add DeclaratioName::getLoc{Start,End} for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152409
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Fri, 9 Mar 2012 15:39:08 +0000 (15:39 +0000)]
[Basic] Rename LangOptions::NoInline to NoInlineDefine, to make things a bit
more obvious.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152408
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 9 Mar 2012 13:17:27 +0000 (13:17 +0000)]
Harden test for 32 bit platforms, where size_t is unsigned int (not unsigned long).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152404
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Fri, 9 Mar 2012 10:10:54 +0000 (10:10 +0000)]
-Wformat-non-iso: warn about positional arguments (pr12017)
This renames the -Wformat-non-standard flag to -Wformat-non-iso,
rewords the current warnings a bit (pointing out that a format string
is not supported by ISO C rather than being "non standard"),
and adds a warning about positional arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152403
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 9 Mar 2012 10:10:02 +0000 (10:10 +0000)]
Fix statement printing for raw and template user-defined literals.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152401
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 9 Mar 2012 08:41:27 +0000 (08:41 +0000)]
User-defined literals are done.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152396
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 9 Mar 2012 08:37:16 +0000 (08:37 +0000)]
Literal operator suffixes and regular names live in separate namespaces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152395
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 9 Mar 2012 08:16:22 +0000 (08:16 +0000)]
Literal operators can't have default arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152394
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 9 Mar 2012 08:00:36 +0000 (08:00 +0000)]
Support for raw and template forms of numeric user-defined literals,
and lots of tidying up.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152392
91177308-0d34-0410-b5e6-
96231b3b80d8
John McCall [Fri, 9 Mar 2012 04:18:33 +0000 (04:18 +0000)]
Remove accidental binary commit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152378
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Fri, 9 Mar 2012 04:12:54 +0000 (04:12 +0000)]
[AST] Memoize ASTContext::getTypeInfo().
- On -emit-llvm-only of 403.gcc/combine.c, for example, we make 160k calls to
getTypeInfo but only ever deal with 680 some distinct types.
I saw these speedups (user time):
403.gcc/combine.c -- 3.1%
OmniGroupFrameworks/NSBezierPath-OAExtensions.m -- 3.6%
JavaScriptCore/Interpreter.cpp -- 1.4%
which seems pretty sweet.
I ran some histograms on those compiles and we end up doing a ton of
getTypeInfo() on 'char' and 'int'. I tried splitting out a fast path for builtin
types, but this wasn't a win. Still kinda seems like we could be doing better
here.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152377
91177308-0d34-0410-b5e6-
96231b3b80d8
John McCall [Fri, 9 Mar 2012 04:08:29 +0000 (04:08 +0000)]
Perform l2r conversions on delete operands before doing
type-analysis; otherwise, we just completely do the
wrong thing for placeholders.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152375
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Fri, 9 Mar 2012 03:27:46 +0000 (03:27 +0000)]
Make sure we update the static local decl address map when we are forced to rebuild a global because of the initializer. <rdar://problem/
10957867>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152372
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Fri, 9 Mar 2012 03:06:56 +0000 (03:06 +0000)]
Make sure constant emission handles initializer lists with strings correctly. Part of <rdar://problem/
10957867>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152370
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Fri, 9 Mar 2012 01:51:59 +0000 (01:51 +0000)]
[AST] NestedNameSpecifier's ctor/dtor are trivial and should be inlined.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152365
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Fri, 9 Mar 2012 01:51:56 +0000 (01:51 +0000)]
[AST] Type::isVoidType() is trivial and should be inlined.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152364
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Fri, 9 Mar 2012 01:51:51 +0000 (01:51 +0000)]
[AST] Reduce Decl::getASTContext() calls.
- This function is not at all free; pass it around along some hot paths instead
of recomputing it deep inside various VarDecl methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152363
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 9 Mar 2012 01:13:14 +0000 (01:13 +0000)]
[analyzer] Implement basic path diagnostic pruning based on "interesting" symbols and regions.
Essentially, a bug centers around a story for various symbols and regions. We should only include
the path diagnostic events that relate to those symbols and regions.
The pruning is done by associating a set of interesting symbols and regions with a BugReporter, which
can be modified at BugReport creation or by BugReporterVisitors.
This patch reduces the diagnostics emitted in several of our test cases. I've vetted these as
having desired behavior. The only regression is a missing null check diagnostic for the return
value of realloc() in test/Analysis/malloc-plist.c. This will require some investigation to fix,
and I have added a FIXME to the test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152361
91177308-0d34-0410-b5e6-
96231b3b80d8
Anna Zaks [Thu, 8 Mar 2012 23:16:38 +0000 (23:16 +0000)]
[analyzer] Use call graph to determine order in which functions are
analyzed.
The CallGraph is used when inlining is on, which is the current default.
This alone does not bring any performance improvement. It's a
stepping stone for the upcoming optimization in which we do not
re-analyze a function that has already been analyzed while inlined in
other functions. Using the call graph makes it easier to play with
the order of functions to minimize redundant analyzes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152352
91177308-0d34-0410-b5e6-
96231b3b80d8
Anna Zaks [Thu, 8 Mar 2012 23:16:35 +0000 (23:16 +0000)]
[analyzer] Rework inlining related command line options.
- Remove -analyzer-inline-call.
- Add -analyzer-ipa=[none|inlining]
- Add -analyzer-inlining-mode to allow experimentation for
different performance tuning methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152351
91177308-0d34-0410-b5e6-
96231b3b80d8
Anna Zaks [Thu, 8 Mar 2012 23:16:26 +0000 (23:16 +0000)]
Call Graph: Only the root node is allowed to have an invalid Decl*.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152350
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Thu, 8 Mar 2012 23:08:29 +0000 (23:08 +0000)]
Remove a test FIXME for a case which is already fixed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152349
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Thu, 8 Mar 2012 23:06:02 +0000 (23:06 +0000)]
Fix a couple of issues with literal-operator-id parsing, and provide recovery
for a few kinds of error. Specifically:
Since we're after translation phase 6, the "" token might be formed by multiple
source-level string literals. Checking the token width is not a correct way of
detecting empty string literals, due to escaped newlines. Diagnose and recover
from a missing space between "" and suffix, and from string literals other than
"", which are followed by a suffix.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152348
91177308-0d34-0410-b5e6-
96231b3b80d8
John McCall [Thu, 8 Mar 2012 22:00:17 +0000 (22:00 +0000)]
Don't crash when a statement in a block is ill-formed but
introduces cleanups anyway.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152345
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Thu, 8 Mar 2012 21:59:28 +0000 (21:59 +0000)]
When checking the encoding of an 8-bit string literal, don't just check the
first codepoint! Also, don't reject empty raw string literals for spurious
"encoding" issues. Also, don't rely on undefined behavior in ConvertUTF.c.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152344
91177308-0d34-0410-b5e6-
96231b3b80d8
Sebastian Redl [Thu, 8 Mar 2012 21:05:45 +0000 (21:05 +0000)]
Turn explicit construction of temporaries using initializer list syntax into CXXTemporaryObjectExprs, not just CXXConstructExprs, which have a worrying tendency to vanish. Fixes PR12167.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152340
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 8 Mar 2012 21:00:45 +0000 (21:00 +0000)]
Untangle getUnderlyingDeclImpl, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152339
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Thu, 8 Mar 2012 20:29:39 +0000 (20:29 +0000)]
[utils/FuzzTest] Add '--stop-on-fail' to stop the script on the first failure
without reverting the changes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152333
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Thu, 8 Mar 2012 20:29:02 +0000 (20:29 +0000)]
[AST] Clean up NamedDecl::getUnderlyingDecl() change a bit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152332
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Thu, 8 Mar 2012 20:28:59 +0000 (20:28 +0000)]
Remove stray semi-colon.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152331
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Thu, 8 Mar 2012 20:28:55 +0000 (20:28 +0000)]
[AST] APValue: Split the fast path of MakeUninit to be inline.
- This change seems to be a tiny loss on 403.gcc/combine.c (.2%), but I think
it is the right thing to do.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152330
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Thu, 8 Mar 2012 20:11:06 +0000 (20:11 +0000)]
[utils/FuzzTest] The help message says that if you don't specify --max-tests
"the script will run forever continually picking new tests to run", make it so.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152327
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Thu, 8 Mar 2012 18:56:59 +0000 (18:56 +0000)]
[utils/FuzzTest] For --filelist the option type is string, not integer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152324
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Thu, 8 Mar 2012 18:43:59 +0000 (18:43 +0000)]
[Basic] PartialDiagnostic: Manual split out the cold part of freeStorage(), the
hot path will typically profitably get inlined (based on what I see from the
users of PartialDiagnostic).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152322
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Thu, 8 Mar 2012 18:20:41 +0000 (18:20 +0000)]
[AST] Change NamedDecl::getUnderlyingDecl() to inline the fast (and incredibly common) path.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152321
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 8 Mar 2012 15:51:03 +0000 (15:51 +0000)]
Replace MarkVarRequired with a more generic
HandleCXXStaticMemberVarInstantiation. Suggested by Argyrios.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152320
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 8 Mar 2012 15:07:42 +0000 (15:07 +0000)]
Also test pr12104 with pch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152317
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 8 Mar 2012 14:39:55 +0000 (14:39 +0000)]
Implement -fno-dwarf2-cfi-asm on linux too.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152316
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Thu, 8 Mar 2012 09:02:38 +0000 (09:02 +0000)]
Ensure we don't print 123ULL_foo when printing a user-defined integer literal.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152303
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Thu, 8 Mar 2012 08:45:32 +0000 (08:45 +0000)]
Add support for cooked forms of user-defined-integer-literal and
user-defined-floating-literal. Support for raw forms of these literals
to follow.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152302
91177308-0d34-0410-b5e6-
96231b3b80d8