]> granicus.if.org Git - clang/log
clang
14 years agoMake inline namespace not be transparent after all. The concept simply doesn't fit...
Sebastian Redl [Tue, 31 Aug 2010 20:53:31 +0000 (20:53 +0000)]
Make inline namespace not be transparent after all. The concept simply doesn't fit. Instead, special-case the few places where transparent contexts have the desired behavior for inline namespaces. Fixes a redeclaration issue in inline namespaces.

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

14 years agoExtend libclang with a new cursor kind that indicates a reference to a
Douglas Gregor [Tue, 31 Aug 2010 20:37:03 +0000 (20:37 +0000)]
Extend libclang with a new cursor kind that indicates a reference to a
template. Such cursors occur, for example, in template specialization
types such as vector<int>. Note that we do not handle the
super-interesting case where the template name is unresolved, e.g.,
within a template.

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

14 years agoAdd libclang support for class template partial specializations,
Douglas Gregor [Tue, 31 Aug 2010 19:31:58 +0000 (19:31 +0000)]
Add libclang support for class template partial specializations,
including a cursor kind, visitation, and USRs.

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

14 years agoAdd a libclang cursor kind, visitation support and USR support for C++
Douglas Gregor [Tue, 31 Aug 2010 19:02:00 +0000 (19:02 +0000)]
Add a libclang cursor kind, visitation support and USR support for C++
class templates.

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

14 years agoImprove CFG printing support for CXXOperatorCallExpr and CXXBindTemporaryExpr.
Ted Kremenek [Tue, 31 Aug 2010 18:47:37 +0000 (18:47 +0000)]
Improve CFG printing support for CXXOperatorCallExpr and CXXBindTemporaryExpr.

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

14 years agoExplicitly handle CXXOperatorCallExpr when building CFGs. We should treat it the...
Ted Kremenek [Tue, 31 Aug 2010 18:47:34 +0000 (18:47 +0000)]
Explicitly handle CXXOperatorCallExpr when building CFGs.  We should treat it the same as CallExprs.

Fixes: <rdar://problem/8375510> [Boost] CFGBuilder crash in Boost.Graph
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112618 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAST work to support [C++] [IRgen] for ?: with missing LHS
Fariborz Jahanian [Tue, 31 Aug 2010 18:02:20 +0000 (18:02 +0000)]
AST work to support [C++] [IRgen] for ?: with missing LHS
This is also pr7726 and wip. No change in functionality
at this time.

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

14 years agoImplement basic support for indexing function templates in
Douglas Gregor [Tue, 31 Aug 2010 17:01:39 +0000 (17:01 +0000)]
Implement basic support for indexing function templates in
libclang. This includes:
  - Cursor kind for function templates, with visitation logic
  - Cursor kinds for template parameters, with visitation logic
  - Visitation logic for template specialization types, qualified type
  locations
  - USR generation for function templates, template specialization
  types, template parameter types.

Also happens to fix PR7804, which I tripped across while testing.

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

14 years agoAdd support for windows x86-64 varargs, patch by Cameron Esfahani!
Chris Lattner [Tue, 31 Aug 2010 16:44:54 +0000 (16:44 +0000)]
Add support for windows x86-64 varargs, patch by Cameron Esfahani!

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

14 years agoimprove isHexaLiteral to work with escaped newlines and trigraphs,
Chris Lattner [Tue, 31 Aug 2010 16:42:00 +0000 (16:42 +0000)]
improve isHexaLiteral to work with escaped newlines and trigraphs,
patch by Francois Pichet!

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

14 years agolibclang indexing support for C++ constructors, destructors, and
Douglas Gregor [Tue, 31 Aug 2010 14:41:23 +0000 (14:41 +0000)]
libclang indexing support for C++ constructors, destructors, and
conversion functions. This introduces new cursor kinds for these three
C++ entities, and reworks visitation of function declarations so that
we get type-source information for the names.

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

14 years agoAdd a simple test for indexing namespaces
Douglas Gregor [Tue, 31 Aug 2010 13:31:19 +0000 (13:31 +0000)]
Add a simple test for indexing namespaces

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

14 years agoTeach IR generation to return 'this' from constructors and destructors
John McCall [Tue, 31 Aug 2010 07:33:07 +0000 (07:33 +0000)]
Teach IR generation to return 'this' from constructors and destructors
under the ARM ABI.

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

