]> granicus.if.org Git - clang/log
clang
12 years agoAdd some ARM EABI preprocessor builtins tests
Anton Korobeynikov [Sat, 8 Sep 2012 08:45:10 +0000 (08:45 +0000)]
Add some ARM EABI preprocessor builtins tests

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

12 years agoDo not construct StringRef from NULL argument.
Anton Korobeynikov [Sat, 8 Sep 2012 08:22:13 +0000 (08:22 +0000)]
Do not construct StringRef from NULL argument.

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

12 years agoProvide some ACLE C defines. This should fix PR13796
Anton Korobeynikov [Sat, 8 Sep 2012 08:08:27 +0000 (08:08 +0000)]
Provide some ACLE C defines. This should fix PR13796

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

12 years agoTry disabling the FileCheck part of the retain-release.m test to see if it fixes...
Ted Kremenek [Sat, 8 Sep 2012 07:40:15 +0000 (07:40 +0000)]
Try disabling the FileCheck part of the retain-release.m test to see if it fixes the buildbots.

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

12 years agoFix bug in BugReporter::RemoveUneededCalls() where "prunable"
Ted Kremenek [Sat, 8 Sep 2012 07:18:18 +0000 (07:18 +0000)]
Fix bug in BugReporter::RemoveUneededCalls() where "prunable"
PathDiagnosticEventPieces were *always* pruned.  Instead, they
are suppose to only be pruned if the entire call gets pruned.

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

12 years agoWhen a bad UTF-8 encoding or bogus escape sequence is encountered in a
Richard Smith [Sat, 8 Sep 2012 07:16:20 +0000 (07:16 +0000)]
When a bad UTF-8 encoding or bogus escape sequence is encountered in a
string literal, produce a diagnostic pointing at the erroneous character
range, not at the start of the literal.

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

12 years agoThis test does not require --exact-match from FileCheck.
Ted Kremenek [Sat, 8 Sep 2012 04:29:08 +0000 (04:29 +0000)]
This test does not require --exact-match from FileCheck.

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

12 years agoAttempt (again) to stabilize the order of the emission of diagnostics
Ted Kremenek [Sat, 8 Sep 2012 04:26:37 +0000 (04:26 +0000)]
Attempt (again) to stabilize the order of the emission of diagnostics
of the analyzer by using the FullProfile() of a PathDiagnostic
for ordering them.

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

12 years agoFormat strings: suggest %lld instead of %qd and %Ld with -Wformat-non-iso.
Jordan Rose [Sat, 8 Sep 2012 04:00:12 +0000 (04:00 +0000)]
Format strings: suggest %lld instead of %qd and %Ld with -Wformat-non-iso.

As a corollary to the previous commit, even when an extension is
available, we can still offer a fixit to the standard modifier.

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

12 years agoFormat strings: %Ld isn't available on Darwin or Windows.
Jordan Rose [Sat, 8 Sep 2012 04:00:03 +0000 (04:00 +0000)]
Format strings: %Ld isn't available on Darwin or Windows.

This seems to be a GNU libc extension; we offer a fixit to %lld on
these platforms.

<rdar://problem/11518237>

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

12 years ago-fcatch-undefined-behavior: Factor emission of the creation of, and branch to,
Richard Smith [Sat, 8 Sep 2012 02:08:36 +0000 (02:08 +0000)]
-fcatch-undefined-behavior: Factor emission of the creation of, and branch to,
the trap BB out of the individual checks and into a common function, to prepare
for making this code call into a runtime library. Rename the existing EmitCheck
to EmitTypeCheck to clarify it and to move it out of the way of the new
EmitCheck.

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

12 years ago[analyzer] ObjCSelfInitChecker should always clean up in postCall checks.
Jordan Rose [Sat, 8 Sep 2012 01:47:28 +0000 (01:47 +0000)]
[analyzer] ObjCSelfInitChecker should always clean up in postCall checks.

ObjCSelfInitChecker stashes information in the GDM to persist it across
function calls; it is stored in pre-call checks and retrieved post-call.
The post-call check is supposed to clear out the stored state, but was
failing to do so in cases where the call did not have a symbolic return
value.

This was actually causing the inappropriate cache-out from r163361.
Per discussion with Anna, we should never actually cache out when
assuming the receiver of an Objective-C message is non-nil, because
we guarded that node generation by checking that the state has changed.
Therefore, the only states that could reach this exact ExplodedNode are
ones that should have merged /before/ making this assumption.

r163361 has been reverted and the test case removed, since it won't
actually test anything interesting now.

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

12 years ago[analyzer] Add debug output for ObjCSelfInitChecker's state.
Jordan Rose [Sat, 8 Sep 2012 01:47:11 +0000 (01:47 +0000)]
[analyzer] Add debug output for ObjCSelfInitChecker's state.

No functionality change.

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

