]> granicus.if.org Git - clang/log
clang
14 years agoClang missing warning about conflicting declaration vs. definition
Fariborz Jahanian [Fri, 21 May 2010 23:28:58 +0000 (23:28 +0000)]
Clang missing warning about conflicting declaration vs. definition
for variable arguments list methods. (radar 8006060).

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

14 years agoImprove parser recovery when we encounter a dependent template name
Douglas Gregor [Fri, 21 May 2010 23:18:07 +0000 (23:18 +0000)]
Improve parser recovery when we encounter a dependent template name
that is missing the 'template' keyword, e.g.,

  t->getAs<T>()

where getAs is a member of an unknown specialization. C++ requires
that we treat "getAs" as a value, but that would fail to parse since T
is the name of a type. We would then fail at the '>', since a type
cannot be followed by a '>'.

This is a very common error for C++ programmers to make, especially
since GCC occasionally allows it when it shouldn't (as does Visual
C++). So, when we are in this case, we use tentative parsing to see if
the tokens starting at "<" can only be parsed as a template argument
list. If so, we produce a diagnostic with a fix-it that states that
the 'template' keyword is needed:

test/SemaTemplate/dependent-template-recover.cpp:5:8: error: 'template' keyword
      is required to treat 'getAs' as a dependent template name
    t->getAs<T>();
       ^
       template

This is just a start of this patch; I'd like to apply the same
approach to everywhere that a template-id with dependent template name
can be parsed.

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

14 years agoOutdent this file by 2 spaces per the coding standards, and also clean up
Nick Lewycky [Fri, 21 May 2010 23:14:51 +0000 (23:14 +0000)]
Outdent this file by 2 spaces per the coding standards, and also clean up
whitespace at the end of lines since I'm already touching the whole file
anyways.

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

14 years agoUnbreak self-host.
Anders Carlsson [Fri, 21 May 2010 22:17:48 +0000 (22:17 +0000)]
Unbreak self-host.

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

14 years agoUpdate retain-release checker to understand changes to how 'super' is represented
Ted Kremenek [Fri, 21 May 2010 21:57:00 +0000 (21:57 +0000)]
Update retain-release checker to understand changes to how 'super' is represented
in the ASTs.  Fixes <rdar://problem/8015556>.

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

14 years agoPass around an error SourceRange instead of an Expr* when reporting errors
Ted Kremenek [Fri, 21 May 2010 21:56:53 +0000 (21:56 +0000)]
Pass around an error SourceRange instead of an Expr* when reporting errors
in the Objective-C memory checker.

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

14 years agoRename CodeGenFunction::EmitMemSetToZero to EmitNullInitialization. Handle setting...
Anders Carlsson [Fri, 21 May 2010 21:45:41 +0000 (21:45 +0000)]
Rename CodeGenFunction::EmitMemSetToZero to EmitNullInitialization. Handle setting null data member pointers correctly. Fixes PR7139.

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

14 years agoWhen instantiating a function declaration within a function template,
Douglas Gregor [Fri, 21 May 2010 21:25:08 +0000 (21:25 +0000)]
When instantiating a function declaration within a function template,
be sure to merge its parameter scope with its parent's scope. Fixes
PR7184.

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

14 years agodown with export.
Chris Lattner [Fri, 21 May 2010 21:16:21 +0000 (21:16 +0000)]
down with export.

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

14 years agoImproved TypeLoc::getSourceRange().
Abramo Bagnara [Fri, 21 May 2010 21:12:12 +0000 (21:12 +0000)]
Improved TypeLoc::getSourceRange().

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

14 years agoanother unneeded line.
Chris Lattner [Fri, 21 May 2010 21:02:17 +0000 (21:02 +0000)]
another unneeded line.

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

14 years agomajor update to the C++ status page. C++ support is
Chris Lattner [Fri, 21 May 2010 20:59:40 +0000 (20:59 +0000)]
major update to the C++ status page.  C++ support is
now done and no more patches to it will be accepted.

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