14 years agoFix a regression that allowed clearly ill formed code. The diagnostic is still
Chandler Carruth [Tue, 31 Aug 2010 05:42:40 +0000 (05:42 +0000)]
Fix a regression that allowed clearly ill formed code. The diagnostic is still
terrible, FIXME left to do a proper job of diagnosing this.

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

14 years agoRevert my lame attempt at appeasing the CFGBuilder
Douglas Gregor [Tue, 31 Aug 2010 05:36:56 +0000 (05:36 +0000)]
Revert my lame attempt at appeasing the CFGBuilder

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

14 years agoWhen provide code completions for a variadic Objective-C method
Douglas Gregor [Tue, 31 Aug 2010 05:13:43 +0000 (05:13 +0000)]
When provide code completions for a variadic Objective-C method
declaration send or a variadic function call, collapse the ", ..."
into the parameter before it, so that we don't get a second
placeholder.

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

14 years agoTeach the CFGBuilder not do die on CXXBindTemporaryExpr, CXXOperatorCallExpr. Fixes...
Douglas Gregor [Tue, 31 Aug 2010 05:10:27 +0000 (05:10 +0000)]
Teach the CFGBuilder not do die on CXXBindTemporaryExpr, CXXOperatorCallExpr. Fixes a Boost.Graph crasher.

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

14 years agoImplement the __has_nothrow trait family, by Steven Watanabe.
Sebastian Redl [Tue, 31 Aug 2010 04:59:00 +0000 (04:59 +0000)]
Implement the __has_nothrow trait family, by Steven Watanabe.

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

14 years agoAdd range of return value expression in ReturnUndefChecker. Patch by Jim Goodnow II!
Ted Kremenek [Tue, 31 Aug 2010 01:35:32 +0000 (01:35 +0000)]
Add range of return value expression in ReturnUndefChecker.  Patch by Jim Goodnow II!

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

14 years agoEnable inline namespaces in C++03 as an extension.
Sebastian Redl [Tue, 31 Aug 2010 00:36:45 +0000 (00:36 +0000)]
Enable inline namespaces in C++03 as an extension.

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

14 years agoAdd a forgotten place where the enclosing namespace set matters, plus a big testcase...
Sebastian Redl [Tue, 31 Aug 2010 00:36:40 +0000 (00:36 +0000)]
Add a forgotten place where the enclosing namespace set matters, plus a big testcase for inline namespace fun.

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

14 years agoEnable inline namespaces in the AST.
Sebastian Redl [Tue, 31 Aug 2010 00:36:36 +0000 (00:36 +0000)]
Enable inline namespaces in the AST.

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

14 years agoRename DeclContext::getLookupContext to getRedeclContext and change its semantics...
Sebastian Redl [Tue, 31 Aug 2010 00:36:30 +0000 (00:36 +0000)]
Rename DeclContext::getLookupContext to getRedeclContext and change its semantics slightly. No functionality change in the absence of inline namespaces. Also, change a few places where inline namespaces actually make a difference to be prepared for them.

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

14 years agoDecl::getEnclosingNamespaceContext has no reason to explicitly skip transparent conte...
Sebastian Redl [Tue, 31 Aug 2010 00:36:23 +0000 (00:36 +0000)]
Decl::getEnclosingNamespaceContext has no reason to explicitly skip transparent contexts, and would be wrong to do so with inline namespaces.

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

14 years agoWhen instantiating a function type, instantiate the return type before
Douglas Gregor [Tue, 31 Aug 2010 00:26:14 +0000 (00:26 +0000)]
When instantiating a function type, instantiate the return type before
instantiating the parameters. In a perfect world, this wouldn't
matter, and compilers are free to instantiate in any order they
want. However, every other compiler seems to instantiate the return
type first, and some code (in this case, Boost.Polygon) depends on
this and SFINAE to avoid instantiating something that shouldn't be
instantiated.

We could fight this battle, and insist that Clang is allowed to do
what it does, but it's not beneficial: it's more predictable to
instantiate this way, in source order. When we implement
late-specified return types, we'll need to instantiate the return type
last when it was late-specified, hence the FIXME.

We now compile Boost.Polygon properly.

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

14 years agoAdd a missing return. Bug noticed by Dawn Perchik!
Douglas Gregor [Mon, 30 Aug 2010 23:30:49 +0000 (23:30 +0000)]
Add a missing return. Bug noticed by Dawn Perchik!

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