12 years agoRevert "Add plist output for retain-release.m in addition to -verify checking."
Ted Kremenek [Sat, 8 Sep 2012 01:25:02 +0000 (01:25 +0000)]
Revert "Add plist output for retain-release.m in addition to -verify checking."

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

12 years agoRevert "Attempt to make the PathDiagnostic emission order more deterministic by"
Ted Kremenek [Sat, 8 Sep 2012 01:25:00 +0000 (01:25 +0000)]
Revert "Attempt to make the PathDiagnostic emission order more deterministic by"

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

12 years agoRevert "Further tweaks to hopefully make the PathDiagnostic emission more deterministic."
Ted Kremenek [Sat, 8 Sep 2012 01:24:53 +0000 (01:24 +0000)]
Revert "Further tweaks to hopefully make the PathDiagnostic emission more deterministic."

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

12 years ago[analyzer] Remove constraints on dead symbols as part of removeDeadBindings.
Jordan Rose [Sat, 8 Sep 2012 01:24:53 +0000 (01:24 +0000)]
[analyzer] Remove constraints on dead symbols as part of removeDeadBindings.

Previously, we'd just keep constraints around forever, which means we'd
never be able to merge paths that differed only in constraints on dead
symbols.

Because we now allow constraints on symbolic expressions, not just single
symbols, this requires changing SymExpr::symbol_iterator to include
intermediate symbol nodes in its traversal, not just the SymbolData leaf
nodes.

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

12 years ago[analyzer] Symbolic regions are live if any subregions are live.
Jordan Rose [Sat, 8 Sep 2012 01:24:49 +0000 (01:24 +0000)]
[analyzer] Symbolic regions are live if any subregions are live.

RegionStoreManager was only treating a SymbolicRegion's symbel as live
if there was a binding referring to the region itself.

No test case because constraints are currently not being cleaned out
of the constraint manager at all (even if the symbol is legitimately dead).

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

12 years ago[analyzer] Cast the result of a placement new-expression to the correct type.
Jordan Rose [Sat, 8 Sep 2012 01:24:38 +0000 (01:24 +0000)]
[analyzer] Cast the result of a placement new-expression to the correct type.

This is necessary because further analysis will assume that the SVal's
type matches the AST type. This caused a crash when trying to perform
a derived-to-base cast on a C++ object that had been new'd to be another
object type.

Yet another crash in PR13763.

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

12 years ago[analyzer] Address John's code review for r163407.
Anna Zaks [Sat, 8 Sep 2012 00:09:02 +0000 (00:09 +0000)]
[analyzer] Address John's code review for r163407.

Teach malloc sizeof checker to find type inconsistencies in multi-
dimensional arrays.

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

12 years agoobjective-C: introduce __attribute((objc_requires_super)) on method
Fariborz Jahanian [Fri, 7 Sep 2012 23:46:23 +0000 (23:46 +0000)]
objective-C: introduce __attribute((objc_requires_super)) on method
in classes. Use it to flag those method implementations which don't
contain call to 'super' if they have 'super' class and it has the method
with this attribute set. This is wip. // rdar://6386358

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

12 years agoIn ARC, if we're emitting assembly markers for calls to
John McCall [Fri, 7 Sep 2012 23:30:50 +0000 (23:30 +0000)]
In ARC, if we're emitting assembly markers for calls to
objc_retainAutoreleasedReturnValue, we need to also be killing
them during return peepholing.  Make sure we recognize an
intervening bitcast, but more importantly, assert if we can't
find the asm marker at all.  rdar://problem/12133032

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

12 years agoFurther tweaks to hopefully make the PathDiagnostic emission more deterministic.
Ted Kremenek [Fri, 7 Sep 2012 23:13:11 +0000 (23:13 +0000)]
Further tweaks to hopefully make the PathDiagnostic emission more deterministic.

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

12 years agoFixed http://llvm.org/bugs/show_bug.cgi?id=13777
Alexander Kornienko [Fri, 7 Sep 2012 22:44:34 +0000 (22:44 +0000)]
Fixed http://llvm.org/bugs/show_bug.cgi?id=13777

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

12 years agoRemove ProgramState::getSymVal(). It was being misused by Checkers,
Ted Kremenek [Fri, 7 Sep 2012 22:31:01 +0000 (22:31 +0000)]
Remove ProgramState::getSymVal().  It was being misused by Checkers,
with at least one subtle bug in MacOSXKeyChainAPIChecker where the
calling the method was a substitute for assuming a symbolic value
was null (which is not the case).

We still keep ConstraintManager::getSymVal(), but we use that as
an optimization in SValBuilder and ProgramState::getSVal() to
constant-fold SVals.  This is only if the ConstraintManager can
provide us with that information, which is no longer a requirement.
As part of this, introduce a default implementation of
ConstraintManager::getSymVal() which returns null.

