]> granicus.if.org Git - clang/log
clang
14 years agoTeach libclang to visit OverloadExprs, so that we can reuse this
Douglas Gregor [Thu, 2 Sep 2010 22:29:21 +0000 (22:29 +0000)]
Teach libclang to visit OverloadExprs, so that we can reuse this
code. Also, teach it about explicitly-specified template arguments.

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

14 years agosabre points out that the timing here is pretty pessimal; I'll retry the
John McCall [Thu, 2 Sep 2010 22:27:38 +0000 (22:27 +0000)]
sabre points out that the timing here is pretty pessimal;  I'll retry the
experiment in a few days.

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

14 years agoAdd libclang visitation for UnresolvedLookupExprs
Douglas Gregor [Thu, 2 Sep 2010 22:19:24 +0000 (22:19 +0000)]
Add libclang visitation for UnresolvedLookupExprs

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

14 years agoExperimentally move the tautological comparison warnings from -Wsign-compare
John McCall [Thu, 2 Sep 2010 22:18:59 +0000 (22:18 +0000)]
Experimentally move the tautological comparison warnings from -Wsign-compare
to -Wtautological-compare.  This implies that they're now on by default.
If this causes chaos, I'll figure something else out.

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

14 years agoAdd libclang visitation for C++ pseudo-destructor expressions.
Douglas Gregor [Thu, 2 Sep 2010 22:09:03 +0000 (22:09 +0000)]
Add libclang visitation for C++ pseudo-destructor expressions.

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

14 years agoReorder the MMX builtins to be in their own ostracized group.
Bill Wendling [Thu, 2 Sep 2010 22:07:51 +0000 (22:07 +0000)]
Reorder the MMX builtins to be in their own ostracized group.

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

14 years agoNewline at end of file.
Bill Wendling [Thu, 2 Sep 2010 22:07:07 +0000 (22:07 +0000)]
Newline at end of file.

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

14 years agoEliminate CXXBindReferenceExpr, which was used in a ton of
Douglas Gregor [Thu, 2 Sep 2010 21:50:02 +0000 (21:50 +0000)]
Eliminate CXXBindReferenceExpr, which was used in a ton of
well-intentioned but completely unused code.

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

14 years agoTeach libclang not to recursive into default argument expressions
Douglas Gregor [Thu, 2 Sep 2010 21:38:13 +0000 (21:38 +0000)]
Teach libclang not to recursive into default argument expressions

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

14 years agoAdd a compatibility note about why Clang rejects jumps past __block variables.
Daniel Dunbar [Thu, 2 Sep 2010 21:35:16 +0000 (21:35 +0000)]
Add a compatibility note about why Clang rejects jumps past __block variables.

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

14 years agoAdd libclang visitation for C++ typeid expressions.
Douglas Gregor [Thu, 2 Sep 2010 21:20:16 +0000 (21:20 +0000)]
Add libclang visitation for C++ typeid expressions.

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

14 years agoIn libclang, visit the nested-name-specifier and explicitly-specified template argume...
Douglas Gregor [Thu, 2 Sep 2010 21:07:44 +0000 (21:07 +0000)]
In libclang, visit the nested-name-specifier and explicitly-specified template arguments of a MemberExpr.

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

14 years agoReverting 112850 and 112839 due to test failures on some systems
Tom Care [Thu, 2 Sep 2010 20:58:38 +0000 (20:58 +0000)]
Reverting 112850 and 112839 due to test failures on some systems

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

14 years agoVisit the nested-name-specifier and explicitly-specified template
Douglas Gregor [Thu, 2 Sep 2010 20:35:02 +0000 (20:35 +0000)]
Visit the nested-name-specifier and explicitly-specified template
arguments of a DeclRefExpr.

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

14 years agoFixed broken build with GCC
Tom Care [Thu, 2 Sep 2010 19:00:08 +0000 (19:00 +0000)]
Fixed broken build with GCC

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

