Commit Graph

22064 Commits

Author SHA1 Message Date
Anna Zaks c9abbe2b3e [analyzer] Add getLocationContext to CheckerContext
CheckerContext::getPredecessor is only used to get to the LocationContext
half of the times.

llvm-svn: 143061
2011-10-26 21:06:44 +00:00
Anna Zaks 6b1c21268d [analyzer] Remove EmitBasicReport form CheckerContext.
The path sensitive checkers should use EmitBasicReport, which provides the
node information.

llvm-svn: 143060
2011-10-26 21:06:39 +00:00
Anna Zaks da4c8d6811 [analyzer] Rename generateNode -> addTransition in CheckerContext
Also document addTransition methods.

llvm-svn: 143059
2011-10-26 21:06:34 +00:00
Anna Zaks b31d0143dd [analyzer] GenericNodeBuilder -> NodeBuilder.
Remove GenericNodeBuilder and use a class inherited from NodeBuilder instead.

llvm-svn: 143057
2011-10-26 21:06:22 +00:00
Fariborz Jahanian b005070b83 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

llvm-svn: 143053
2011-10-26 20:53:59 +00:00
Rafael Espindola c594135b68 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.

llvm-svn: 143049
2011-10-26 20:41:06 +00:00
Richard Smith cab9a7d51c 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.

llvm-svn: 143046
2011-10-26 19:06:56 +00:00
Douglas Gregor 3e30010d99 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.

llvm-svn: 143037
2011-10-26 17:53:41 +00:00
Eli Friedman 64d9504b8f Compute the promoted integer type of fixed-width enums correctly. Found by inspection.
llvm-svn: 143021
2011-10-26 07:38:19 +00:00
Eli Friedman 3f37c1ce4c Correctly perform integral promotions on wchar_t/char16_t/char32_t in C++. <rdar://problem/10309088>.
llvm-svn: 143019
2011-10-26 07:22:48 +00:00
Richard Smith ae1bab56d9 Fix crash due to missing array-to-pointer decay when instantiating an unresolved
member expression. Refactoring to follow.

llvm-svn: 143017
2011-10-26 06:49:26 +00:00
Richard Smith 3d5c1fa93f UnresolvedMemberExprs need lvalue-to-rvalue conversions during template
instantiations too.