14 years agoWhen template substitution into a template parameter reduces the level
Douglas Gregor [Mon, 30 Aug 2010 23:23:59 +0000 (23:23 +0000)]
When template substitution into a template parameter reduces the level
of that parameter, reduce the level by the number of active template
argument lists rather than by 1. The number of active template
argument lists is only > 1 when we have a class template partial
specialization of a member template of a class template that itself is
a member template of another class template.

... and Boost.MSM does this. Fixes PR7669.

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

14 years agosilence a warning
Chris Lattner [Mon, 30 Aug 2010 23:11:03 +0000 (23:11 +0000)]
silence a warning

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

14 years agozap tabs
Gabor Greif [Mon, 30 Aug 2010 22:25:56 +0000 (22:25 +0000)]
zap tabs

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

14 years agoFix PR8029, a x86-32 ABI regression in introduced in r112211
Chris Lattner [Mon, 30 Aug 2010 22:03:23 +0000 (22:03 +0000)]
Fix PR8029, a x86-32 ABI regression in introduced in r112211

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

14 years agoadd two more use-cases (explicit instantiation) that should pass now
Gabor Greif [Mon, 30 Aug 2010 21:45:06 +0000 (21:45 +0000)]
add two more use-cases (explicit instantiation) that should pass now

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

14 years agofix dual aspect of PR8007,
Gabor Greif [Mon, 30 Aug 2010 21:10:05 +0000 (21:10 +0000)]
fix dual aspect of PR8007,
namely when the friend function prototype is already used
at the point of the template definition that is supposed
to inject the friend function. Testcase verifies four
scenarios.
I would like receive some code review for this.

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

14 years agoPerform the function-to-pointer adjustment during template argument
Douglas Gregor [Mon, 30 Aug 2010 21:04:23 +0000 (21:04 +0000)]
Perform the function-to-pointer adjustment during template argument
deduction where the parameter is a function reference, function
pointer, or member function pointer and the argument is an overloaded
function. Fixes <rdar://problem/8360106>, a template argument
deduction issue found by Boost.Filesystem.

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

14 years agoTranslate NEON vmovn builtin to a vector truncation instead of using an llvm
Bob Wilson [Mon, 30 Aug 2010 19:57:13 +0000 (19:57 +0000)]
Translate NEON vmovn builtin to a vector truncation instead of using an llvm
intrinsic.

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

14 years agoAdjusted the semantics of assign checking in IdempotentOperationChecker
Tom Care [Mon, 30 Aug 2010 19:25:43 +0000 (19:25 +0000)]
Adjusted the semantics of assign checking in IdempotentOperationChecker
- Fixed a regression where assigning '0' would be reported
- Changed the way self assignments are filtered to allow constant testing
- Added a test case for assign ops
- Fixed one test case where a function pointer was not considered constant
- Fixed test cases relating to 0 assignment

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

14 years agoRevert my user-defined literal commits - r1124{58,60,67} pending
Sean Hunt [Mon, 30 Aug 2010 17:47:05 +0000 (17:47 +0000)]
Revert my user-defined literal commits - r1124{58,60,67} pending
some issues being sorted out.

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

14 years agoadd a fixme.
Chris Lattner [Mon, 30 Aug 2010 17:11:14 +0000 (17:11 +0000)]
add a fixme.

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

14 years agouse 'features' instead of 'PP->getLangOptions'.
Chris Lattner [Mon, 30 Aug 2010 17:09:08 +0000 (17:09 +0000)]
use 'features' instead of 'PP->getLangOptions'.

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

14 years agoHeap-allocate the attribute vectors in
Douglas Gregor [Mon, 30 Aug 2010 16:49:28 +0000 (16:49 +0000)]
Heap-allocate the attribute vectors in
ASTContext::DeclAttrs. Otherwise, iterators will go stale when the
DenseMap reallocates, which can cause crashes when, e.g., looping over
the attributes in a template to instantiate them and add the results
to the instantiation of that template.

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

14 years agoFix an corner-case assertion introduced by the refactoring in r112258;
Douglas Gregor [Mon, 30 Aug 2010 16:00:47 +0000 (16:00 +0000)]
Fix an corner-case assertion introduced by the refactoring in r112258;
when we're taking the address of a unresolvable value, it might be an
implicit member access. Fixes some Boost.Spirit regressions.

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