14 years agoTeach RecursiveASTVisitor to optionally visit bodies of instantiations.
John McCall [Thu, 2 Sep 2010 18:48:54 +0000 (18:48 +0000)]
Teach RecursiveASTVisitor to optionally visit bodies of instantiations.
Based on a patch by Francois Pichet!

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

14 years agoTidy up last commit, as per Devang's comments.
David Chisnall [Thu, 2 Sep 2010 18:01:51 +0000 (18:01 +0000)]
Tidy up last commit, as per Devang's comments.

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

14 years agoImproved error reporting in IdempotentOperationChecker
Tom Care [Thu, 2 Sep 2010 17:49:20 +0000 (17:49 +0000)]
Improved error reporting in IdempotentOperationChecker
- SourceRange highlighting is only given for the relevant side of the operator (assignments give both)
- Added PostVisitBinaryOperator hook to retrieve the ExplodedNode for an operator
- Added a BugReporterVisitor to display the last store to every VarDecl in a Stmt
- Changed bug reporting to use the new BugReporterVisitor

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

14 years agoRevert my two IRgen fixes for "bool", then use a far simpler approach
Douglas Gregor [Thu, 2 Sep 2010 17:38:50 +0000 (17:38 +0000)]
Revert my two IRgen fixes for "bool", then use a far simpler approach
based on ConvertTypeForMem. Thanks to John for pointing out the right
solution.

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

14 years agoImplement basic visitation for nested name specifiers via libclang
Douglas Gregor [Thu, 2 Sep 2010 17:35:32 +0000 (17:35 +0000)]
Implement basic visitation for nested name specifiers via libclang
cursors. Sadly, this visitation is a hack, because we don't have
proper source-location information for nested-name-specifiers in the
AST. It does improve on the status quo, however.

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

14 years agoAnother i1 vs. i8 type mismatch issue. This time
Fariborz Jahanian [Thu, 2 Sep 2010 17:28:31 +0000 (17:28 +0000)]
Another i1 vs. i8 type mismatch issue. This time
a 'bool' byref variable in memory. Fixes radar 8382559.

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

14 years agoUse the unmangled name for the display name in Objective-C debug info. This should...
David Chisnall [Thu, 2 Sep 2010 17:16:32 +0000 (17:16 +0000)]
Use the unmangled name for the display name in Objective-C debug info.  This should have no effect with the Mac runtime where clang (unlike GCC) uses the display name symbol name.

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

14 years agoFix more i1/i8 pointer madness. Here, an overactive assertion
Douglas Gregor [Thu, 2 Sep 2010 15:34:35 +0000 (15:34 +0000)]
Fix more i1/i8 pointer madness. Here, an overactive assertion
complains when the element type of a C++ "delete" expression is
different from what we would expect from the pointer type. When
deleting a bool*, we end up with an i1 on one side (where we compute
the LLVM type from the Clang bool type) and i8 on the other (where we
grab the LLVM type from the LLVM pointer type). I've weakened the
assertion appropriately, and the Boost Parallel Graph Library now
passes its regression tests.

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

14 years agoAvoid implicit string construction.
Benjamin Kramer [Thu, 2 Sep 2010 15:06:24 +0000 (15:06 +0000)]
Avoid implicit string construction.

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

14 years agoFix a crash involving pointer-to-data-members of boolean type. We were
Douglas Gregor [Thu, 2 Sep 2010 15:00:29 +0000 (15:00 +0000)]
Fix a crash involving pointer-to-data-members of boolean type. We were
constructing an LLVM PointerType directly from the "bool"'s LLVM type
(i1), which resulted in unfortunate pointer type i1*. The fix is to
build the LLVM PointerType from the corresponding Clang PointerType,
so that we get i8* in the case of a bool.

John, please review. I also left a FIXME there because we seem to be
dropping "volatile", which would be rather unfortunate.

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

14 years agoSimplify some random accesses to the ASTContext from the ABI classes.
John McCall [Thu, 2 Sep 2010 10:25:57 +0000 (10:25 +0000)]
Simplify some random accesses to the ASTContext from the ABI classes.

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

14 years agoStupid emacs keystroke.
John McCall [Thu, 2 Sep 2010 10:15:05 +0000 (10:15 +0000)]
Stupid emacs keystroke.

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

