]> granicus.if.org Git - clang/log
clang
13 years agoAdd (hopefully) the last missing lvalue-to-rvalue conversion. Add an assertion
Richard Smith [Fri, 28 Oct 2011 03:31:48 +0000 (03:31 +0000)]
Add (hopefully) the last missing lvalue-to-rvalue conversion. Add an assertion
to catch some future implicit lvalue-to-rvalue casts of inappropriate kinds.

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

13 years agoBe sure to build a dependent expression when we see
John McCall [Fri, 28 Oct 2011 01:04:34 +0000 (01:04 +0000)]
Be sure to build a dependent expression when we see
a binary operator involving a dependently-typed overload set.

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

13 years agoFix for PR9751 to change the behavior of -Wformat warnings. If the format
Richard Trieu [Fri, 28 Oct 2011 00:41:25 +0000 (00:41 +0000)]
Fix for PR9751 to change the behavior of -Wformat warnings.  If the format
string is part of the function call, then there is no difference.  If the
format string is not, the warning will point to the call site and a note
will point to where the format string is.

Fix-it hints for strings are moved to the note if a note is emitted.  This will
prevent changes to format strings that may be used in multiple places.

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

13 years agoAdd missing lvalue-to-rvalue conversion to vector splat casts.
Richard Smith [Thu, 27 Oct 2011 23:31:58 +0000 (23:31 +0000)]
Add missing lvalue-to-rvalue conversion to vector splat casts.

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

13 years agoRemove the Alpha backend.
Dan Gohman [Thu, 27 Oct 2011 22:56:49 +0000 (22:56 +0000)]
Remove the Alpha backend.

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

13 years agoFix some cases where a CK_IntegralCast was being used to convert an lvalue to an
Richard Smith [Thu, 27 Oct 2011 22:11:44 +0000 (22:11 +0000)]
Fix some cases where a CK_IntegralCast was being used to convert an lvalue to an
rvalue. An assertion to catch this is in ImpCastExprToType will follow, but
vector operations currently trip over this (due to omitting the usual arithmetic
conversions). Also add an assert to catch missing lvalue-to-rvalue conversions
on the LHS of ->.

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

13 years agoMark these tests as requiring use of the shell.
Ted Kremenek [Thu, 27 Oct 2011 21:50:13 +0000 (21:50 +0000)]
Mark these tests as requiring use of the shell.

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

13 years agoobjc: fix an ir-gen crash caused by recent
Fariborz Jahanian [Thu, 27 Oct 2011 20:06:32 +0000 (20:06 +0000)]
objc: fix an ir-gen crash caused by recent
property refactoring. // rdar://10327068

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

13 years agoAdd mutex for accessing ASTUnit's global OnDisk data. This may be an issue as libcla...
Ted Kremenek [Thu, 27 Oct 2011 19:44:25 +0000 (19:44 +0000)]
Add mutex for accessing ASTUnit's global OnDisk data.  This may be an issue as libclang could be processing multiple ASTUnit's at once.

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

13 years agoAnnotate imprecise FP division with fpaccuracy metadata
Peter Collingbourne [Thu, 27 Oct 2011 19:19:51 +0000 (19:19 +0000)]
Annotate imprecise FP division with fpaccuracy metadata

The OpenCL single precision division operation is only required to
be accurate to 2.5ulp.  Annotate the fdiv instruction with metadata
which signals to the backend that an imprecise divide instruction
may be used.

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

13 years ago[PCH] Pull the location out of the serialized declarations and put it in the array
Argyrios Kyrtzidis [Thu, 27 Oct 2011 18:47:35 +0000 (18:47 +0000)]
[PCH] Pull the location out of the serialized declarations and put it in the array
of decl bit offsets.

This allows us to easily get at the location of a decl without deserializing it.
It increases size of Cocoa PCH by only 0.2%.

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

13 years agoMove ASTUnit's handling of temporary files and the preamble file into a lazily-create...
Ted Kremenek [Thu, 27 Oct 2011 17:55:18 +0000 (17:55 +0000)]
Move ASTUnit's handling of temporary files and the preamble file into a lazily-created static DenseMap.  This DenseMap is cleared (and the files erased) via an atexit routine in the case an ASTUnit is not destroyed.  Fixes <rdar://problem/10293367>.

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