14 years agoNow that GCC will have #pragma push/pop (in GCC 4.6), allow the
Douglas Gregor [Mon, 30 Aug 2010 15:15:34 +0000 (15:15 +0000)]
Now that GCC will have #pragma push/pop (in GCC 4.6), allow the
#pragma without requiring it to be in the "clang" namespace, from
Louis Gerbarg!

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

14 years agoEmulate (some of) Microsoft's looser semantic checking of exception
Douglas Gregor [Mon, 30 Aug 2010 15:04:51 +0000 (15:04 +0000)]
Emulate (some of) Microsoft's looser semantic checking of exception
specifications, from Martin Vejnar!

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

14 years agoIn Microsoft compatibility mode, don't parse the exponent as part of
Douglas Gregor [Mon, 30 Aug 2010 14:50:47 +0000 (14:50 +0000)]
In Microsoft compatibility mode, don't parse the exponent as part of
the pp-number in a hexadecimal floating point literal, from Francois
Pichet! Fixes PR7968.

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

14 years agoPredeclare class type_info in Microsoft mode, from Francois Pichet!
Douglas Gregor [Mon, 30 Aug 2010 14:44:26 +0000 (14:44 +0000)]
Predeclare class type_info in Microsoft mode, from Francois Pichet!

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

14 years agoAdd test case from PR6952, which now works (thanks to Gabor).
Douglas Gregor [Mon, 30 Aug 2010 14:37:53 +0000 (14:37 +0000)]
Add test case from PR6952, which now works (thanks to Gabor).

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

14 years agoAdd redeclaration checking for static data members and fix a corner
Douglas Gregor [Mon, 30 Aug 2010 14:32:14 +0000 (14:32 +0000)]
Add redeclaration checking for static data members and fix a corner
case with redeclaration checking for fields, from Faisal Vali!
Fixes PR7970.

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

14 years agoFix CMake dependencies
Douglas Gregor [Mon, 30 Aug 2010 14:31:03 +0000 (14:31 +0000)]
Fix CMake dependencies

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

14 years agoStraighten out target triples provided on the command line
Duncan Sands [Mon, 30 Aug 2010 09:42:39 +0000 (09:42 +0000)]
Straighten out target triples provided on the command line
before using them.

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

14 years agoTwo minor fixes to user-defined literals:
Sean Hunt [Mon, 30 Aug 2010 09:27:16 +0000 (09:27 +0000)]
Two minor fixes to user-defined literals:

 - Zero-initialize UDLData so that crashes stop
 - Stop complaining that we can't emit them (we most certainly can)

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

14 years agoAdd some braces for sanity and GCC silence. These became unbalanced in r112122,
Chandler Carruth [Mon, 30 Aug 2010 07:36:24 +0000 (07:36 +0000)]
Add some braces for sanity and GCC silence. These became unbalanced in r112122,
so please review echristo and let me know if the logic is wrong now.

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

14 years agoFix some test-breaking that snuck into my previous commit
Sean Hunt [Sun, 29 Aug 2010 22:39:32 +0000 (22:39 +0000)]
Fix some test-breaking that snuck into my previous commit

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

14 years agoImplement C++0x user-defined string literals.
Sean Hunt [Sun, 29 Aug 2010 21:26:48 +0000 (21:26 +0000)]
Implement C++0x user-defined string literals.

The extra data stored on user-defined literal Tokens is stored in extra
allocated memory, which is managed by the PreprocessorLexer because there isn't
a better place to put it that makes sure it gets deallocated, but only after
it's used up. My testing has shown no significant slowdown as a result, but
independent testing would be appreciated.

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

14 years agoWhen providing a code completion for an Objective-C message send, drop
Douglas Gregor [Sun, 29 Aug 2010 19:47:46 +0000 (19:47 +0000)]
When providing a code completion for an Objective-C message send, drop
the parameter names from the completions, e.g., provide

  withString:(NSString *)

instead of

  withString:(NSString *)string

since the parameter name is, by convention, redundant with the
selector piece that precedes it and the completions can get
unnecessarily long.

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