14 years agoPropagate access specifiers to anonymous union members nested within classes.
John McCall [Fri, 21 May 2010 20:45:30 +0000 (20:45 +0000)]
Propagate access specifiers to anonymous union members nested within classes.
Fixes <rdar://problem/7987650>.

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

14 years agoFix crash in CFG construction for 'break' statements appearing in statement expressions
Ted Kremenek [Fri, 21 May 2010 20:30:15 +0000 (20:30 +0000)]
Fix crash in CFG construction for 'break' statements appearing in statement expressions
within the increment code of a for loop.

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

14 years agoUse CanQualType to enforce the use of a canonical type argument to
Douglas Gregor [Fri, 21 May 2010 20:29:55 +0000 (20:29 +0000)]
Use CanQualType to enforce the use of a canonical type argument to
CXXBasePaths::isAmbiguous(), rather than just asserting that we have a
canonical type. Fixes PR7176.

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

14 years agodon't make _Bool be a keyword in -fms-extensions mode, patch by
Chris Lattner [Fri, 21 May 2010 20:22:37 +0000 (20:22 +0000)]
don't make _Bool be a keyword in -fms-extensions mode, patch by
Steven Watanabe!

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

14 years agoTry to fix MSVC build.
Benjamin Kramer [Fri, 21 May 2010 19:58:44 +0000 (19:58 +0000)]
Try to fix MSVC build.

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

14 years agoDon't remove the break/continue scope of a for loop until after we've
Douglas Gregor [Fri, 21 May 2010 18:36:48 +0000 (18:36 +0000)]
Don't remove the break/continue scope of a for loop until after we've
emitted the increment expression. Fixes PR7189.

If someone knows how to write a useful test for this, I'd be grateful.

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

14 years agoTypeVisitor doesn't visit Stmts.
Nick Lewycky [Fri, 21 May 2010 18:04:30 +0000 (18:04 +0000)]
TypeVisitor doesn't visit Stmts.

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

14 years agoWhen generating the call arguments in a thunk to call the thunkee, do
Douglas Gregor [Fri, 21 May 2010 17:55:12 +0000 (17:55 +0000)]
When generating the call arguments in a thunk to call the thunkee, do
not make copies non-POD arguments or arguments passed by reference:
just copy the pointers directly. This eliminates another source of the
dreaded memcpy-of-non-PODs. Fixes PR7188.

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

14 years agoChanged test to use FileCheck.
Fariborz Jahanian [Fri, 21 May 2010 16:13:37 +0000 (16:13 +0000)]
Changed test to use FileCheck.

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

14 years agoTeach the RecursiveASTVisitor to enter parts of the AST previously missed.
Chandler Carruth [Fri, 21 May 2010 10:29:57 +0000 (10:29 +0000)]
Teach the RecursiveASTVisitor to enter parts of the AST previously missed.
Factor its implementation to ease the addition of these custom edges to
traverse. With this patch we get initializer expressions, block bodies, type
source info, and function argument, result, and exception types. There are
probably still some more missed edges.

While we're here, clean up and flesh out a bunch of comments.

Patch by Zhanyong Wan; I've done a cursory review, but further review
appreciated. This is fast becoming one of the most important public APIs to the
AST.

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

14 years agoAdd braces to avoid an ambiguous else, fixing a GCC warning.
Chandler Carruth [Fri, 21 May 2010 10:29:28 +0000 (10:29 +0000)]
Add braces to avoid an ambiguous else, fixing a GCC warning.

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

14 years agoAllocate space in a block record for implicit references to the Objective C
John McCall [Fri, 21 May 2010 04:11:14 +0000 (04:11 +0000)]
Allocate space in a block record for implicit references to the Objective C
'self' variable arising from uses of the 'super' keyword.  Also reorganize
some code so that BlockInfo (now CGBlockInfo) can be opaque outside of
CGBlocks.cpp.

Fixes rdar://problem/8010633.

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

14 years agoWhen emitting an lvalue for an anonymous struct or union member during
John McCall [Fri, 21 May 2010 01:18:57 +0000 (01:18 +0000)]
When emitting an lvalue for an anonymous struct or union member during
class initialization, drill down through an arbitrary number of anonymous
records.

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