For Checkers, introduce ConstraintManager::isNull(), which queries
the state to see if the symbolic value is constrained to be a null
value.  It does this without assuming it has been implicitly constant
folded.

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

12 years agoAttempt to make the PathDiagnostic emission order more deterministic by
Ted Kremenek [Fri, 7 Sep 2012 22:24:24 +0000 (22:24 +0000)]
Attempt to make the PathDiagnostic emission order more deterministic by
looking at PathPieces.

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

12 years agoAdd default implementation of ConstraintManager::getSymVal() and a doxygen comment.
Ted Kremenek [Fri, 7 Sep 2012 22:24:21 +0000 (22:24 +0000)]
Add default implementation of ConstraintManager::getSymVal() and a doxygen comment.

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

12 years agoRemove ConstraintManager:isEqual(). It is no longer used.
Ted Kremenek [Fri, 7 Sep 2012 22:24:18 +0000 (22:24 +0000)]
Remove ConstraintManager:isEqual().  It is no longer used.

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

12 years agoAdd plist output for retain-release.m in addition to -verify checking.
Ted Kremenek [Fri, 7 Sep 2012 20:31:32 +0000 (20:31 +0000)]
Add plist output for retain-release.m in addition to -verify checking.

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

12 years agoAmpersand goes with identifier.
Chad Rosier [Fri, 7 Sep 2012 19:49:55 +0000 (19:49 +0000)]
Ampersand goes with identifier.

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

12 years ago[analyzer] Use cast<> instead of getAs<> for a CFGElement known to be a CFGStmt.
Jordan Rose [Fri, 7 Sep 2012 19:48:09 +0000 (19:48 +0000)]
[analyzer] Use cast<> instead of getAs<> for a CFGElement known to be a CFGStmt.

When adding the next statement to the CoreEngine's work list, we take care
of all the special cases first. We certainly shouldn't be building
PostStmts with null statements (the diagnostics machinery assumes such
StmtPoints do not exist), and we should find out sooner if we're missing
a special case.

A refinement of r163402 that should help prevent further issues like PR13760.

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

12 years agoMoved back getCharAndSizeNoWarn to public area.
Abramo Bagnara [Fri, 7 Sep 2012 19:43:13 +0000 (19:43 +0000)]
Moved back getCharAndSizeNoWarn to public area.

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

12 years ago[analyzer] Fix a false positive in sizeof malloc checker.
Anna Zaks [Fri, 7 Sep 2012 19:20:13 +0000 (19:20 +0000)]
[analyzer] Fix a false positive in sizeof malloc checker.

Don't warn when the sizeof argument is an array with the same element
type as the pointee of the return type.

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

12 years agoAdd test case for <rdar://problem/12075238>, which recently got fixed by changes...
Ted Kremenek [Fri, 7 Sep 2012 19:09:51 +0000 (19:09 +0000)]
Add test case for <rdar://problem/12075238>, which recently got fixed by changes to RegionStore.

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

12 years agoWhitespace.
Chad Rosier [Fri, 7 Sep 2012 18:46:57 +0000 (18:46 +0000)]
Whitespace.

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

12 years agoBring buildbots back. Fix scoping issue and coding style from r163397.
Chad Rosier [Fri, 7 Sep 2012 18:44:15 +0000 (18:44 +0000)]
Bring buildbots back.  Fix scoping issue and coding style from r163397.

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

12 years ago[analyzer] Don't use the address of a temporary CFGElement.
Jordan Rose [Fri, 7 Sep 2012 18:36:17 +0000 (18:36 +0000)]
[analyzer] Don't use the address of a temporary CFGElement.

GCC destroys temporary objects more aggressively than clang, so this
results in incorrect behavior when compiling GCC Release builds.

We could avoid this issue under C++11 by preventing getAs from being
called when 'this' is an rvalue:

  template<class ElemTy> const ElemTy *getAs() const & { ... }
  template<class ElemTy> const ElemTy *getAs() const && = delete;

Unfortunately, we do not have compatibility macros for this behavior yet.

This will hopefully fix PR13760 and PR13762.

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

12 years agoThread-safety analysis: Add support for selectively turning off warnings
DeLesley Hutchins [Fri, 7 Sep 2012 17:34:53 +0000 (17:34 +0000)]
Thread-safety analysis:  Add support for selectively turning off warnings
within part of a particular method.

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

12 years ago[analyzer] Explain why we need condition 8.
Anna Zaks [Fri, 7 Sep 2012 16:22:09 +0000 (16:22 +0000)]
[analyzer] Explain why we need condition 8.

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

12 years agoAttempt to pacify Windows buildbots.
Roman Divacky [Fri, 7 Sep 2012 13:52:05 +0000 (13:52 +0000)]
Attempt to pacify Windows buildbots.

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