14 years agoImprove code completion for initializer lists in constructors. Instead
Douglas Gregor [Sun, 29 Aug 2010 19:27:27 +0000 (19:27 +0000)]
Improve code completion for initializer lists in constructors. Instead
of prioritizing just by initialization order, we bump the priority of
just the *next* initializer in the list, and leave everything else at
the normal priority. That way, if one intentionally skips the
initialization of a base or member (to get default initialization),
we'll still get ordered completion for the rest.

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

14 years agoAdd missing test case for constructor-initializer code completions
Douglas Gregor [Sun, 29 Aug 2010 19:20:21 +0000 (19:20 +0000)]
Add missing test case for constructor-initializer code completions

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

14 years agoObjClang++: Allow declaration of block variable in a collection
Fariborz Jahanian [Sun, 29 Aug 2010 17:20:53 +0000 (17:20 +0000)]
ObjClang++: Allow declaration of block variable in a collection
statement header (fixes radar 8295106).

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

14 years agoAdd comments.
Zhongxing Xu [Sun, 29 Aug 2010 05:16:31 +0000 (05:16 +0000)]
Add comments.

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

14 years agoTranslate NEON vaddl, vaddw, vsubl, and vsubw builtins to llvm add/sub
Bob Wilson [Sun, 29 Aug 2010 05:14:28 +0000 (05:14 +0000)]
Translate NEON vaddl, vaddw, vsubl, and vsubw builtins to llvm add/sub
with zext/sext operations, instead of to llvm intrinsics.  (We can also
get rid of the clang builtins and handle these entirely in the arm_neon.h
header if there is a way to express vector sext/zext in C.)

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

14 years agoComplain if a __pragma isn't terminated.
John McCall [Sun, 29 Aug 2010 01:09:54 +0000 (01:09 +0000)]
Complain if a __pragma isn't terminated.

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

14 years agoAdd support for Microsoft's __pragma in the preprocessor.
John McCall [Sat, 28 Aug 2010 22:34:47 +0000 (22:34 +0000)]
Add support for Microsoft's __pragma in the preprocessor.
Patch by Francois Pichet!

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

14 years agoWhen perform exact-qualifier-match template argument deduction,
John McCall [Sat, 28 Aug 2010 22:14:41 +0000 (22:14 +0000)]
When perform exact-qualifier-match template argument deduction,
properly account for the possibility that certain opaque types
might be more qualified than they appear.  Fixes PR7708.

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

14 years agoIf filtering a lookup result leaves it ambiguous, keep the ambiguity
John McCall [Sat, 28 Aug 2010 20:17:00 +0000 (20:17 +0000)]
If filtering a lookup result leaves it ambiguous, keep the ambiguity
kind.  Fixes PR7252.

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

14 years agoDelete the relaxedLiveness object in the dtor of AnalysisContext.
Ted Kremenek [Sat, 28 Aug 2010 18:59:04 +0000 (18:59 +0000)]
Delete the relaxedLiveness object in the dtor of AnalysisContext.

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

14 years agoimprove comment, patch by Vladimir Kirillov!
Chris Lattner [Sat, 28 Aug 2010 16:26:18 +0000 (16:26 +0000)]
improve comment, patch by Vladimir Kirillov!

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

14 years agosimplify by relying on cascading operator->
Gabor Greif [Sat, 28 Aug 2010 15:46:56 +0000 (15:46 +0000)]
simplify by relying on cascading operator->

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

14 years agosimplify
Gabor Greif [Sat, 28 Aug 2010 15:42:30 +0000 (15:42 +0000)]
simplify

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

14 years agoFix copy+paste error in comment.
Nick Lewycky [Sat, 28 Aug 2010 13:52:51 +0000 (13:52 +0000)]
Fix copy+paste error in comment.

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

14 years agoadd another test for PR8007
Gabor Greif [Sat, 28 Aug 2010 12:12:45 +0000 (12:12 +0000)]
add another test for PR8007
this is still failing, need to come up with a fix
(but we are in good company as the first gcc version
 pass this test will be v4.6)

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

14 years agothe target of the link uses the singular form, so do we too
Gabor Greif [Sat, 28 Aug 2010 11:05:27 +0000 (11:05 +0000)]
the target of the link uses the singular form, so do we too

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

14 years agotypo
Gabor Greif [Sat, 28 Aug 2010 11:03:06 +0000 (11:03 +0000)]
typo

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

14 years agosuppress annoying textual repetition as 'aka'
Gabor Greif [Sat, 28 Aug 2010 10:40:52 +0000 (10:40 +0000)]
suppress annoying textual repetition as 'aka'

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