13 years ago[libclang] Add comments.
Argyrios Kyrtzidis [Thu, 27 Oct 2011 17:36:12 +0000 (17:36 +0000)]
[libclang] Add comments.

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

13 years agoMake the loading of information attached to an IdentifierInfo from an
Douglas Gregor [Thu, 27 Oct 2011 09:33:13 +0000 (09:33 +0000)]
Make the loading of information attached to an IdentifierInfo from an
AST file more lazy, so that we don't eagerly load that information for
all known identifiers each time a new AST file is loaded. The eager
reloading made some sense in the context of precompiled headers, since
very few identifiers were defined before PCH load time. With modules,
however, a huge amount of code can get parsed before we see an
@import, so laziness becomes important here.

The approach taken to make this information lazy is fairly simple:
when we load a new AST file, we mark all of the existing identifiers
as being out-of-date. Whenever we want to access information that may
come from an AST (e.g., whether the identifier has a macro definition,
or what top-level declarations have that name), we check the
out-of-date bit and, if it's set, ask the AST reader to update the
IdentifierInfo from the AST files. The update is a merge, and we now
take care to merge declarations before/after imports with declarations
from multiple imports.

The results of this optimization are fairly dramatic. On a small
application that brings in 14 non-trivial modules, this takes modules
from being > 3x slower than a "perfect" PCH file down to 30% slower
for a full rebuild. A partial rebuild (where the PCH file or modules
can be re-used) is down to 7% slower. Making the PCH file just a
little imperfect (e.g., adding two smallish modules used by a bunch of
.m files that aren't in the PCH file) tips the scales in favor of the
modules approach, with 24% faster partial rebuilds.

This is just a first step; the lazy scheme could possibly be improved
by adding versioning, so we don't search into modules we already
searched. Moreover, we'll need similar lazy schemes for all of the
other lookup data structures, such as DeclContexts.

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

13 years agoTeach format string analysis that "%zu" means size_t.
Hans Wennborg [Thu, 27 Oct 2011 08:29:09 +0000 (08:29 +0000)]
Teach format string analysis that "%zu" means size_t.

The code had it backwards, thinking size_t was signed, and using that for "%zd".

Also let the analysis get the types for (u)intmax_t while we are at it.

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

13 years agoMove these test from checking assembly to checking LLVM IR. Should fix fallout
Nick Lewycky [Thu, 27 Oct 2011 07:11:43 +0000 (07:11 +0000)]
Move these test from checking assembly to checking LLVM IR. Should fix fallout
from r143097.

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

13 years ago[analyzer] Optimize by not generating empty transitions in CheckerContext
Anna Zaks [Thu, 27 Oct 2011 00:59:32 +0000 (00:59 +0000)]
[analyzer] Optimize by not generating empty transitions in CheckerContext

Go not generate a new transition by addTransition methods if nothing changed.

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

13 years ago[analyzer] Move enqueueEndOfFunction into CoreEngine.
Anna Zaks [Thu, 27 Oct 2011 00:59:28 +0000 (00:59 +0000)]
[analyzer] Move enqueueEndOfFunction into CoreEngine.

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

13 years ago[analyzer] Make CoreEngine responsible for enqueueing Stmt Nodes.
Anna Zaks [Thu, 27 Oct 2011 00:59:23 +0000 (00:59 +0000)]
[analyzer] Make CoreEngine responsible for enqueueing Stmt Nodes.

Enqueue the nodes generated as the result of processing a statement
inside the Core Engine. This makes sure ExpEngine does not access
CoreEngine's private members and is more concise.

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

13 years agoMake use of the parameter in Sema::ActOnObjCTemporaryExitContainerContext.
Argyrios Kyrtzidis [Thu, 27 Oct 2011 00:53:06 +0000 (00:53 +0000)]
Make use of the parameter in Sema::ActOnObjCTemporaryExitContainerContext.

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

13 years agoFix crash on an @interface nested inside @implementation, rdar://10336158
Argyrios Kyrtzidis [Thu, 27 Oct 2011 00:09:34 +0000 (00:09 +0000)]
Fix crash on an @interface nested inside @implementation, rdar://10336158

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

13 years agoFor the "'@end' is missing in implementation context" point at the location of '@'.
Argyrios Kyrtzidis [Thu, 27 Oct 2011 00:09:29 +0000 (00:09 +0000)]
For the "'@end' is missing in implementation context" point at the location of '@'.

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

13 years agoDo not warn when weak-import attribute is applied to enum
Fariborz Jahanian [Wed, 26 Oct 2011 23:59:12 +0000 (23:59 +0000)]
Do not warn when weak-import attribute is applied to enum
decl. in Darwin due to certain projects requirement.
// rdar://10277579

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

13 years agoDisalbe more Microsoft-specific stuff.
Douglas Gregor [Wed, 26 Oct 2011 23:19:04 +0000 (23:19 +0000)]
Disalbe more Microsoft-specific stuff.

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

13 years ago[analyzer] Add getLocationContext to CheckerContext
Anna Zaks [Wed, 26 Oct 2011 21:06:44 +0000 (21:06 +0000)]
[analyzer] Add getLocationContext to CheckerContext

CheckerContext::getPredecessor is only used to get to the LocationContext
half of the times.

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

13 years ago[analyzer] Remove EmitBasicReport form CheckerContext.
Anna Zaks [Wed, 26 Oct 2011 21:06:39 +0000 (21:06 +0000)]
[analyzer] Remove EmitBasicReport form CheckerContext.

The path sensitive checkers should use EmitBasicReport, which provides the
node information.

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

13 years ago[analyzer] Rename generateNode -> addTransition in CheckerContext
Anna Zaks [Wed, 26 Oct 2011 21:06:34 +0000 (21:06 +0000)]
[analyzer] Rename generateNode -> addTransition in CheckerContext

Also document addTransition methods.

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

13 years ago[analyzer] Remove forward declarations of GenericNodeBuilder
Anna Zaks [Wed, 26 Oct 2011 21:06:25 +0000 (21:06 +0000)]
[analyzer] Remove forward declarations of GenericNodeBuilder

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

13 years ago[analyzer] GenericNodeBuilder -> NodeBuilder.
Anna Zaks [Wed, 26 Oct 2011 21:06:22 +0000 (21:06 +0000)]
[analyzer] GenericNodeBuilder -> NodeBuilder.

Remove GenericNodeBuilder and use a class inherited from NodeBuilder instead.

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

13 years agoObjective-c: fix an ir-gen crash where objc messag returns a _Complex
Fariborz Jahanian [Wed, 26 Oct 2011 20:53:59 +0000 (20:53 +0000)]
Objective-c: fix an ir-gen crash where objc messag returns a _Complex
value and ABI requires return slot to be passed as first
argument to message sent. // rdar://10331109

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

13 years agoFix this tests on the bots.
Rafael Espindola [Wed, 26 Oct 2011 20:46:27 +0000 (20:46 +0000)]
Fix this tests on the bots.

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

13 years agoFix pr9614 by not emitting an available_externally function when it calls
Rafael Espindola [Wed, 26 Oct 2011 20:41:06 +0000 (20:41 +0000)]
Fix pr9614 by not emitting an available_externally function when it calls
itself via an asm label.

available_externally functions are supposed to correspond to an external
function, and that is not the case in the examples in pr9614.

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

13 years agoTry to appease the Windows builders
Douglas Gregor [Wed, 26 Oct 2011 20:33:43 +0000 (20:33 +0000)]
Try to appease the Windows builders

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

13 years agoPull out conversion on LHS of -> and . into its own function. This happens
Richard Smith [Wed, 26 Oct 2011 19:06:56 +0000 (19:06 +0000)]
Pull out conversion on LHS of -> and . into its own function. This happens
implicitly in LookupMemberExpr and explicitly in cases where template
instantiation doesn't redo the lookup.

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

13 years agoEliminate a hang while loading a sequence of redeclarable entities. In
Douglas Gregor [Wed, 26 Oct 2011 17:53:41 +0000 (17:53 +0000)]
Eliminate a hang while loading a sequence of redeclarable entities. In
essence, the redeclaration chain for a class could end up in an
inconsistent state while deserializing multiple declarations in that
chain, where the circular linked list was not, in fact,
circular. Since only two redeclarations of the same entity will get
loaded when we're in this state, restore circularity when both have
been loaded. Fixes <rdar://problem/10324940> / PR11195.

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

13 years agoDisable on Windows, for real.
Douglas Gregor [Wed, 26 Oct 2011 14:35:30 +0000 (14:35 +0000)]
Disable on Windows, for real.

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

13 years agoCompute the promoted integer type of fixed-width enums correctly. Found by inspection.
Eli Friedman [Wed, 26 Oct 2011 07:38:19 +0000 (07:38 +0000)]
Compute the promoted integer type of fixed-width enums correctly.  Found by inspection.

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

13 years agoCorrectly perform integral promotions on wchar_t/char16_t/char32_t in C++. <rdar...
Eli Friedman [Wed, 26 Oct 2011 07:22:48 +0000 (07:22 +0000)]
Correctly perform integral promotions on wchar_t/char16_t/char32_t in C++. <rdar://problem/10309088>.

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

13 years agoFix crash due to missing array-to-pointer decay when instantiating an unresolved
Richard Smith [Wed, 26 Oct 2011 06:49:26 +0000 (06:49 +0000)]
Fix crash due to missing array-to-pointer decay when instantiating an unresolved
member expression. Refactoring to follow.

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

13 years agoUnresolvedMemberExprs need lvalue-to-rvalue conversions during template
Richard Smith [Wed, 26 Oct 2011 06:15:36 +0000 (06:15 +0000)]
UnresolvedMemberExprs need lvalue-to-rvalue conversions during template
instantiations too.

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

13 years agoTurn off delayed template parsing for this test
Douglas Gregor [Tue, 25 Oct 2011 20:12:15 +0000 (20:12 +0000)]
Turn off delayed template parsing for this test

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

13 years ago[analyzer] Remove getEngine() form CheckerContext
Anna Zaks [Tue, 25 Oct 2011 19:57:11 +0000 (19:57 +0000)]
[analyzer] Remove getEngine() form CheckerContext

A step toward making sure that diagnostics report should only
be generated though the CheckerContext and not though BugReporter
or ExprEngine directly.

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

13 years ago[analyzer] Simplify CheckerContext
Anna Zaks [Tue, 25 Oct 2011 19:57:06 +0000 (19:57 +0000)]
[analyzer] Simplify CheckerContext

Remove dead members/parameters: ProgramState, respondsToCallback, autoTransition.
Remove addTransition method since it's the same as generateNode. Maybe we should
rename generateNode to genTransition (since a transition is always automatically
generated)?

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

13 years ago[analyzer] Remove unused headers.
Anna Zaks [Tue, 25 Oct 2011 19:56:58 +0000 (19:56 +0000)]
[analyzer] Remove unused headers.

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

13 years ago[analyzer] Make branch for condition callback use CheckerContext
Anna Zaks [Tue, 25 Oct 2011 19:56:54 +0000 (19:56 +0000)]
[analyzer] Make branch for condition callback use CheckerContext

Now, all the path sensitive checkers use CheckerContext!

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

13 years ago[analyze] Convert EndOfPath callback to use CheckerContext
Anna Zaks [Tue, 25 Oct 2011 19:56:48 +0000 (19:56 +0000)]
[analyze] Convert EndOfPath callback to use CheckerContext

Get rid of the EndOfPathBuilder completely.
Use the generic NodeBuilder to generate nodes.
Enqueue the end of path frontier explicitly.

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

13 years agoHandle redundant 'typename' on base class specifications.
David Blaikie [Tue, 25 Oct 2011 18:46:41 +0000 (18:46 +0000)]
Handle redundant 'typename' on base class specifications.

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

13 years agoFix erroneous name-specifiers prior to decltypes better/correctly as per Doug's feedback.
David Blaikie [Tue, 25 Oct 2011 18:17:58 +0000 (18:17 +0000)]
Fix erroneous name-specifiers prior to decltypes better/correctly as per Doug's feedback.

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

13 years agoRestore r142914 and r142915, now with missing file and apparent
John McCall [Tue, 25 Oct 2011 17:37:35 +0000 (17:37 +0000)]
Restore r142914 and r142915, now with missing file and apparent
GCC compiler workaround.

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

13 years agoInitialize the BaseLoc for decltype base type specifications.
David Blaikie [Tue, 25 Oct 2011 17:14:10 +0000 (17:14 +0000)]
Initialize the BaseLoc for decltype base type specifications.

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

13 years agoFix cases where the optional nested-name-specifier erroneously preceeded a decltype...
David Blaikie [Tue, 25 Oct 2011 17:10:12 +0000 (17:10 +0000)]
Fix cases where the optional nested-name-specifier erroneously preceeded a decltype-specification when specifying a base type.

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

13 years agoSupport the use of decltype for specifying base types. Fixes PR11216.
David Blaikie [Tue, 25 Oct 2011 15:01:20 +0000 (15:01 +0000)]
Support the use of decltype for specifying base types. Fixes PR11216.

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

13 years agoRevert r142914 and r142915, due to possibly missing file.
NAKAMURA Takumi [Tue, 25 Oct 2011 14:32:25 +0000 (14:32 +0000)]
Revert r142914 and r142915, due to possibly missing file.

r142914: "Introduce a placeholder type for "pseudo object""
r142915: "Pull the pseudo-object stuff into its own file."

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

13 years agoChange an int64_t to an intptr_t so that we don't end up with crashes in the back...
David Chisnall [Tue, 25 Oct 2011 10:12:21 +0000 (10:12 +0000)]
Change an int64_t to an intptr_t so that we don't end up with crashes in the back end on large classes on 32-bit.

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

13 years agoPull the pseudo-object stuff into its own file.
John McCall [Tue, 25 Oct 2011 08:42:34 +0000 (08:42 +0000)]
Pull the pseudo-object stuff into its own file.
Tidy up some marginally related code just to annoy
single-purpose-commit lovers.  No functionality change.

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

13 years agoIntroduce a placeholder type for "pseudo object"
John McCall [Tue, 25 Oct 2011 07:27:56 +0000 (07:27 +0000)]
Introduce a placeholder type for "pseudo object"
expressions: expressions which refer to a logical rather
than a physical l-value, where the logical object is
actually accessed via custom getter/setter code.
A subsequent patch will generalize the AST for these
so that arbitrary "implementing" sub-expressions can
be provided.

Right now the only client is ObjC properties, but
this should be generalizable to similar language
features, e.g. Managed C++'s __property methods.

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

13 years agoAllow the -fno-operator-names option to be passed down to the rest
Eric Christopher [Tue, 25 Oct 2011 07:13:06 +0000 (07:13 +0000)]
Allow the -fno-operator-names option to be passed down to the rest
of the compiler.

Fixes PR10198
Patch by Brian Foley!

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

13 years agoDon't forget the lvalue-to-rvalue conversion on the LHS when instantiating a
Richard Smith [Tue, 25 Oct 2011 06:33:21 +0000 (06:33 +0000)]
Don't forget the lvalue-to-rvalue conversion on the LHS when instantiating a
dependent ->, where the member being referred to is an anonymous struct or
union. This path was missed by the fix in r142890.

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

13 years agoRelax restriction of assigning to 'self' in ARC when a method is attributed with...
Ted Kremenek [Tue, 25 Oct 2011 04:52:20 +0000 (04:52 +0000)]
Relax restriction of assigning to 'self' in ARC when a method is attributed with ns_consumes_self.  Fixes <rdar://problem/10274056>.

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

13 years agoTweak printf format string parsing to accept 'hh' conversion specifier to accept...
Ted Kremenek [Tue, 25 Oct 2011 04:20:41 +0000 (04:20 +0000)]
Tweak printf format string parsing to accept 'hh' conversion specifier to accept any char, not just signed char.  Fixes <rdar://problem/10303638>.

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

13 years agoUndo unnecessary change
Douglas Gregor [Tue, 25 Oct 2011 03:47:25 +0000 (03:47 +0000)]
Undo unnecessary change

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

13 years agoCheck for unexpanded parameter packs in the name that guards a
Douglas Gregor [Tue, 25 Oct 2011 03:44:56 +0000 (03:44 +0000)]
Check for unexpanded parameter packs in the name that guards a
Microsoft __if_exists/__if_not_exists statement. Also note that we
weren't traversing DeclarationNameInfo *at all* within the
RecursiveASTVisitor, which would be rather fatal for variadic
templates.

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

13 years agoRemove extra copy of contents of header file resulting in a patch being applied twice...
Ted Kremenek [Tue, 25 Oct 2011 03:37:17 +0000 (03:37 +0000)]
Remove extra copy of contents of header file resulting in a patch being applied twice.  Aren't include guards great?

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

13 years agoMake the -Wc++11-compat warnings ignored by default, so we don't break
Douglas Gregor [Tue, 25 Oct 2011 03:07:45 +0000 (03:07 +0000)]
Make the -Wc++11-compat warnings ignored by default, so we don't break
valid C++98/03 code. However, add these warnings to -Wall, for those
who obviously already like clean code.

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

13 years agoImplement support for dependent Microsoft __if_exists/__if_not_exists
Douglas Gregor [Tue, 25 Oct 2011 01:33:02 +0000 (01:33 +0000)]
Implement support for dependent Microsoft __if_exists/__if_not_exists
statements. As noted in the documentation for the AST node, the
semantics of __if_exists/__if_not_exists are somewhat different from
the way Visual C++ implements them, because our parsed-template
representation can't accommodate VC++ semantics without serious
contortions. Hopefully this implementation is "good enough".

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

13 years agoTidy up testcase from r142890, spotted by Chandler.
Richard Smith [Tue, 25 Oct 2011 01:05:41 +0000 (01:05 +0000)]
Tidy up testcase from r142890, spotted by Chandler.

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

13 years agoRemove another Blackfin test.
Dan Gohman [Tue, 25 Oct 2011 01:02:36 +0000 (01:02 +0000)]
Remove another Blackfin test.

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

13 years agoDon't forget the lvalue-to-rvalue conversion on the LHS of an -> when rebuilding
Richard Smith [Tue, 25 Oct 2011 00:41:24 +0000 (00:41 +0000)]
Don't forget the lvalue-to-rvalue conversion on the LHS of an -> when rebuilding
it during template instantiation, for a known RHS decl.

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

13 years ago[PCH] When visiting preprocessed entities, make it possible to avoid deserializing
Argyrios Kyrtzidis [Tue, 25 Oct 2011 00:29:50 +0000 (00:29 +0000)]
[PCH] When visiting preprocessed entities, make it possible to avoid deserializing
preprocessed entities that are #included in the range that we are interested.

This is useful when we are interested in preprocessed entities of a specific file, e.g
when we are annotating tokens. There is also an optimization where we cache the last
result of PreprocessingRecord::getPreprocessedEntitiesInRange and we re-use it if
there is a call with the same range as before.

rdar://10313365

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

13 years agoUse assert(0) instead of duplicating the check, suggestion by Anna.
Argyrios Kyrtzidis [Tue, 25 Oct 2011 00:29:44 +0000 (00:29 +0000)]
Use assert(0) instead of duplicating the check, suggestion by Anna.

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

13 years agoAdd source-level dominators analysis. Patch by Guoping Long!
Ted Kremenek [Tue, 25 Oct 2011 00:25:24 +0000 (00:25 +0000)]
Add source-level dominators analysis.  Patch by Guoping Long!

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

13 years agoClean up, as suggested by John.
Richard Smith [Tue, 25 Oct 2011 00:21:54 +0000 (00:21 +0000)]
Clean up, as suggested by John.

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

13 years agoRemove more SystemZ (s390) tests.
Dan Gohman [Tue, 25 Oct 2011 00:15:21 +0000 (00:15 +0000)]
Remove more SystemZ (s390) tests.

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

13 years agoRemove the Blackfin backend.
Dan Gohman [Tue, 25 Oct 2011 00:06:12 +0000 (00:06 +0000)]
Remove the Blackfin backend.

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

13 years agoRemove the SystemZ backend.
Dan Gohman [Mon, 24 Oct 2011 23:48:52 +0000 (23:48 +0000)]
Remove the SystemZ backend.

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

13 years agoDo not drop type qualifiers in -flimit-debug-info mode.
Devang Patel [Mon, 24 Oct 2011 23:15:17 +0000 (23:15 +0000)]
Do not drop type qualifiers in -flimit-debug-info mode.

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

13 years agoRevert r142844, it broke selfhost. The problem appears to be a missing
Richard Smith [Mon, 24 Oct 2011 23:14:33 +0000 (23:14 +0000)]
Revert r142844, it broke selfhost. The problem appears to be a missing
lvalue-to-rvalue conversion on the LHS operand of '->'.

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

13 years agoAdd explanatory comments for ICE checking in C99 mode.
Richard Smith [Mon, 24 Oct 2011 22:35:48 +0000 (22:35 +0000)]
Add explanatory comments for ICE checking in C99 mode.

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

13 years agoRework Microsoft __if_exists/__if_not_exists parsing and semantic
Douglas Gregor [Mon, 24 Oct 2011 22:31:10 +0000 (22:31 +0000)]
Rework Microsoft __if_exists/__if_not_exists parsing and semantic
analysis to separate dependent names from non-dependent names. For
dependent names, we'll behave differently from Visual C++:

  - For __if_exists/__if_not_exists at class scope, we'll just warn
    and then ignore them.
  - For __if_exists/__if_not_exists in statements, we'll treat the
    inner statement as a compound statement, which we only instantiate
    in templates where the dependent name (after instantiation)
    exists. This behavior is different from VC++, but it's as close as
    we can get without encroaching ridiculousness.

The latter part (dependent statements) is not yet implemented.

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

13 years agoDon't try to emit CK_LValueBitCast casts as constants. PR9558.
Eli Friedman [Mon, 24 Oct 2011 22:25:55 +0000 (22:25 +0000)]
Don't try to emit CK_LValueBitCast casts as constants.  PR9558.

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

13 years agoWhen we perform a lookup for a dependent name that is a member of an
Douglas Gregor [Mon, 24 Oct 2011 22:24:50 +0000 (22:24 +0000)]
When we perform a lookup for a dependent name that is a member of an
unknown specialization, treat this the same way as if the name were
not found in the current instantiation. No actual functionality
change, since apparently nothing depends on this.

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

13 years ago[analyzer] Node builders cleanup + comments
Anna Zaks [Mon, 24 Oct 2011 21:19:59 +0000 (21:19 +0000)]
[analyzer] Node builders cleanup + comments
Renamed PureNodeBuilder->StmtNodeBuilder.

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

13 years ago[analyzer] Remove the old StmtNodeBuilder.
Anna Zaks [Mon, 24 Oct 2011 21:19:53 +0000 (21:19 +0000)]
[analyzer] Remove the old StmtNodeBuilder.

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

13 years ago[analyzer] Completely remove the global Builder object.
Anna Zaks [Mon, 24 Oct 2011 21:19:48 +0000 (21:19 +0000)]
[analyzer] Completely remove the global Builder object.

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

13 years ago[analyzer] Remove more dependencies from global Builder
Anna Zaks [Mon, 24 Oct 2011 21:19:43 +0000 (21:19 +0000)]
[analyzer] Remove more dependencies from global Builder
- OSAtomicChecker
- ExprEngine::processStmt

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

13 years agoConstant expression evaluation: evaluate lvalues as lvalues, and rvalues as
Richard Smith [Mon, 24 Oct 2011 21:07:08 +0000 (21:07 +0000)]
Constant expression evaluation: evaluate lvalues as lvalues, and rvalues as
rvalues, as C++11 constant evaluation semantics require. DeclRefs referring to
references can now use the normal initialization-caching codepath, which
incidentally fixes a crash in cyclic initialization of references.

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

13 years agoSwitch to a more natural formatting of the macro name printing.
Chandler Carruth [Mon, 24 Oct 2011 18:51:08 +0000 (18:51 +0000)]
Switch to a more natural formatting of the macro name printing.
Suggested by John McCall.

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

13 years agoConstant expression evaluation: factor out handling of ignored values.
Richard Smith [Mon, 24 Oct 2011 18:44:57 +0000 (18:44 +0000)]
Constant expression evaluation: factor out handling of ignored values.

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

13 years agoIn accordance with the C89, C99 and C++98 standards, ICEs can only contain
Richard Smith [Mon, 24 Oct 2011 18:26:35 +0000 (18:26 +0000)]
In accordance with the C89, C99 and C++98 standards, ICEs can only contain
floating-point literals if they are the immediate operands of casts.
ImplicitCastExpr is not a cast in the language-standards sense.

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

13 years ago[analyzer] Convert ExprEngine::visit() to use short lived builders.
Anna Zaks [Mon, 24 Oct 2011 18:26:19 +0000 (18:26 +0000)]
[analyzer] Convert ExprEngine::visit() to use short lived builders.

This commit removes the major functional dependency on the ExprEngine::Builder
member variable.

In some cases the code became more verbose. Particularly, we call takeNodes()
and addNodes() to move responsibility for the nodes from one builder to another.
This will get simplified later on.

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

13 years ago[analyzer] Convert VisitDeclStmt to use local node builder.
Anna Zaks [Mon, 24 Oct 2011 18:26:12 +0000 (18:26 +0000)]
[analyzer] Convert VisitDeclStmt to use local node builder.

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

13 years ago[analyzer] Convert more functions (ex:evalBind()) to iterative builders
Anna Zaks [Mon, 24 Oct 2011 18:26:08 +0000 (18:26 +0000)]
[analyzer] Convert more functions (ex:evalBind()) to iterative builders

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

13 years ago[analyzer] Convert VisitUnaryOperator to use short lived Node builders
Anna Zaks [Mon, 24 Oct 2011 18:26:03 +0000 (18:26 +0000)]
[analyzer] Convert VisitUnaryOperator to use short lived Node builders

To convert iteratively, we take the nodes the local builder will
process from the from the global builder and add the generated nodes
after the short lived builder is done. PureStmtNodeBuilder is the
one we should eventually use everywhere. Added Stmt index and Builder
context as ExprEngine globals. To avoid passing them around.

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

13 years ago[analyzer] Use a temporary builder in CheckerContext.
Anna Zaks [Mon, 24 Oct 2011 18:25:58 +0000 (18:25 +0000)]
[analyzer] Use a temporary builder in CheckerContext.

First step toward removing the global Stmt builder. Added several transitional methods (like takeNodes/addNodes).
+ Stop early if the set of exploded nodes for the next iteration is empty.

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

13 years ago[analyzer] Pass external Dst set to NodeBuilder
Anna Zaks [Mon, 24 Oct 2011 18:25:53 +0000 (18:25 +0000)]
[analyzer] Pass external Dst set to NodeBuilder

This moves the responsibility for storing the output node set from the
builder to the clients. The builder is just responsible for transforming
an input set into the output set: {SrcSet/SrcNode} -> {Frontier}.

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

13 years agoSimplify parsing ellipsis in Parser::ParseAlignArgument, spotted by Doug.
Peter Collingbourne [Mon, 24 Oct 2011 17:56:00 +0000 (17:56 +0000)]
Simplify parsing ellipsis in Parser::ParseAlignArgument, spotted by Doug.

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

13 years agoConstant expression evaluation: factor out VarDecl initializer evaluation and
Richard Smith [Mon, 24 Oct 2011 17:54:18 +0000 (17:54 +0000)]
Constant expression evaluation: factor out VarDecl initializer evaluation and
caching.

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

13 years agoMinor refactoring of my last patch. Per Doug's suggestion.
Fariborz Jahanian [Mon, 24 Oct 2011 17:30:45 +0000 (17:30 +0000)]
Minor refactoring of my last patch. Per Doug's suggestion.

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

13 years ago[libclang] Make sure we don't try to erase past the StoredDiagnostics vector.
Argyrios Kyrtzidis [Mon, 24 Oct 2011 17:25:20 +0000 (17:25 +0000)]
[libclang] Make sure we don't try to erase past the StoredDiagnostics vector.

Ted came upon the bug but I couldn't make a test out of it.

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

13 years agoFix mismatched new[]/delete[].
Benjamin Kramer [Mon, 24 Oct 2011 17:22:36 +0000 (17:22 +0000)]
Fix mismatched new[]/delete[].

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