12 years agoLink to crtend.S when PIE in the FreeBSD driver. Patch by Brooks Davis!
Roman Divacky [Fri, 7 Sep 2012 13:36:21 +0000 (13:36 +0000)]
Link to crtend.S when PIE in the FreeBSD driver. Patch by Brooks Davis!

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

12 years agoAdds a first iteration of the basic AST matcher documentation landing page.
Manuel Klimek [Fri, 7 Sep 2012 13:13:53 +0000 (13:13 +0000)]
Adds a first iteration of the basic AST matcher documentation landing page.

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

12 years agoIntroduces anchors into LibASTMatchersReference.html.
Manuel Klimek [Fri, 7 Sep 2012 13:10:32 +0000 (13:10 +0000)]
Introduces anchors into LibASTMatchersReference.html.

This allows linking to LibASTMatchersRefernce.html#<matcher><N>Anchor to
link to the N'the declaration of a matcher and automatically expand
its documentation.

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

12 years agoChange the behavior of the isDerivedFrom-matcher to not match on the
Daniel Jasper [Fri, 7 Sep 2012 12:48:17 +0000 (12:48 +0000)]
Change the behavior of the isDerivedFrom-matcher to not match on the
class itself. This caused some confusion (intuitively, a class is not
derived from itself) and makes it hard to write certain matchers, e.g.
"match and bind any pair of base and subclass".

The original behavior can be achieved with a new isA-matcher.  Similar
to all other matchers, this matcher has the same behavior and name as
the corresponding AST-entity - in this case the isa<>() function.

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

12 years agoImplements hasAncestor.
Manuel Klimek [Fri, 7 Sep 2012 09:26:10 +0000 (09:26 +0000)]
Implements hasAncestor.

Implements the hasAncestor matcher. This builds
on the previous patch that introduced DynTypedNode to build up
a parent map for an additional degree of freedom in the AST traversal.

The map is only built once we hit an hasAncestor matcher, in order
to not slow down matching for cases where this is not needed.

We could implement some speed-ups for special cases, like building up
the parent map as we go and only building up the full map if we break
out of the already visited part of the tree, but that is probably
not going to be worth it, and would make the code significantly more
complex.

Major TODOs are:
- implement hasParent
- implement type traversal
- implement memoization in hasAncestor

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

12 years agoRevert "Rework the retain-release.m test to use FileCheck and the "text" output"
Ted Kremenek [Fri, 7 Sep 2012 07:40:40 +0000 (07:40 +0000)]
Revert "Rework the retain-release.m test to use FileCheck and the "text" output"

Apparently the output of this test is not deterministic.  Needs investigation.

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

12 years agoFix off-by-one bug in diagnostic prose of ObjCContainersASTChecker.
Ted Kremenek [Fri, 7 Sep 2012 07:13:08 +0000 (07:13 +0000)]
Fix off-by-one bug in diagnostic prose of ObjCContainersASTChecker.
While the check itself should count 0-based for the parameter index,
the diagnostic should be 1-based (first, second, third, not start at 0).

Fixes <rdar://problem/12249569>.

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

12 years agoExplodedGraph::shouldCollectNode() should not collect nodes for non-Expr Stmts
Ted Kremenek [Fri, 7 Sep 2012 06:56:18 +0000 (06:56 +0000)]
ExplodedGraph::shouldCollectNode() should not collect nodes for non-Expr Stmts
(as this previously was the case before this was refactored).  We also shouldn't
need to specially handle BinaryOperators since the eagerly-assume heuristic tags
such nodes.

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

12 years agoRework the retain-release.m test to use FileCheck and the "text" output
Ted Kremenek [Fri, 7 Sep 2012 06:51:47 +0000 (06:51 +0000)]
Rework the retain-release.m test to use FileCheck and the "text" output
of the analyzer, as the RetainReleaseChecker has many fine-grain
path diagnostic events that were not being checked.  This uncovered
an inconsistency between the path diagnostics between Objective-C
and Objective-C++ code in ConditionBRVisitor that was fixed in a recent
patch.

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

12 years agoFix bug in ConditionBRVisitor where for C++ (and not C) we were not ignoring
Ted Kremenek [Fri, 7 Sep 2012 06:51:37 +0000 (06:51 +0000)]
Fix bug in ConditionBRVisitor where for C++ (and not C) we were not ignoring
implicit pointer-to-boolean conversions in condition expressions.  This would
result in inconsistent diagnostic emission between C and C++.

A consequence of this is now ConditionBRVisitor and TrackConstraintBRVisitor may
emit redundant diagnostics, for example:

  "Assuming pointer value is null" (TrackConstraintBRVisitor)
  "Assuming 'p' is null" (ConditionBRVisitor)

We need to reconcile the two, and perhaps prefer one over the other in some
cases.

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

12 years agoPR9023: A template template parameter whose template parameter list contains an
Richard Smith [Fri, 7 Sep 2012 02:06:42 +0000 (02:06 +0000)]
PR9023: A template template parameter whose template parameter list contains an
unexpanded parameter pack is a pack expansion. Thus, as with a non-type template
parameter which is a pack expansion, it needs to be expanded early into a fixed
list of template parameters.