llvm-svn: 143016
2011-10-26 06:15:36 +00:00
Anna Zaks 58734db080 [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.

llvm-svn: 142947
2011-10-25 19:57:11 +00:00
Anna Zaks b473816b4a [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)?

llvm-svn: 142946
2011-10-25 19:57:06 +00:00
Anna Zaks 513921dc8a [analyzer] Remove unused headers.
llvm-svn: 142945
2011-10-25 19:56:58 +00:00
Anna Zaks f380534a1a [analyzer] Make branch for condition callback use CheckerContext
Now, all the path sensitive checkers use CheckerContext!

llvm-svn: 142944
2011-10-25 19:56:54 +00:00
Anna Zaks 3eae33412d [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.

llvm-svn: 142943
2011-10-25 19:56:48 +00:00
David Blaikie dd58d4ca8f Handle redundant 'typename' on base class specifications.
llvm-svn: 142937
2011-10-25 18:46:41 +00:00
David Blaikie afa155fb88 Fix erroneous name-specifiers prior to decltypes better/correctly as per Doug's feedback.
llvm-svn: 142935
2011-10-25 18:17:58 +00:00
John McCall 526ab47a55 Restore r142914 and r142915, now with missing file and apparent
GCC compiler workaround.

llvm-svn: 142931
2011-10-25 17:37:35 +00:00
David Blaikie b75951f477 Initialize the BaseLoc for decltype base type specifications.
llvm-svn: 142929
2011-10-25 17:14:10 +00:00
David Blaikie 1cd50022b2 Fix cases where the optional nested-name-specifier erroneously preceeded a decltype-specification when specifying a base type.
llvm-svn: 142928
2011-10-25 17:10:12 +00:00
David Blaikie 00ee7a081d Support the use of decltype for specifying base types. Fixes PR11216.
llvm-svn: 142926
2011-10-25 15:01:20 +00:00
NAKAMURA Takumi 9a8f13961c 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."
llvm-svn: 142921
2011-10-25 14:32:25 +00:00
David Chisnall e89ac0666b 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.
llvm-svn: 142918
2011-10-25 10:12:21 +00:00
John McCall 2ab33d28a8 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.

llvm-svn: 142915
2011-10-25 08:42:34 +00:00
John McCall c4a2d3259f 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.

llvm-svn: 142914
2011-10-25 07:27:56 +00:00
Eric Christopher 8605082dac Allow the -fno-operator-names option to be passed down to the rest
of the compiler.

Fixes PR10198
Patch by Brian Foley!

llvm-svn: 142913
2011-10-25 07:13:06 +00:00
Richard Smith d4268d91e7 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.

llvm-svn: 142910
2011-10-25 06:33:21 +00:00
Ted Kremenek 7b2fbc61de Relax restriction of assigning to 'self' in ARC when a method is attributed with ns_consumes_self. Fixes <rdar://problem/10274056>.
llvm-svn: 142909
2011-10-25 04:52:20 +00:00
Ted Kremenek 74e82bd190 Tweak printf format string parsing to accept 'hh' conversion specifier to accept any char, not just signed char. Fixes <rdar://problem/10303638>.
llvm-svn: 142908
2011-10-25 04:20:41 +00:00
Douglas Gregor 4a2a8f7fb8 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.

llvm-svn: 142906
2011-10-25 03:44:56 +00:00
Douglas Gregor deb4a2be67 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".

llvm-svn: 142901
2011-10-25 01:33:02 +00:00
Richard Smith 841222ea75 Don't forget the lvalue-to-rvalue conversion on the LHS of an -> when rebuilding
it during template instantiation, for a known RHS decl.

llvm-svn: 142890
2011-10-25 00:41:24 +00:00
Argyrios Kyrtzidis 429ec024f8 [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

llvm-svn: 142887
2011-10-25 00:29:50 +00:00
Argyrios Kyrtzidis 8edffaa611 Use assert(0) instead of duplicating the check, suggestion by Anna.
llvm-svn: 142886
2011-10-25 00:29:44 +00:00
Ted Kremenek 0062e74961 Add source-level dominators analysis. Patch by Guoping Long!
llvm-svn: 142885
2011-10-25 00:25:24 +00:00
Richard Smith 2d7bb04788 Clean up, as suggested by John.
llvm-svn: 142884
2011-10-25 00:21:54 +00:00
Dan Gohman 93127aecb9 Remove the Blackfin backend.
llvm-svn: 142881
2011-10-25 00:06:12 +00:00
Dan Gohman 53bb0ff685 Remove the SystemZ backend.
llvm-svn: 142879
2011-10-24 23:48:52 +00:00
Devang Patel 242ce91ecc Do not drop type qualifiers in -flimit-debug-info mode.
llvm-svn: 142873
2011-10-24 23:15:17 +00:00
Richard Smith 733237db23 Revert r142844, it broke selfhost. The problem appears to be a missing
lvalue-to-rvalue conversion on the LHS operand of '->'.

llvm-svn: 142872
2011-10-24 23:14:33 +00:00
Richard Smith 62f6595122 Add explanatory comments for ICE checking in C99 mode.
llvm-svn: 142866
2011-10-24 22:35:48 +00:00
Douglas Gregor 43edb32f1f 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.

llvm-svn: 142864
2011-10-24 22:31:10 +00:00
Eli Friedman 9190e19b66 Don't try to emit CK_LValueBitCast casts as constants. PR9558.
llvm-svn: 142863
2011-10-24 22:25:55 +00:00
Douglas Gregor 89ab56d5fb 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.

llvm-svn: 142862
2011-10-24 22:24:50 +00:00
Anna Zaks e4e5712cd7 [analyzer] Node builders cleanup + comments
Renamed PureNodeBuilder->StmtNodeBuilder.

llvm-svn: 142849
2011-10-24 21:19:59 +00:00
Anna Zaks 2338c15efe [analyzer] Remove the old StmtNodeBuilder.
llvm-svn: 142848
2011-10-24 21:19:53 +00:00
Anna Zaks 4c9169254f [analyzer] Completely remove the global Builder object.
llvm-svn: 142847
2011-10-24 21:19:48 +00:00
Anna Zaks 7b8a2609ff [analyzer] Remove more dependencies from global Builder
- OSAtomicChecker
- ExprEngine::processStmt

llvm-svn: 142846
2011-10-24 21:19:43 +00:00