14 years agoAbstract IR generation of array cookies into the C++ ABI class and
John McCall [Thu, 2 Sep 2010 09:58:18 +0000 (09:58 +0000)]
Abstract IR generation of array cookies into the C++ ABI class and
implement ARM array cookies.  Also fix a few unfortunate bugs:
  - throwing dtors in deletes prevented the allocation from being deleted
  - adding the cookie to the new[] size was not being considered for
    overflow (and, more seriously, was screwing up the earlier checks)
  - deleting an array via a pointer to array of class type was not
    causing any destructors to be run and was passing the unadjusted
    pointer to the deallocator
  - lots of address-space problems, in case anyone wants to support
    free store in a variant address space :)

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

14 years agoCorrect this test for the fact that the number of uses is now printed
Duncan Sands [Thu, 2 Sep 2010 08:52:56 +0000 (08:52 +0000)]
Correct this test for the fact that the number of uses is now printed
in a comment.

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

14 years agoReverting rev 112791 - apparently -fborland-extensions is on all the time?!
Dawn Perchik [Thu, 2 Sep 2010 02:18:55 +0000 (02:18 +0000)]
Reverting rev 112791 - apparently -fborland-extensions is on all the time?!

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

14 years agoupdate comments.
Zhongxing Xu [Thu, 2 Sep 2010 01:56:39 +0000 (01:56 +0000)]
update comments.

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

14 years agoTweak test case. 'int' would introduce out-of-bound issues. We focus on array
Zhongxing Xu [Thu, 2 Sep 2010 01:42:44 +0000 (01:42 +0000)]
Tweak test case. 'int' would introduce out-of-bound issues. We focus on array
index constraints in this case.

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

14 years agoEnhance return-stack-address check (in Sema) to handle fields that themselves are...
Ted Kremenek [Thu, 2 Sep 2010 01:12:13 +0000 (01:12 +0000)]
Enhance return-stack-address check (in Sema) to handle fields that themselves are references.  (Fixes PR 7999; fix by Chandler Carruth).

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

14 years agoAdd support for Borland extensions via option -fborland-extensions
Dawn Perchik [Thu, 2 Sep 2010 01:12:01 +0000 (01:12 +0000)]
Add support for Borland extensions via option -fborland-extensions

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

14 years agoFor GRExprEngine::EvalBind() (and called visitors), unifiy StoreE and AssignE. Now...
Ted Kremenek [Thu, 2 Sep 2010 00:56:20 +0000 (00:56 +0000)]
For GRExprEngine::EvalBind() (and called visitors), unifiy StoreE and AssignE.  Now StoreE (const Stmt*) represents the expression where the store took place, which is the assignment expression if it takes place in an assignment.  This removes some conceptual dissidence as well as removes an extra parameter from the Checker::PreVisitBind() visitor.  It also improves ranges and source location information in analyzer diagnostics.

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