Since the expanded list of template parameters is not itself a parameter pack,
it is permitted to appear before the end of the template parameter list, so also
remove that restriction (for both template template parameter pack expansions and
non-type template parameter pack expansions).

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

12 years ago[analyzer] Fail gracefully when the dynamic type is outside the hierarchy.
Jordan Rose [Fri, 7 Sep 2012 01:19:42 +0000 (01:19 +0000)]
[analyzer] Fail gracefully when the dynamic type is outside the hierarchy.

With some particularly evil casts, we can get an object whose dynamic type
is not actually a subclass of its static type. In this case, we won't even
find the statically-resolved method as a devirtualization candidate.

Rather than assert that this situation cannot occur, we now simply check
that the dynamic type is not an ancestor or descendent of the static type,
and leave it at that.

This error actually occurred analyzing LLVM: CallEventManager uses a
BumpPtrAllocator to allocate a concrete subclass of CallEvent
(FunctionCall), but then casts it to the actual subclass requested
(such as ObjCMethodCall) to perform the constructor.

Yet another crash in PR13763.

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

12 years agoTeach RetainCountChecker that CFPlugInInstanceCreate does not
Ted Kremenek [Thu, 6 Sep 2012 23:47:02 +0000 (23:47 +0000)]
Teach RetainCountChecker that CFPlugInInstanceCreate  does not
return a CF object at all.

Fixes <rdar://problem/9566345>

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

12 years ago[analyzer] Don't crash if we cache out while evaluating an ObjC message.
Jordan Rose [Thu, 6 Sep 2012 23:44:36 +0000 (23:44 +0000)]
[analyzer] Don't crash if we cache out while evaluating an ObjC message.

A bizarre series of coincidences led us to generate a previously-seen
node in the middle of processing an Objective-C message, where we assume
the receiver is non-nil. We were assuming that such an assumption would
never "cache out" like this, and blithely went on using a null ExplodedNode
as the predecessor for the next step in evaluation.

Although the test case committed here is complicated, this could in theory
happen in other ways as well, so the correct fix is just to test if the
non-nil assumption results in an ExplodedNode we've seen before.

<rdar://problem/12243648>

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

12 years ago[analyzer] Assert that StmtPoint should be created with a non-null Stmt.
Anna Zaks [Thu, 6 Sep 2012 23:30:29 +0000 (23:30 +0000)]
[analyzer] Assert that StmtPoint should be created with a non-null Stmt.

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

12 years ago[analyzer] testing: add a build mode to allow C++11 testing.
Anna Zaks [Thu, 6 Sep 2012 23:30:27 +0000 (23:30 +0000)]
[analyzer] testing: add a build mode to allow C++11 testing.

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

12 years agoRefine diagnostics for leaks reported when returning an object
Ted Kremenek [Thu, 6 Sep 2012 23:03:07 +0000 (23:03 +0000)]
Refine diagnostics for leaks reported when returning an object
via function/method with [CF,NS]_RETURNS_NOT_RETAINED.

Fixes <rdar://problem/11379000>.

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

12 years agoTweak DeadStoresChecker to not warn about dead stores to variables that
Ted Kremenek [Thu, 6 Sep 2012 22:32:48 +0000 (22:32 +0000)]
Tweak DeadStoresChecker to not warn about dead stores to variables that
are used in EH code.  Right now the CFG doesn't support exceptions well,
so we need this hack to avoid bogus dead store warnings.

Fixes <rdar://problem/12147586>

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

12 years agoClarified diagnostics for range-based for loops with invalid ranges
Sam Panzer [Thu, 6 Sep 2012 21:50:08 +0000 (21:50 +0000)]
Clarified diagnostics for range-based for loops with invalid ranges

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

12 years ago[analyzer] Don't attempt to devirtualize calls to base class destructors.
Jordan Rose [Thu, 6 Sep 2012 20:37:08 +0000 (20:37 +0000)]
[analyzer] Don't attempt to devirtualize calls to base class destructors.

CXXDestructorCall now has a flag for when it is a base destructor call.
Other kinds of destructor calls (locals, fields, temporaries, and 'delete')
all behave as "whole-object" destructors and do not behave differently
from one another (specifically, in these cases we /should/ try to
devirtualize a call to a virtual destructor).

This was causing crashes in both our internal buildbot, the crash still
being tracked in PR13765, and some of the crashes being tracked in PR13763,
due to a assertion failure. (The behavior under -Asserts happened to be
correct anyway.)

Adding this knowledge also allows our DynamicTypePropagation checker to do
a bit less work; the special rules about virtual method calls during a
destructor only require extra handling during base destructors.

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