14 years agoIntroduce a method to get from an anonymous struct or union record declaration
John McCall [Fri, 21 May 2010 01:17:40 +0000 (01:17 +0000)]
Introduce a method to get from an anonymous struct or union record declaration
to the associated object declaration.

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

14 years agoWhen instantiating anonymous structs/unions within a function, make
Douglas Gregor [Fri, 21 May 2010 00:31:19 +0000 (00:31 +0000)]
When instantiating anonymous structs/unions within a function, make
sure that the anonymous struct/union record declaration gets
instantiated before the variable declaration, and that it and its
fields (recursively) get entries in the local instantiation map. Fixes
PR7088.

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

14 years agodocs: Man page tweaks, to mention the integrated assembler and the
Daniel Dunbar [Fri, 21 May 2010 00:28:14 +0000 (00:28 +0000)]
docs: Man page tweaks, to mention the integrated assembler and the
-integrated-as and -no-integrated-as options.

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

14 years agoFix __crashreport_info__ declaration.
Daniel Dunbar [Thu, 20 May 2010 23:50:23 +0000 (23:50 +0000)]
Fix __crashreport_info__ declaration.

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

14 years agoFix a crasher in constructor-initializer reordering warnings (PR7179).
Douglas Gregor [Thu, 20 May 2010 23:49:34 +0000 (23:49 +0000)]
Fix a crasher in constructor-initializer reordering warnings (PR7179).

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

14 years agomake -Wc++-hex-floats be a member of -Wc++0x-compat,
Chris Lattner [Thu, 20 May 2010 23:43:05 +0000 (23:43 +0000)]
make -Wc++-hex-floats be a member of -Wc++0x-compat,
thanks to doug for pointing this out!

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

14 years agoGenerate objc_memmove_collectable write-barrier for
Fariborz Jahanian [Thu, 20 May 2010 23:34:56 +0000 (23:34 +0000)]
Generate objc_memmove_collectable write-barrier for
classes whose base class have GC'able object pointers.

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

14 years agoDon't warn about use of hex floats in c++ mode by default,
Chris Lattner [Thu, 20 May 2010 23:33:51 +0000 (23:33 +0000)]
Don't warn about use of hex floats in c++ mode by default,
matching G++'s behavior.

Warn when -pedantic or -Wc++-hex-floats is passed, and
don't warn if -pedantic -Wno-c++-hex-floats are both passed.

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

14 years agoBe sure to apply initializers to members of anonymous structs and unions
John McCall [Thu, 20 May 2010 23:23:51 +0000 (23:23 +0000)]
Be sure to apply initializers to members of anonymous structs and unions
recursively, e.g. so that members of anonymous unions inside anonymous structs
still get initialized.  Also generate default constructor calls for anonymous
struct members when necessary.

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

14 years agoImprove parser recovery when a switch condition is invalid; fixes
Douglas Gregor [Thu, 20 May 2010 23:20:59 +0000 (23:20 +0000)]
Improve parser recovery when a switch condition is invalid; fixes
<rdar://problem/7971948>.

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

14 years agoAdd a new failure kind, FK_Incomplete, to InitializationSequence, to
Douglas Gregor [Thu, 20 May 2010 22:12:02 +0000 (22:12 +0000)]
Add a new failure kind, FK_Incomplete, to InitializationSequence, to
capture failures when we try to initialize an incomplete
type. Previously, we would (ab)use FK_ConversionFailed, then
occasionally dereference a null pointer when trying to diagnose the
failure. Fixes <rdar://problem/7959007>.

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

14 years agoDriver: Switch to using the integrated assembler for standalone assembly jobs
Daniel Dunbar [Thu, 20 May 2010 21:48:38 +0000 (21:48 +0000)]
Driver: Switch to using the integrated assembler for standalone assembly jobs
(or -save-temps), when the integrated assembler is enabled.

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

14 years agoAdds support for generation of objc_memmove_collectable API
Fariborz Jahanian [Thu, 20 May 2010 21:38:57 +0000 (21:38 +0000)]
Adds support for generation of objc_memmove_collectable API
in Objective-C++ mode.

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