14 years agoFixes a warning when compiling Clang (Sema has virtual methods but a non-virtual...
Zhanyong Wan [Thu, 2 Sep 2010 00:43:20 +0000 (00:43 +0000)]
Fixes a warning when compiling Clang (Sema has virtual methods but a non-virtual dtor).  Reviewed by chandlerc and nlewycky.

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

14 years agoFixed unused variable warning.
Ted Kremenek [Thu, 2 Sep 2010 00:34:30 +0000 (00:34 +0000)]
Fixed unused variable warning.

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

14 years agoIntroduce a new libclang function,
Douglas Gregor [Thu, 2 Sep 2010 00:07:54 +0000 (00:07 +0000)]
Introduce a new libclang function,
clang_getSpecializedCursorTemplate(), which determines the template
(or member thereof) that the given cursor specializes or from which it
was instantiated. This routine can be used to establish a link between
templates and their instantiations/specializations.

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

14 years agoMake RecursiveASTVisitor not crash when a TemplateArgumentLoc object has a NULL TypeS...
Zhanyong Wan [Wed, 1 Sep 2010 23:54:22 +0000 (23:54 +0000)]
Make RecursiveASTVisitor not crash when a TemplateArgumentLoc object has a NULL TypeSourceInfo*.  This fixes the symptom of http://llvm.org/PR8043.  Reviewed by csilvers.

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

14 years agoAdd some MMX builtins to correspond with the intrinsics now accepted by
Bill Wendling [Wed, 1 Sep 2010 23:54:16 +0000 (23:54 +0000)]
Add some MMX builtins to correspond with the intrinsics now accepted by
LLVM. This will be used by the mmintrin.h header, but that bit still needs to be
worked out.

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

14 years agoAdd yet another test case for PR 8015, showing how reasoning over symbolic indices...
Ted Kremenek [Wed, 1 Sep 2010 23:37:38 +0000 (23:37 +0000)]
Add yet another test case for PR 8015, showing how reasoning over symbolic indices should exactly resolve over multiple index possibilities (and thus suppress the false positive in the test).

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

14 years agoAdd another test case for PR 8015, here with the array index being within a valid...
Ted Kremenek [Wed, 1 Sep 2010 23:37:36 +0000 (23:37 +0000)]
Add another test case for PR 8015, here with the array index being within a valid range and not just a single constant.

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

14 years agoPartial fix for PR 8015 (fix is actually by Jordy Rose, and I added a test case for...
Ted Kremenek [Wed, 1 Sep 2010 23:27:26 +0000 (23:27 +0000)]
Partial fix for PR 8015 (fix is actually by Jordy Rose, and I added a test case for follow-on work).  This patch adds a bandaid for RegionStore's limited reasoning about symbolic array values.

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

14 years agoTranslate NEON vmull, vmlal, and vmlsl builtins to llvm multiply-add/sub
Bob Wilson [Wed, 1 Sep 2010 23:20:27 +0000 (23:20 +0000)]
Translate NEON vmull, vmlal, and vmlsl builtins to llvm multiply-add/sub
with zext/sext operations, instead of to llvm intrinsics.  I have a plan to
avoid the clang builtins for these, but it is going to take a little longer
and I want to get the NEON intrinsics updated before the 2.8 release.

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

14 years agoUpdate the docstring to say FriendTemplateDecl is not actually used.
Craig Silverstein [Wed, 1 Sep 2010 23:07:49 +0000 (23:07 +0000)]
Update the docstring to say FriendTemplateDecl is not actually used.
Based on discussion with rjmccall and dgregor.

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

14 years agoDon't assert in the analyzer when analyze code does a byte load from a function's...
Ted Kremenek [Wed, 1 Sep 2010 23:00:46 +0000 (23:00 +0000)]
Don't assert in the analyzer when analyze code does a byte load from a function's address.  Fixes PR 8052.

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

14 years agoMake some docstring clarifications, after discussion with dgregor.
Craig Silverstein [Wed, 1 Sep 2010 22:55:38 +0000 (22:55 +0000)]
Make some docstring clarifications, after discussion with dgregor.

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

14 years agoFix the source-range information for an EnumConstantDecl; previously,
Douglas Gregor [Wed, 1 Sep 2010 20:41:53 +0000 (20:41 +0000)]
Fix the source-range information for an EnumConstantDecl; previously,
it did not include the initializer expression.

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

14 years agoDon't assert in CastSizeChecker when the casted-to pointee is an incomplete type...
Ted Kremenek [Wed, 1 Sep 2010 20:35:38 +0000 (20:35 +0000)]
Don't assert in CastSizeChecker when the casted-to pointee is an incomplete type.  Fixes PR 8050.

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

14 years agoTest visiting the template parameters of template template parameters,
Douglas Gregor [Wed, 1 Sep 2010 20:21:58 +0000 (20:21 +0000)]
Test visiting the template parameters of template template parameters,
support for which came in with the last commit.

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

14 years agoTeach libclang to visit the default arguments of template parameters.
Douglas Gregor [Wed, 1 Sep 2010 20:16:53 +0000 (20:16 +0000)]
Teach libclang to visit the default arguments of template parameters.

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

14 years agoImplement libclang support for using declarations. Clang actually uses
Douglas Gregor [Wed, 1 Sep 2010 19:52:22 +0000 (19:52 +0000)]
Implement libclang support for using declarations. Clang actually uses
three different kinds of AST nodes to represent using declarations:
UsingDecl, UnresolvedUsingValueDecl, and
UnresolvedUsingTypenameDecl. These three are collapsed into a single
cursor kind for using declarations, since libclang clients don't need
the distinction.

Several related changes here:
  - Cursor visitation of the three AST nodes for using declarations
  - Proper source-range computation for these AST nodes
  - Using declarations have no USRs, since they don't actually declare
    any entities.

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

14 years agoFix IRGen when property-dot syntax used to access
Fariborz Jahanian [Wed, 1 Sep 2010 19:36:41 +0000 (19:36 +0000)]
Fix IRGen when property-dot syntax used to access
a c++ class object 'ivar'. Fixes radar 8366604.

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

14 years agoImprove libclang indexing support for class template specializations
Douglas Gregor [Wed, 1 Sep 2010 17:32:36 +0000 (17:32 +0000)]
Improve libclang indexing support for class template specializations
in a few related ways:

  - Don't recurse into instantiations of templates.
  - Recurse into explicit specializations.
  - Visit the template arguments of an explicit specialization or
    explicit instantiation.
  - Include template specialization arguments in the USRs for class
    template specializations.

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

14 years agoStringRefize.
Benjamin Kramer [Wed, 1 Sep 2010 17:28:48 +0000 (17:28 +0000)]
StringRefize.

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

14 years agoMake it clear that libclang does not modify the command-line arguments
Douglas Gregor [Wed, 1 Sep 2010 16:43:19 +0000 (16:43 +0000)]
Make it clear that libclang does not modify the command-line arguments
it is given.

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

14 years agoAdd test for nothing... i.e., the contents of a USR for using directives
Douglas Gregor [Wed, 1 Sep 2010 16:37:17 +0000 (16:37 +0000)]
Add test for nothing... i.e., the contents of a USR for using directives

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

14 years agoTransfer calling-convention attributes down to member function pointers.
Douglas Gregor [Wed, 1 Sep 2010 16:29:03 +0000 (16:29 +0000)]
Transfer calling-convention attributes down to member function pointers.

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

14 years agoadd a new version of mingw, patch by İsmail "cartman" Dönmez
Chris Lattner [Wed, 1 Sep 2010 15:51:58 +0000 (15:51 +0000)]
add a new version of mingw, patch by İsmail "cartman" Dönmez
in PR8049

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

14 years agowhen emitting an error about a missing } in a compound statement, emit
Chris Lattner [Wed, 1 Sep 2010 15:49:26 +0000 (15:49 +0000)]
when emitting an error about a missing } in a compound statement, emit
a "to match this {" note, pointing out the opener.

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