12 years ago[ms-inline asm] Output empty asm statements for the directives we don't
Chad Rosier [Thu, 6 Sep 2012 19:56:25 +0000 (19:56 +0000)]
[ms-inline asm] Output empty asm statements for the directives we don't
handle.  Otherwise, the AsmParser will explode if we try to generate an
object files.

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

12 years ago[ms-inline asm] The IR representation of inline assembly enumerates the input
Chad Rosier [Thu, 6 Sep 2012 19:35:00 +0000 (19:35 +0000)]
[ms-inline asm] The IR representation of inline assembly enumerates the input
and output expressions much like that in GNU-style inline assembly. Output
expressions are first.  Do this for MS-style inline asms.

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

12 years agorefactoring + objective-C specific test for my last patch.
Fariborz Jahanian [Thu, 6 Sep 2012 18:38:58 +0000 (18:38 +0000)]
refactoring + objective-C specific test for my last patch.
// rdar://12233989

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

12 years agoDon't try to check override control for invalid member functions. Fixes a crash in...
Richard Smith [Thu, 6 Sep 2012 18:32:18 +0000 (18:32 +0000)]
Don't try to check override control for invalid member functions. Fixes a crash in a corner case. Patch by Olivier Goffart!

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

12 years agoUse custom ABIInfo for le32/PNaCl argument codegen
Derek Schuff [Thu, 6 Sep 2012 17:37:28 +0000 (17:37 +0000)]
Use custom ABIInfo for le32/PNaCl argument codegen

This patch uses a new ABIInfo implementation specific to the le32
target, rather than falling back to DefaultABIInfo. Its behavior is
basically the same, but it also allows the regparm argument attribute.
It also includes basic tests for argument codegen and attributes.

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

12 years agoEnabling the UTF conversion routines that were previously conditionally ifdef'ed...
Enrico Granata [Thu, 6 Sep 2012 17:03:42 +0000 (17:03 +0000)]
Enabling the UTF conversion routines that were previously conditionally ifdef'ed out. This change is required to support enhancements in the LLDB data formatters

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

12 years agoFixing the return type information for objc_sync_enter and objc_sync_exit. Patch...
Aaron Ballman [Thu, 6 Sep 2012 16:44:16 +0000 (16:44 +0000)]
Fixing the return type information for objc_sync_enter and objc_sync_exit.  Patch thanks to Joe Ranieri!

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

12 years agoc: make __attribute__((unused)) transitive.
Fariborz Jahanian [Thu, 6 Sep 2012 16:43:18 +0000 (16:43 +0000)]
c: make __attribute__((unused)) transitive.
   Don't warn if annotated decl is used inside another
   unused. // rdar://12233989

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

12 years agoTighten up regexps some more.
Jakob Stoklund Olesen [Thu, 6 Sep 2012 16:29:03 +0000 (16:29 +0000)]
Tighten up regexps some more.

These tests were failing for me because the .* was greedily matching up
to the /libexec/ld-elf.so.1" later on the same line.

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

12 years agoRemove unused typedefs. Found by gcc48.
Roman Divacky [Thu, 6 Sep 2012 16:14:37 +0000 (16:14 +0000)]
Remove unused typedefs. Found by gcc48.

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

12 years agoDont cast away const needlessly. Found by gcc48 -Wcast-qual.
Roman Divacky [Thu, 6 Sep 2012 15:59:27 +0000 (15:59 +0000)]
Dont cast away const needlessly. Found by gcc48 -Wcast-qual.

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

12 years agoUpdate AddressSanitizer docs
Alexey Samsonov [Thu, 6 Sep 2012 09:49:03 +0000 (09:49 +0000)]
Update AddressSanitizer docs

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

12 years agoFix a mistake in an HTML example code snippet.
Jordan Rose [Thu, 6 Sep 2012 02:19:13 +0000 (02:19 +0000)]
Fix a mistake in an HTML example code snippet.

Caught by Kurt Arnlund!

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

12 years agoPR13775: When checking for a tag type being shadowed by some other declaration,
Richard Smith [Thu, 6 Sep 2012 01:37:56 +0000 (01:37 +0000)]
PR13775: When checking for a tag type being shadowed by some other declaration,
don't trample over the caller's LookupResult in the case where the check fails.

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

12 years ago[analyzer] Enhance the member expr tracking to account for references.
Anna Zaks [Wed, 5 Sep 2012 23:41:54 +0000 (23:41 +0000)]
[analyzer] Enhance the member expr tracking to account for references.

As per Jordan's suggestion. (Came out of code review for r163261.)

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

12 years agoContinue including temporary destructors in the CFG used for warnings.
Jordan Rose [Wed, 5 Sep 2012 23:11:06 +0000 (23:11 +0000)]
Continue including temporary destructors in the CFG used for warnings.

...and hopefully unbreak buildbots. My apologies!

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