14 years agoFix the memory leak of FloatingLiteral/IntegerLiteral.
Argyrios Kyrtzidis [Sat, 28 Aug 2010 09:06:06 +0000 (09:06 +0000)]
Fix the memory leak of FloatingLiteral/IntegerLiteral.

For large floats/integers, APFloat/APInt will allocate memory from the heap to represent these numbers.
Unfortunately, when we use a BumpPtrAllocator to allocate IntegerLiteral/FloatingLiteral nodes the memory associated with
the APFloat/APInt values will never get freed.
I introduce the class 'APNumericStorage' which uses ASTContext's allocator for memory allocation and is used internally by FloatingLiteral/IntegerLiteral.

Fixes rdar://7637185

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

14 years agoThat's not the right direction to compute notional accessibility in at all.
John McCall [Sat, 28 Aug 2010 08:47:21 +0000 (08:47 +0000)]
That's not the right direction to compute notional accessibility in at all.

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

14 years agoFix build. Bad me, adding last-minute assertions.
John McCall [Sat, 28 Aug 2010 08:10:32 +0000 (08:10 +0000)]
Fix build.  Bad me, adding last-minute assertions.

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

14 years agoWhen checking access control for an instance member access on
John McCall [Sat, 28 Aug 2010 07:56:00 +0000 (07:56 +0000)]
When checking access control for an instance member access on
an object of type I, if the current access target is protected
when named in a class N, consider the friends of the classes P
where I <= P <= N and where a notional member of N would be
non-forbidden in P.

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

14 years agocheck whether sema issues a redefinition error
Gabor Greif [Sat, 28 Aug 2010 02:00:22 +0000 (02:00 +0000)]
check whether sema issues a redefinition error

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

14 years agoperform cheap test first
Gabor Greif [Sat, 28 Aug 2010 01:58:12 +0000 (01:58 +0000)]
perform cheap test first

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

14 years agoIgnore this flag too, Clang doesn't seem to use random numbers internally.
Nick Lewycky [Sat, 28 Aug 2010 01:01:21 +0000 (01:01 +0000)]
Ignore this flag too, Clang doesn't seem to use random numbers internally.

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

14 years agonote to self: save before committing; add PR
Gabor Greif [Sat, 28 Aug 2010 00:48:36 +0000 (00:48 +0000)]
note to self: save before committing; add PR

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

14 years agofix test by applying it in top namespace: PR8007 only showed up this way
Gabor Greif [Sat, 28 Aug 2010 00:45:56 +0000 (00:45 +0000)]
fix test by applying it in top namespace: PR8007 only showed up this way

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

14 years agoUpdate test case, with comment to later investigate the correct behavior. Now the...
Ted Kremenek [Sat, 28 Aug 2010 00:19:12 +0000 (00:19 +0000)]
Update test case, with comment to later investigate the correct behavior.  Now the behavior is at least consistent.

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

14 years agoExplicitly handle CXXExprWithTemporaries during CFG construction by just visiting...
Ted Kremenek [Sat, 28 Aug 2010 00:19:02 +0000 (00:19 +0000)]
Explicitly handle CXXExprWithTemporaries during CFG construction by just visiting the subexpression.  While we don't do anything intelligent right now, this obviates a bogus -Wunreahable-code warning reported in PR 6130.

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

14 years agofix PR8007
Gabor Greif [Sat, 28 Aug 2010 00:16:06 +0000 (00:16 +0000)]
fix PR8007
reordering and redefinition issues still may linger,
I plan to nail them next

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

14 years agoBasic code completion support for the base and member initializers in
Douglas Gregor [Sat, 28 Aug 2010 00:00:50 +0000 (00:00 +0000)]
Basic code completion support for the base and member initializers in
a constructor.

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

14 years agoreproduction recipe for PR8007, expected to fail for now, review welcome
Gabor Greif [Fri, 27 Aug 2010 23:39:49 +0000 (23:39 +0000)]
reproduction recipe for PR8007, expected to fail for now, review welcome

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

14 years agoParser support for inline namespaces
Sebastian Redl [Fri, 27 Aug 2010 23:12:46 +0000 (23:12 +0000)]
Parser support for inline namespaces

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