14 years agoDriver: Add a tool definition for the Clang integrated assembler.
Daniel Dunbar [Thu, 20 May 2010 21:30:13 +0000 (21:30 +0000)]
Driver: Add a tool definition for the Clang integrated assembler.

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

14 years agoReinstate r104117, Chandler Carruth's change that "[provides] a naming
Douglas Gregor [Thu, 20 May 2010 20:58:56 +0000 (20:58 +0000)]
Reinstate r104117, Chandler Carruth's change that "[provides] a naming
class for UnresolvedLookupExprs, even when occuring on template
names" along with a fix for an Objective-C++ crasher it introduced.

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

14 years agoMore Objective-C++ GC tests.
Fariborz Jahanian [Thu, 20 May 2010 18:22:28 +0000 (18:22 +0000)]
More Objective-C++ GC tests.

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

14 years agoclang -cc1as: Add -help, -version, and -mllvm support.
Daniel Dunbar [Thu, 20 May 2010 18:15:20 +0000 (18:15 +0000)]
clang -cc1as: Add -help, -version, and -mllvm support.

Also, fix output defaulting to match llvm-mc.

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

14 years agoDriver/MC: Add 'clang -cc1as' integrated assembler tool, currently accepts approximat...
Daniel Dunbar [Thu, 20 May 2010 17:49:16 +0000 (17:49 +0000)]
Driver/MC: Add 'clang -cc1as' integrated assembler tool, currently accepts approximately the same interface as 'llvm-mc'.

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

14 years agoDriver: Move some argument lookup utilities into driver::ArgList.
Daniel Dunbar [Thu, 20 May 2010 16:54:55 +0000 (16:54 +0000)]
Driver: Move some argument lookup utilities into driver::ArgList.

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

14 years agoCopy construction of non-trivial properties must not
Fariborz Jahanian [Thu, 20 May 2010 16:46:55 +0000 (16:46 +0000)]
Copy construction of non-trivial properties must not
be turned into a setter call (fixes radar 8008649).

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

14 years agoPicky, picky
Douglas Gregor [Thu, 20 May 2010 15:48:29 +0000 (15:48 +0000)]
Picky, picky

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

14 years agoFix a thinko
Douglas Gregor [Thu, 20 May 2010 15:47:46 +0000 (15:47 +0000)]
Fix a thinko

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

14 years agoAssert that we do not try to memcpy a non-POD class type in C++. This
Douglas Gregor [Thu, 20 May 2010 15:39:01 +0000 (15:39 +0000)]
Assert that we do not try to memcpy a non-POD class type in C++. This
particular issue was the cause of the Boost.Interprocess failures, and
in general will lead to horrendous, hard-to-diagnose miscompiles. The
assertion itself has survives self-host and a full Boost build, so we
are close to eradicating this problem in C++.

Note that the assertion is *not* turned on for Objective-C++, where we
still have problems with introducing memcpy's of non-POD class
types. That part of the assertion will go away as soon as we fix the
known issues in Objective-C++.

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

14 years agoAdded TemplateArgumentListInfo to FunctionTemplateSpecializationInfo.
Abramo Bagnara [Thu, 20 May 2010 15:32:11 +0000 (15:32 +0000)]
Added TemplateArgumentListInfo to FunctionTemplateSpecializationInfo.

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

14 years agoFix my inability to spell 'continue' and a case where message sends returning non...
David Chisnall [Thu, 20 May 2010 13:45:48 +0000 (13:45 +0000)]
Fix my inability to spell 'continue' and a case where message sends returning non-pointer-sized things were generating invalid IR inside @try blocks.

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

14 years agoRenamed misleading getSourceRange -> getLocalSourceRange and getFullSourceRange ...
Abramo Bagnara [Thu, 20 May 2010 10:00:11 +0000 (10:00 +0000)]
Renamed misleading getSourceRange -> getLocalSourceRange and getFullSourceRange -> getSourceRange for TypeLoc.

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

14 years agoRework our handling of binding a reference to a temporary
Douglas Gregor [Thu, 20 May 2010 08:36:28 +0000 (08:36 +0000)]
Rework our handling of binding a reference to a temporary
subobject. Previously, we could only properly bind to a base class
subobject while extending the lifetime of the complete object (of a
derived type); for non-static data member subobjects, we could memcpy
(!) the result and bind to that, which is rather broken.