12 years agoFormat strings: suggest casts for NS(U)Integer and [SU]Int32 on Darwin.
Jordan Rose [Wed, 5 Sep 2012 22:56:26 +0000 (22:56 +0000)]
Format strings: suggest casts for NS(U)Integer and [SU]Int32 on Darwin.

These types are defined differently on 32-bit and 64-bit platforms, and
trying to offer a fixit for one platform would only mess up the format
string for the other. The Apple-recommended solution is to cast to a type
that is known to be large enough and always use that to print the value.

This should only have an impact on compile time if the format string is
incorrect; in cases where the format string matches the definition on the
current platform, no warning will be emitted.

<rdar://problem/9135072&12164284>

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

12 years agoFormat string checking: change long if-statement to early returns.
Jordan Rose [Wed, 5 Sep 2012 22:56:19 +0000 (22:56 +0000)]
Format string checking: change long if-statement to early returns.

No functionality change.

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

12 years ago[analyzer] Always include destructors in the analysis CFG.
Jordan Rose [Wed, 5 Sep 2012 22:55:23 +0000 (22:55 +0000)]
[analyzer] Always include destructors in the analysis CFG.

While destructors will continue to not be inlined (unless the analyzer
config option 'c++-inlining' is set to 'destructors'), leaving them out
of the CFG is an incomplete model of the behavior of an object, and
can cause false positive warnings (like PR13751, now working).

Destructors for temporaries are still not on by default, since
(a) we haven't actually checked this code to be sure it's fully correct
    (in particular, we probably need to be very careful with regard to
    lifetime-extension when a temporary is bound to a reference,
    C++11 [class.temporary]p5), and
(b) ExprEngine doesn't actually do anything when it sees a temporary
    destructor in the CFG -- not even invalidate the object region.

To enable temporary destructors, set the 'cfg-temporary-dtors' analyzer
config option to '1'. The old -cfg-add-implicit-dtors cc1 option, which
controlled all implicit destructors, has been removed.

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

12 years ago[analyzer] Fix a crash PR13762.
Anna Zaks [Wed, 5 Sep 2012 22:31:58 +0000 (22:31 +0000)]
[analyzer] Fix a crash PR13762.

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

12 years ago[analyzer] NullOrUndef diagnostics: track symbols binded to regions.
Anna Zaks [Wed, 5 Sep 2012 22:31:55 +0000 (22:31 +0000)]
[analyzer] NullOrUndef diagnostics: track symbols binded to regions.

If a region is binded to a symbolic value, we should track the symbol.

(The code I changed was not previously exercised by the regression
tests.)

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

12 years ago[analyzer] Remove unneeded code.
Anna Zaks [Wed, 5 Sep 2012 22:31:49 +0000 (22:31 +0000)]
[analyzer] Remove unneeded code.

This region is set as interesting as part of trackNullOrUndefValue call,
no need to mark it as interesting twice.

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

12 years agoAdd test missed in previous commit.
Eric Christopher [Wed, 5 Sep 2012 21:50:35 +0000 (21:50 +0000)]
Add test missed in previous commit.

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

12 years agoTry to fix the windows bots.
Eric Christopher [Wed, 5 Sep 2012 21:50:30 +0000 (21:50 +0000)]
Try to fix the windows bots.

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

12 years agoApply some driver improvements for freebsd-*-mips*.
Eric Christopher [Wed, 5 Sep 2012 21:32:44 +0000 (21:32 +0000)]
Apply some driver improvements for freebsd-*-mips*.

Patch by Brooks Davis.

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

12 years ago[cindex.py] Make the use of a compatibilty check explicit
Tobias Grosser [Wed, 5 Sep 2012 20:23:53 +0000 (20:23 +0000)]
[cindex.py] Make the use of a compatibilty check explicit

At the moment, we implictly check compatibility between the python
bindings and libclang, as the python bindings will fail to load in
case a method we use in libclang is not available.

This patch makes the use of this compatibility check explicit and introduces a
flag to optionally disable the check. This will allow us to further harden the
compatibility check, but it also gives the user the possibility to disable the
compatibility check to evaluate compatibility with older libclang versions.

I added documentation that makes clear the python bindings are only tested
with the libclang version they have been shipped with.

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

12 years agoThread-safety analysis: bugfix for case where a trylock occurs in an
DeLesley Hutchins [Wed, 5 Sep 2012 20:01:16 +0000 (20:01 +0000)]
Thread-safety analysis: bugfix for case where a trylock occurs in an
expression involving temporaries.

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

12 years agoobjective-c++11: c++11 does not change pod-ness when
Fariborz Jahanian [Wed, 5 Sep 2012 19:51:20 +0000 (19:51 +0000)]
objective-c++11: c++11 does not change pod-ness when
type is an unqualified objc pointer in arc. Treat it just
as being treated in c++98. This fixes a bogus vararg warning
with -std=c++11. //rdar://12229679

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