14 years agoImplement libclang support for using directives (cursor + visitation +
Douglas Gregor [Wed, 1 Sep 2010 03:07:18 +0000 (03:07 +0000)]
Implement libclang support for using directives (cursor + visitation +
suppressing USRs). Also, fix up the source location information for
using directives so that the declaration location refers to the
namespace name.

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

14 years agoSplit ObjCInterfaceDecl::ReferencedProtocols into two lists: ReferencedProtocols...
Ted Kremenek [Wed, 1 Sep 2010 01:21:15 +0000 (01:21 +0000)]
Split ObjCInterfaceDecl::ReferencedProtocols into two lists: ReferencedProtocols and AllReferencedProtocols.  ReferencedProtocols
(and thus protocol_begin(), protocol_end()) now only contains the list of protocols that were directly referenced in
an @interface declaration.  'all_referenced_protocol_[begin,end]()' now returns the set of protocols that were referenced
in both the @interface and class extensions.  The latter is needed for semantic analysis/codegen, while the former is
needed to maintain the lexical information of the original source.

Fixes <rdar://problem/8380046>.

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

14 years agofix rdar://8360877 a really nasty miscompilation in Boost.Xpressive
Chris Lattner [Wed, 1 Sep 2010 00:50:20 +0000 (00:50 +0000)]
fix rdar://8360877 a really nasty miscompilation in Boost.Xpressive
caused by my ABI work.  Passing:

struct outer {
  int x;
  struct epsilon_matcher {} e;
  int f;
};

as {i32,i32} isn't safe, because the offset of the second element
needs to be at 8 when it is interpreted as a memory value.

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

14 years agosame refactoring as before, this time on the argument side.
Chris Lattner [Wed, 1 Sep 2010 00:24:35 +0000 (00:24 +0000)]
same refactoring as before, this time on the argument side.

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

14 years agorefactor some code to cut down on redundancy, no functionality change.
Chris Lattner [Wed, 1 Sep 2010 00:20:33 +0000 (00:20 +0000)]
refactor some code to cut down on redundancy, no functionality change.

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

14 years agoImprove location information in the representation of namespace
Douglas Gregor [Wed, 1 Sep 2010 00:08:19 +0000 (00:08 +0000)]
Improve location information in the representation of namespace
aliases. Previously, the location of the alias was at the "namespace"
keyword. Now, it's on the identifier being declared (as is the custom
for Clang), and we keep a separate source location for the "namespace"
keyword.