Now, we pull apart the expression that we're binding to, to figure out
which subobject we're accessing, then construct the temporary object
(adding a destruction if needed) and, finally, dig out the subobject
we actually meant to access.

This fixes yet another instance where we were memcpy'ing rather than
doing the right thing. However, note the FIXME in references.cpp:
there's more work to be done for binding to subobjects, since the AST
is incorrectly modeling some member accesses in base classes as
lvalues when they are really rvalues.

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

14 years agoWhoops.
John McCall [Thu, 20 May 2010 07:13:26 +0000 (07:13 +0000)]
Whoops.

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

14 years agoDon't try to check jump scopes in invalid functions. Fixes
John McCall [Thu, 20 May 2010 07:05:55 +0000 (07:05 +0000)]
Don't try to check jump scopes in invalid functions.  Fixes
<rdar://problem/7995494>.

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

14 years agoWhen creating a this-adjustment thunk where the return value is of C++
Douglas Gregor [Thu, 20 May 2010 05:54:35 +0000 (05:54 +0000)]
When creating a this-adjustment thunk where the return value is of C++
class type (that uses a return slot), pass the return slot to the
callee directly rather than allocating new storage and trying to copy
the object. This appears to have been the cause of the remaining two
Boost.Interprocess failures.

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

14 years agoAdd libclang function 'clang_isFromMainFile()' (which just wraps SourceManager::isFro...
Ted Kremenek [Thu, 20 May 2010 02:59:19 +0000 (02:59 +0000)]
Add libclang function 'clang_isFromMainFile()' (which just wraps SourceManager::isFromMainFile()).

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

14 years agoRemove accidental commit
Douglas Gregor [Thu, 20 May 2010 02:26:51 +0000 (02:26 +0000)]
Remove accidental commit

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

14 years agoVarious small fixes for construction/destruction of Objective-C++
Douglas Gregor [Thu, 20 May 2010 02:24:22 +0000 (02:24 +0000)]
Various small fixes for construction/destruction of Objective-C++
instance variables:
  - Use isRecordType() rather than isa<RecordType>(), so that we see
  through typedefs in ivar types.
  - Mark the destructor as referenced
  - Perform C++ access control on the destructor

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

14 years agoExpose -fobjc-nonfragile-abi2 as a top-level clang driver option. Fixes <rdar:/...
Ted Kremenek [Thu, 20 May 2010 02:12:37 +0000 (02:12 +0000)]
Expose -fobjc-nonfragile-abi2 as a top-level clang driver option.  Fixes <rdar://problem/8007063>.

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

14 years agoSupport implicitly closing on 'this' in a block. Fixed PR7165.
John McCall [Thu, 20 May 2010 01:18:31 +0000 (01:18 +0000)]
Support implicitly closing on 'this' in a block.  Fixed PR7165.

(the codegen works here, too, but that's annoying to test without execution)

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

14 years agojust add a fixme for the StructuredArgs leak, it shouldn't affect
Chris Lattner [Thu, 20 May 2010 00:26:28 +0000 (00:26 +0000)]
just add a fixme for the StructuredArgs leak, it shouldn't affect
c++'03 code and variadic support "needs work".

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

14 years agoswitch TemplateArgumentListBuilder to hold its flat argument list in a smallvector
Chris Lattner [Thu, 20 May 2010 00:25:36 +0000 (00:25 +0000)]
switch TemplateArgumentListBuilder to hold its flat argument list in a smallvector
instead of new[]'d.  This greatly reduces the number of new[]'s, and guess what,
they were all leaked.

This adds a fixme in this hunk:

   unsigned NumPackArgs = NumFlatArgs - PackBeginIndex;
+  // FIXME: NumPackArgs shouldn't be negative here???
   if (NumPackArgs)
-    PackArgs = &FlatArgs[PackBeginIndex];
+    PackArgs = FlatArgs.data()+PackBeginIndex;

where test/SemaTemplate/variadic-class-template-2.cpp is accessing the vector
out of range and NumPackArgs is negative.  I assume variadic template args are
completely hosed.

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

14 years agofix the TemplateArgumentList copy constructor to not
Chris Lattner [Thu, 20 May 2010 00:19:09 +0000 (00:19 +0000)]
fix the TemplateArgumentList copy constructor to not
be a copy constructor (since it isn't one semantically)
and fix the ownership bits it sets to be correct!

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

14 years agoClarify TemplateArgumentList ownership over its "flat" and
Chris Lattner [Thu, 20 May 2010 00:11:47 +0000 (00:11 +0000)]
Clarify TemplateArgumentList ownership over its "flat" and
"structure" arg lists, the first step to fixing some massive
memory leaks.

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

14 years agotweak to (hopefully) fix darwin[89] buildbots. Thanks to Doug for the suggested modif...
Jim Grosbach [Wed, 19 May 2010 23:53:08 +0000 (23:53 +0000)]
tweak to (hopefully) fix darwin[89] buildbots. Thanks to Doug for the suggested modification.

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

14 years agoWhen a conditional operator is an rvalue of class type, we need to
Douglas Gregor [Wed, 19 May 2010 23:40:50 +0000 (23:40 +0000)]
When a conditional operator is an rvalue of class type, we need to
create a temporary copy of both the "true" and "false" results. Fixes
the Boost.Interprocess failures.

Daniel did all the hard work of tracking down the issue, I get to type
up the trivial fix for this horrible miscompile.

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

14 years agoMore tests for ObjC++ GC support.
Fariborz Jahanian [Wed, 19 May 2010 23:07:54 +0000 (23:07 +0000)]
More tests for ObjC++ GC support.

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

14 years agoMove CXCursor_FirstDecl definition later to make the results more readable in the...
Ted Kremenek [Wed, 19 May 2010 21:51:10 +0000 (21:51 +0000)]
Move CXCursor_FirstDecl definition later to make the results more readable in the debugger.

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

14 years agoAdded basic source locations to Elaborated and DependentName types.
Abramo Bagnara [Wed, 19 May 2010 21:37:53 +0000 (21:37 +0000)]
Added basic source locations to Elaborated and DependentName types.

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

14 years agoAdds support for ObjC++'s GC attribute on declaration of
Fariborz Jahanian [Wed, 19 May 2010 21:37:30 +0000 (21:37 +0000)]
Adds support for ObjC++'s GC attribute on declaration of
object variables and functions returning such objects.

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

14 years agoRevert r104117, "Provide a naming class for UnresolvedLookupExprs, even when
Daniel Dunbar [Wed, 19 May 2010 21:07:14 +0000 (21:07 +0000)]
Revert r104117, "Provide a naming class for UnresolvedLookupExprs, even when
occuring on..." which breaks some Objective-C code. Working on getting a test
case...

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

14 years agoFill in some silly defaults to silence a GCC warning
Douglas Gregor [Wed, 19 May 2010 18:41:43 +0000 (18:41 +0000)]
Fill in some silly defaults to silence a GCC warning

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

14 years agoCache the linkage of a type within its canonical type, eliminating
Douglas Gregor [Wed, 19 May 2010 18:39:18 +0000 (18:39 +0000)]
Cache the linkage of a type within its canonical type, eliminating
some seriously non-linear performance with deeply nested template
instantiations, as shown in PR6998.

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

14 years agoRemove clang_isDeclarationADefinition() since its functionality is already provided...
Ted Kremenek [Wed, 19 May 2010 18:36:55 +0000 (18:36 +0000)]
Remove clang_isDeclarationADefinition() since its functionality is already provided by clang_isCursorDefinition().

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

14 years agoAdd clang support for IBOutletCollection.
Ted Kremenek [Wed, 19 May 2010 17:38:06 +0000 (17:38 +0000)]
Add clang support for IBOutletCollection.

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

14 years agoRevert r104106; it's breaking linking of Boost.Serialization.
Douglas Gregor [Wed, 19 May 2010 17:02:24 +0000 (17:02 +0000)]
Revert r104106; it's breaking linking of Boost.Serialization.

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

14 years agoImplement codegen for __builtin_isnormal.
Benjamin Kramer [Wed, 19 May 2010 11:24:26 +0000 (11:24 +0000)]
Implement codegen for __builtin_isnormal.

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

14 years agoProvide a naming class for UnresolvedLookupExprs, even when occuring on
Chandler Carruth [Wed, 19 May 2010 09:39:06 +0000 (09:39 +0000)]
Provide a naming class for UnresolvedLookupExprs, even when occuring on
template names. We were completely missing naming classes for many unqualified
lookups, but this didn't trigger code paths that need it. This removes part of
an optimization that re-uses the template name lookup done by the parser to
determine if explicit template arguments actually form a template-id.
Unfortunately the technique for avoiding the duplicate lookup lost needed data
such as the class context in which the lookup succeeded.

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

14 years agoProfile type-dependent uses of overloaded operators in C++ the same
Douglas Gregor [Wed, 19 May 2010 04:13:23 +0000 (04:13 +0000)]
Profile type-dependent uses of overloaded operators in C++ the same
way regardless of whether some overloaded operator functions were
found by name lookup within the template. Fixes PR6851.

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

14 years agoTeach clang to instantiate attributes on more declarations. Fixes PR7102.
Douglas Gregor [Wed, 19 May 2010 03:39:53 +0000 (03:39 +0000)]
Teach clang to instantiate attributes on more declarations. Fixes PR7102.

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

14 years agoImplement C++ builtin operator candidates for vector types.
Douglas Gregor [Wed, 19 May 2010 03:21:00 +0000 (03:21 +0000)]
Implement C++ builtin operator candidates for vector types.

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

14 years agoFix a GCC warning about inline functions not being defined. Until r104081, only
Chandler Carruth [Wed, 19 May 2010 02:12:56 +0000 (02:12 +0000)]
Fix a GCC warning about inline functions not being defined. Until r104081, only
the same .cpp file as provided the definitions referenced these functions,
hiding the issue. However, they are clearly no longer inline. Let me know if
there is a reason to move their definitions to the header and make them truly
inline.

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

14 years agoFix an obvious goof that rjmccall found by inspection. No testcase, suggestions
Chandler Carruth [Wed, 19 May 2010 01:37:01 +0000 (01:37 +0000)]
Fix an obvious goof that rjmccall found by inspection. No testcase, suggestions
welcome for one.

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

14 years agoBasic test for user-defined conversions involving vector types
Douglas Gregor [Tue, 18 May 2010 23:05:44 +0000 (23:05 +0000)]
Basic test for user-defined conversions involving vector types

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

14 years agoMisc. fixes to bring Objetive-C++'s handling of
Fariborz Jahanian [Tue, 18 May 2010 23:04:17 +0000 (23:04 +0000)]
Misc. fixes to bring Objetive-C++'s handling of
gc attributes to be inline with Objective-C
(for radar 7925141).

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

14 years agoProtect isIntegerConstantExpr from seeing type- or value-dependent
Douglas Gregor [Tue, 18 May 2010 23:01:22 +0000 (23:01 +0000)]
Protect isIntegerConstantExpr from seeing type- or value-dependent
expressions in attributes, pragmas.

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

14 years agoImplement C++ support for vector and extended vector types. This
Douglas Gregor [Tue, 18 May 2010 22:42:18 +0000 (22:42 +0000)]
Implement C++ support for vector and extended vector types. This
involves extending implicit conversion sequences to model vector
conversions and vector splats, along with teaching the C++ conditional
operator-checking code about vector types.

Fixes <rdar://problem/7983501>.

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

14 years agoAdd function 'clang_isTagDeclDefinition()' to allow clients of libclang to distinguis...
Ted Kremenek [Tue, 18 May 2010 22:32:15 +0000 (22:32 +0000)]
Add function 'clang_isTagDeclDefinition()' to allow clients of libclang to distinguish between
forward declarations and definitions of structs/classes/enums.

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

14 years agoTeach CursorVisitor about duplicate ObjCPropertyDecls that can arise because of a...
Ted Kremenek [Tue, 18 May 2010 21:09:07 +0000 (21:09 +0000)]
Teach CursorVisitor about duplicate ObjCPropertyDecls that can arise because of a current
design limitation in how we handle Objective-C class extensions.  This was causing the CursorVisitor
to essentially visit an @property twice (once in the @interface, the other in the class extension).
Fixes <rdar://problem/7410145>.

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

14 years agoThese test now run in objective-c++ mode we well.
Fariborz Jahanian [Tue, 18 May 2010 18:24:06 +0000 (18:24 +0000)]
These test now run in objective-c++ mode we well.

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

14 years agoAdd missing test case, provided by Steven Watanabe.
Douglas Gregor [Tue, 18 May 2010 17:43:51 +0000 (17:43 +0000)]
Add missing test case, provided by Steven Watanabe.

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

14 years agoFix typo test case
Douglas Gregor [Tue, 18 May 2010 16:57:36 +0000 (16:57 +0000)]
Fix typo test case

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

14 years agoAdd support for Microsoft's __thiscall, from Steven Watanabe!
Douglas Gregor [Tue, 18 May 2010 16:57:00 +0000 (16:57 +0000)]
Add support for Microsoft's __thiscall, from Steven Watanabe!

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

14 years agoCorrectly initialize bases with member pointers. This should fix PR6441 but that...
Anders Carlsson [Tue, 18 May 2010 16:51:41 +0000 (16:51 +0000)]
Correctly initialize bases with member pointers. This should fix PR6441 but that test case is a bit weird and I'd like to investigate further before closing that bug.

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

14 years agoGive a slight edge to the context-sensitive keyword 'super' over
Douglas Gregor [Tue, 18 May 2010 16:30:22 +0000 (16:30 +0000)]
Give a slight edge to the context-sensitive keyword 'super' over
non-function-local declarations with names similar to what the user
typed. For example, this allows us to correct 'supper' to 'super' in
an Objective-C message send, even though the C function 'isupper' has
the same edit distance.

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

14 years agoTweak typo-correction logic a bit regarding "super", so that we
Douglas Gregor [Tue, 18 May 2010 16:14:23 +0000 (16:14 +0000)]
Tweak typo-correction logic a bit regarding "super", so that we
consider "super" as a candidate whenever we're parsing an expression
within an Objective-C method in an interface that has a superclass. At
some point, we'd like to give "super" a little edge over non-local
names; that will come later.

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

14 years agoPermit Objective C object pointers to be const_casted.
John McCall [Tue, 18 May 2010 09:35:29 +0000 (09:35 +0000)]
Permit Objective C object pointers to be const_casted.

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

14 years agoSwitch over the tablegen to use much prettier range technology
Sean Hunt [Tue, 18 May 2010 06:22:21 +0000 (06:22 +0000)]
Switch over the tablegen to use much prettier range technology
Also rename ABSTRACT to ABSTRACT_STMT, in keeping with the other .def
files

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

14 years ago"The attached patch allows clang to find the headers
Douglas Gregor [Tue, 18 May 2010 05:47:04 +0000 (05:47 +0000)]
"The attached patch allows clang to find the headers
for Visual Studio 2010.  It also adds a registry search
for the Express edition,", from Steven Watanabe!

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

14 years agoI hate this commit.
Douglas Gregor [Tue, 18 May 2010 05:45:02 +0000 (05:45 +0000)]
I hate this commit.

Revert much of the implementation of C++98/03 [temp.friend]p5 in
r103943 and its follow-ons r103948 and r103952. While our
implementation was technically correct, other compilers don't seem to
implement this paragraph (which forces the instantiation of friend
functions defined in a class template when a class template
specialization is instantiated), and doing so broke a bunch of Boost
libraries.

Since this behavior has changed in C++0x (which instantiates the
friend function definitions when they are used), we're going to skip
the nowhere-implemented C++98/03 semantics and go straight to the
C++0x semantics.

This commit is a band-aid to get Boost up and running again. It
doesn't really fix PR6952 (which this commit un-fixes), but it does
deal with the way Boost.Units abuses this particular paragraph.

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