12 years agoUpdate for r163231.
Chad Rosier [Wed, 5 Sep 2012 19:01:07 +0000 (19:01 +0000)]
Update for r163231.

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

12 years agoAdded missing test.
Abramo Bagnara [Wed, 5 Sep 2012 18:06:49 +0000 (18:06 +0000)]
Added missing test.

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

12 years agoc error recovery. treat an invalid redeclaration
Fariborz Jahanian [Wed, 5 Sep 2012 17:52:12 +0000 (17:52 +0000)]
c error recovery. treat an invalid redeclaration
of a c-function for what it is. Otherwise, this func
is treated as an overloadable c-function resulting in
a crash much later. // rdar://11743706

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

12 years ago[analyzer] Fix bad test from r163220.
Jordan Rose [Wed, 5 Sep 2012 17:34:50 +0000 (17:34 +0000)]
[analyzer] Fix bad test from r163220.

Add a FIXME to the test while I track down the real problem.

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

12 years agoAllow disabling of wchar_t type.
Abramo Bagnara [Wed, 5 Sep 2012 17:30:57 +0000 (17:30 +0000)]
Allow disabling of wchar_t type.

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

12 years ago[analyzer] Be more forgiving about calling methods on struct rvalues.
Jordan Rose [Wed, 5 Sep 2012 17:11:26 +0000 (17:11 +0000)]
[analyzer] Be more forgiving about calling methods on struct rvalues.

The problem is that the value of 'this' in a C++ member function call
should always be a region (or NULL). However, if the object is an rvalue,
it has no associated region (only a conjured symbol or LazyCompoundVal).
For now, we handle this in two ways:

1) Actually respect MaterializeTemporaryExpr. Before, it was relying on
   CXXConstructExpr to create temporary regions for all struct values.
   Now it just does the right thing: if the value is not in a temporary
   region, create one.

2) Have CallEvent recognize the case where its 'this' pointer is a
   non-region, and just return UnknownVal to keep from confusing clients.

The long-term problem is being tracked internally in <rdar://problem/12137950>,
but this makes many test cases pass.

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

12 years ago[analyzer] Clean up a couple uses of getPointeeType().
Jordan Rose [Wed, 5 Sep 2012 17:11:22 +0000 (17:11 +0000)]
[analyzer] Clean up a couple uses of getPointeeType().

No intended functionality change.

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

12 years agoRevert "[analyzer] Treat all struct values as regions (even rvalues)."
Jordan Rose [Wed, 5 Sep 2012 17:11:15 +0000 (17:11 +0000)]
Revert "[analyzer] Treat all struct values as regions (even rvalues)."

This turned out to have many implications, but what eventually seemed to
make it unworkable was the fact that we can get struct values (as
LazyCompoundVals) from other places besides return-by-value function calls;
that is, we weren't actually able to "treat all struct values as regions"
consistently across the entire analyzer core.

Hopefully we'll be able to come up with an alternate solution soon.

This reverts r163066 / 02df4f0aef142f00d4637cd851e54da2a123ca8e.

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

12 years agoIntroduces DynTypedMatcher as a new concept that replaces the UntypedBaseMatcher...
Manuel Klimek [Wed, 5 Sep 2012 12:12:07 +0000 (12:12 +0000)]
Introduces DynTypedMatcher as a new concept that replaces the UntypedBaseMatcher and TypedMatcher.

Due to DynTypedNode the basic dynamically typed matcher interface can now be simplified.

Also switches the traversal interfaces to use DynTypedNode;
this is in preperation for the hasAncestor implementation, and
also allows us to need fewer changes when we want to add new
nodes to traverse, thus making the code a little more decoupled.

Main design concerns: I went back towards the original design
of getNodeAs to return a pointer, and switched DynTypedNode::get
to always return a pointer (in case of value types like QualType
the pointer points into the storage of DynTypedNode, thus allowing
us to treat all the nodes the same from the point of view of a
user of the DynTypedNodes.

Adding the QualType implementation for DynTypedNode was needed
for the recursive traversal interface changes.

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

12 years agoNew clang-check vim integration script
Alexander Kornienko [Wed, 5 Sep 2012 12:11:13 +0000 (12:11 +0000)]
New clang-check vim integration script

Summary: New clang-check vim integration with the 're-run the last invocation when executed from .h file' feature.

Reviewers: klimek

Reviewed By: klimek

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D35

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

12 years agoDo not add using directives to a function decl context when instantiating.
Abramo Bagnara [Wed, 5 Sep 2012 09:55:10 +0000 (09:55 +0000)]
Do not add using directives to a function decl context when instantiating.

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

12 years agoFixed lexical decl context of out of line class template instantiations.
Abramo Bagnara [Wed, 5 Sep 2012 09:05:18 +0000 (09:05 +0000)]
Fixed lexical decl context of out of line class template instantiations.

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