Also, added a getSourceRange() member function to NamespaceAliasDecl
to correctly compute the source range.

Finally, removed a bunch of setters from NamespaceAliasDecl and gave
ASTReaderDecl friendship so that it could set the corresponding fields
directly.

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

14 years agoPrevent warning when built with assert off.
Fariborz Jahanian [Tue, 31 Aug 2010 23:54:38 +0000 (23:54 +0000)]
Prevent warning when built with assert off.

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

14 years agoxcode project file update.
Fariborz Jahanian [Tue, 31 Aug 2010 23:49:56 +0000 (23:49 +0000)]
xcode project file update.

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

14 years agoAdd libclang support for namespace aliases (visitation + USRs) along
Douglas Gregor [Tue, 31 Aug 2010 23:48:11 +0000 (23:48 +0000)]
Add libclang support for namespace aliases (visitation + USRs) along
with a new cursor kind for a reference to a namespace.

There's still some oddities in the source location information for
NamespaceAliasDecl that I'll address with a separate commit, so the
source locations displayed in the load-namespaces.cpp test will
change.

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

14 years agoSome support for unicode string constants
Fariborz Jahanian [Tue, 31 Aug 2010 23:34:27 +0000 (23:34 +0000)]
Some support for unicode string constants
in wide strings. radar 8360841.

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

14 years agoImplement __has_feature(cxx_inline_namespaces)
Sebastian Redl [Tue, 31 Aug 2010 23:28:47 +0000 (23:28 +0000)]
Implement __has_feature(cxx_inline_namespaces)

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

14 years agoAdd NetBSD include search path
Anton Korobeynikov [Tue, 31 Aug 2010 22:39:50 +0000 (22:39 +0000)]
Add NetBSD include search path

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

14 years agoAdd convenience accessors for determining whether template declarations are definitions.
John McCall [Tue, 31 Aug 2010 22:21:26 +0000 (22:21 +0000)]
Add convenience accessors for determining whether template declarations are definitions.

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

14 years agoAdd a new libclang function clang_getTemplateCursorKind(), which
Douglas Gregor [Tue, 31 Aug 2010 22:12:17 +0000 (22:12 +0000)]
Add a new libclang function clang_getTemplateCursorKind(), which
determines the kind of declaration that would be generated if the
given template were instantiated. This allows a client to distinguish
among class/struct/union templates and function/member function/static
member function templates.

Also, teach clang_CXXMethod_isStatic() about function templates.

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

14 years agoAmusingly, I missed this point of abstraction in all my earlier
John McCall [Tue, 31 Aug 2010 21:07:20 +0000 (21:07 +0000)]
Amusingly, I missed this point of abstraction in all my earlier
member-pointer refactoring:  dereferencing a member data pointer.

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

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