14 years agoComment and move another ASTReader member.
Sebastian Redl [Fri, 27 Aug 2010 23:12:39 +0000 (23:12 +0000)]
Comment and move another ASTReader member.

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

14 years agoUpdate comment after Chandler's change.
Sebastian Redl [Fri, 27 Aug 2010 23:12:36 +0000 (23:12 +0000)]
Update comment after Chandler's change.

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

14 years agoMiscellaneous found by inspection with John and Sebastian
Douglas Gregor [Fri, 27 Aug 2010 22:55:10 +0000 (22:55 +0000)]
Miscellaneous found by inspection with John and Sebastian

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

14 years agoAdded checking of (x == x) and (x != x) to IdempotentOperationChecker and updated...
Tom Care [Fri, 27 Aug 2010 22:50:47 +0000 (22:50 +0000)]
Added checking of (x == x) and (x != x) to IdempotentOperationChecker and updated test cases flagged by it.

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

14 years agoEnabled relaxed LiveVariables analysis in the path-sensitive engine to increase the...
Tom Care [Fri, 27 Aug 2010 22:46:32 +0000 (22:46 +0000)]
Enabled relaxed LiveVariables analysis in the path-sensitive engine to increase the coverage of bugs. Primarily affects IdempotentOperationChecker.
- Migrated a temporarily separated test back to its original file (bug has been fixed, null-deref-ps-temp.c -> null-deref-ps.c)
- Changed SymbolManager to use relaxed LiveVariables
- Updated several test cases that the IdempotentOperationChecker class now flags
- Added test case to test relaxed LiveVariables use by the IdempotentOperationChecker

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

14 years agoRemove an assertion in UnreachableCodeChecker that can be triggered by bugs in other...
Tom Care [Fri, 27 Aug 2010 22:37:31 +0000 (22:37 +0000)]
Remove an assertion in UnreachableCodeChecker that can be triggered by bugs in other checkers.

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

14 years agoFix bug in IdempotentOperationChecker where an assumption would not get updated properly.
Tom Care [Fri, 27 Aug 2010 22:35:28 +0000 (22:35 +0000)]
Fix bug in IdempotentOperationChecker where an assumption would not get updated properly.

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

14 years agohandle :: in selectors in objc++ mode, rdar://8366474
Chris Lattner [Fri, 27 Aug 2010 22:32:41 +0000 (22:32 +0000)]
handle :: in selectors in objc++ mode, rdar://8366474

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

14 years agoAdd alternate version of LiveVariables analysis that does not kill liveness at assign...
Tom Care [Fri, 27 Aug 2010 22:30:10 +0000 (22:30 +0000)]
Add alternate version of LiveVariables analysis that does not kill liveness at assignments. This 'relaxed' liveness is useful in path sensitive analysis for situations where the resulting extended liveness allows us to find some bugs.
- Added killAtAssign flag to LiveVariables
- Added relaxed LiveVariables to AnalysisContext with an accessor

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

14 years agoAdd source file I meant to include in my previous commit.
Ted Kremenek [Fri, 27 Aug 2010 21:57:20 +0000 (21:57 +0000)]
Add source file I meant to include in my previous commit.

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

14 years agoImprove wording of diagnostic complaining about a non-void* pointer as the first...
Douglas Gregor [Fri, 27 Aug 2010 21:39:15 +0000 (21:39 +0000)]
Improve wording of diagnostic complaining about a non-void* pointer as the first parameter of operator delete

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

14 years agoImplement CXCursor support for walking C++ base specifiers. This includes adding...
Ted Kremenek [Fri, 27 Aug 2010 21:34:58 +0000 (21:34 +0000)]
Implement CXCursor support for walking C++ base specifiers.  This includes adding the API hooks clang_isVirtualBase() and clang_getCXXAccessSpecifier() to query properties of the base specifier.

Implements <rdar://problem/8274883>.

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

14 years agoFix copy-paste in doxygen comment.
Ted Kremenek [Fri, 27 Aug 2010 21:34:51 +0000 (21:34 +0000)]
Fix copy-paste in doxygen comment.

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

14 years agoImplement the "call super" code completion for C++. If the virtual
Douglas Gregor [Fri, 27 Aug 2010 21:18:54 +0000 (21:18 +0000)]
Implement the "call super" code completion for C++. If the virtual
member function you're typing in overrides another virtual function,
this fills in a (qualified!) call to that virtual function to make
such delegation easy.

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