]> granicus.if.org Git - clang/log
clang
13 years agoPR9908: Fix the broken fix for PR9902 to get the template argument lists in the right...
Richard Smith [Sat, 14 May 2011 15:04:18 +0000 (15:04 +0000)]
PR9908: Fix the broken fix for PR9902 to get the template argument lists in the right order.
Also, don't reject alias templates in all ElaboratedTypes: some ElaboratedTypes do not correspond to elaborated-type-specifiers.

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

13 years agoWhat I hope to be an implementation of defaulted copy assignment
Sean Hunt [Sat, 14 May 2011 05:23:28 +0000 (05:23 +0000)]
What I hope to be an implementation of defaulted copy assignment
operators.

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

13 years agoMore progress towards defaulted copy assignment
Sean Hunt [Sat, 14 May 2011 05:23:24 +0000 (05:23 +0000)]
More progress towards defaulted copy assignment

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

13 years agoStart implementing defaulted copy assignment
Sean Hunt [Sat, 14 May 2011 05:23:20 +0000 (05:23 +0000)]
Start implementing defaulted copy assignment

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

13 years agoObjective-C vtables are not taking the world by storm; call them
John McCall [Sat, 14 May 2011 03:10:52 +0000 (03:10 +0000)]
Objective-C vtables are not taking the world by storm;  call them
out as "v-table" message sends and stop calling normal messages "legacy"
message sends.

Also, fix some comments to reveal the true state of affairs.

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

13 years agoReorganize this method to avoid multiple calls for computing CGFunctionInfo
John McCall [Fri, 13 May 2011 23:16:18 +0000 (23:16 +0000)]
Reorganize this method to avoid multiple calls for computing CGFunctionInfo
and to decrease the amount of effort in appending strings.

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

13 years agoSimplify
Joerg Sonnenberger [Fri, 13 May 2011 22:58:37 +0000 (22:58 +0000)]
Simplify

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

13 years agoBug 8765: Honor assembler labels for builtins. Ensure that the label is
Joerg Sonnenberger [Fri, 13 May 2011 21:12:10 +0000 (21:12 +0000)]
Bug 8765: Honor assembler labels for builtins. Ensure that the label is
mangled to avoid doing it twice for platforms that use prefixes like
Darwin.

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

13 years agoInclude assembler label for functions in the XML dump
Joerg Sonnenberger [Fri, 13 May 2011 21:10:39 +0000 (21:10 +0000)]
Include assembler label for functions in the XML dump

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

13 years agoFix copy constructor deletion detection with array types.
Sean Hunt [Fri, 13 May 2011 21:10:11 +0000 (21:10 +0000)]
Fix copy constructor deletion detection with array types.

This fixes PR9910

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

13 years agoIntroduce __has_extension macro
Peter Collingbourne [Fri, 13 May 2011 20:54:45 +0000 (20:54 +0000)]
Introduce __has_extension macro

__has_extension is a function-like macro which takes the same set
of feature identifiers as __has_feature.  It evaluates to 1 if the
feature is supported by Clang in the current language (either as a
language extension or a standard language feature) or 0 if not.

At the same time, add support for the C1X feature identifiers
c_generic_selections (renamed from generic_selections) and
c_static_assert, and document them.

Patch by myself and Jean-Daniel Dupas.

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

13 years agoDefine __ARM_NEON__ in both ARM and Thumb modes. Radar 9431992.
Bob Wilson [Fri, 13 May 2011 18:56:03 +0000 (18:56 +0000)]
Define __ARM_NEON__ in both ARM and Thumb modes.  Radar 9431992.

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

13 years agoRemove the 'unaligned load' builtins now that they're no longer used in the *mmintrin...
Bill Wendling [Fri, 13 May 2011 18:52:28 +0000 (18:52 +0000)]
Remove the 'unaligned load' builtins now that they're no longer used in the *mmintrin.h files.

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

13 years agoProduce UTF-8 strings with -fconstant-string-class
Fariborz Jahanian [Fri, 13 May 2011 18:13:10 +0000 (18:13 +0000)]
Produce UTF-8 strings with -fconstant-string-class
-fno-constant-cfstrings. Patch by Jonathan Schleifer.

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

13 years agorefactor CheckForwardProtocolDeclarationForCircularDependency returns
Fariborz Jahanian [Fri, 13 May 2011 18:02:08 +0000 (18:02 +0000)]
refactor CheckForwardProtocolDeclarationForCircularDependency returns
'true' on detecting protocol cycles. No functionality change.

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

13 years agoAdd c-index-test printing and tests for static and virtual method
Douglas Gregor [Fri, 13 May 2011 15:54:42 +0000 (15:54 +0000)]
Add c-index-test printing and tests for static and virtual method
query functions, from Erik Verbruggen!

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

13 years agoEliminate old, useless tutorial page
Douglas Gregor [Fri, 13 May 2011 14:43:48 +0000 (14:43 +0000)]
Eliminate old, useless tutorial page

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

13 years agoDefaulting copy constructors now works reasonably well.
Sean Hunt [Fri, 13 May 2011 06:10:58 +0000 (06:10 +0000)]
Defaulting copy constructors now works reasonably well.

One more special member to go

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

13 years agosome updates.
Chris Lattner [Fri, 13 May 2011 05:29:16 +0000 (05:29 +0000)]
some updates.

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

13 years agothis never happened.
Chris Lattner [Fri, 13 May 2011 05:22:41 +0000 (05:22 +0000)]
this never happened.

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

13 years agoremove some old redirect pages. We're into our 3rd year of redirecting, the world...
Chris Lattner [Fri, 13 May 2011 05:21:33 +0000 (05:21 +0000)]
remove some old redirect pages.  We're into our 3rd year of redirecting, the world should have adjusted by now :)

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

13 years agoDelete doxygen.cfg, and use cwd-relative paths in doxygen.cfg.in.
Peter Collingbourne [Fri, 13 May 2011 03:29:06 +0000 (03:29 +0000)]
Delete doxygen.cfg, and use cwd-relative paths in doxygen.cfg.in.
Now "make doxygen" works for clang.

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

13 years agoRefactoring of constant expression evaluator
Peter Collingbourne [Fri, 13 May 2011 03:29:01 +0000 (03:29 +0000)]
Refactoring of constant expression evaluator

This introduces a generic base class for the expression evaluator
classes, which handles a few common expression types which were
previously handled separately in each class.  Also, the expression
evaluator now uses ConstStmtVisitor.

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

13 years agoAdd a ConstStmtVisitor class
Peter Collingbourne [Fri, 13 May 2011 03:28:54 +0000 (03:28 +0000)]
Add a ConstStmtVisitor class

ConstStmtVisitor is a constness-preserving variant of StmtVisitor.
ConstStmtVisitor and StmtVisitor share an implementation using a common
base class, StmtVisitorBase, which uses a template template parameter
to build pointer types.

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

13 years agoAdd 'may_alias' attribute. Noticed by Eli.
Bill Wendling [Fri, 13 May 2011 01:24:00 +0000 (01:24 +0000)]
Add 'may_alias' attribute. Noticed by Eli.

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

13 years agoWhen determining whether we can make a declaration into a global
Douglas Gregor [Fri, 13 May 2011 01:05:07 +0000 (01:05 +0000)]
When determining whether we can make a declaration into a global
constant, also consider whether it's a class type that has any mutable
fields. If so, it can't be a global constant.

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

13 years agoImplement a few basic tests for defaulted and deleted functions.
Sean Hunt [Fri, 13 May 2011 01:01:05 +0000 (01:01 +0000)]
Implement a few basic tests for defaulted and deleted functions.

More comprehensive testing once copy {constructors,assignment operators}
can be defaulted.

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

13 years agoTeach the template parameter dependency checker used when matching
Douglas Gregor [Fri, 13 May 2011 00:34:01 +0000 (00:34 +0000)]
Teach the template parameter dependency checker used when matching
template parameter lists to scope specifiers for friend declarations
about injected class name types. Fixes the
g++.dg/template/memfriend5.C regression in the GCC testsuite.

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

13 years agoImplement the __is_trivially_copyable type trait
Sean Hunt [Fri, 13 May 2011 00:31:07 +0000 (00:31 +0000)]
Implement the __is_trivially_copyable type trait

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

13 years agoRepresent the unaligned loads natively. These are converted into a call to the
Bill Wendling [Fri, 13 May 2011 00:11:39 +0000 (00:11 +0000)]
Represent the unaligned loads natively. These are converted into a call to the
correct unaligned load.

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

13 years agoImplement defaulting of destructors.
Sean Hunt [Thu, 12 May 2011 22:46:29 +0000 (22:46 +0000)]
Implement defaulting of destructors.

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

13 years agoHrm
Sean Hunt [Thu, 12 May 2011 22:46:25 +0000 (22:46 +0000)]
Hrm

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

13 years agoAdd a method to query whether or not a class has a default constructor declared.
Nick Lewycky [Thu, 12 May 2011 22:11:21 +0000 (22:11 +0000)]
Add a method to query whether or not a class has a default constructor declared.

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

13 years agoAfter issuing diagnostics on circular protocol list,
Fariborz Jahanian [Thu, 12 May 2011 22:04:39 +0000 (22:04 +0000)]
After issuing diagnostics on circular protocol list,
don't build circular AST in protocol's protocol list
when user code has introduced it. Indexer and other
clients may crash. // rdar://9221614

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

13 years agoDoug convinced me that DW_AT_APPLE_objc_complete_type is more appropriate name.
Devang Patel [Thu, 12 May 2011 21:29:57 +0000 (21:29 +0000)]
Doug convinced me that DW_AT_APPLE_objc_complete_type is more appropriate name.
s/DW_AT_APPLE_objc_class_extension/DW_AT_APPLE_objc_complete_type/g

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

13 years agoDo not add AT_APPLE_objc_class_extension attribute if @implementation is not seen.
Devang Patel [Thu, 12 May 2011 21:14:54 +0000 (21:14 +0000)]
Do not add AT_APPLE_objc_class_extension attribute if @implementation is not seen.

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

13 years agoenable __has_feature(is_standard_layout)
Howard Hinnant [Thu, 12 May 2011 19:52:14 +0000 (19:52 +0000)]
enable __has_feature(is_standard_layout)

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

13 years agoUse DW_AT_APPLE_objc_class_extension attribute to identify interfaces that represent...
Devang Patel [Thu, 12 May 2011 19:07:41 +0000 (19:07 +0000)]
Use DW_AT_APPLE_objc_class_extension attribute to identify interfaces that represent class extension.
Radar 9423077.

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

13 years agoLLVM doesn't always optimize away the four loads from this:
Bill Wendling [Thu, 12 May 2011 19:02:15 +0000 (19:02 +0000)]
LLVM doesn't always optimize away the four loads from this:

     (__m128){ p[0], p[1], p[2], p[3] }

which produces really bad code. This could be done in instcombine, but it's
probably better to do it in the front-end instead.
<rdar://problem/9424836>

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

13 years agoAdd clang_CXXMethod_isVirtual() to libclang, from Erik Verbruggen!
Douglas Gregor [Thu, 12 May 2011 15:17:24 +0000 (15:17 +0000)]
Add clang_CXXMethod_isVirtual() to libclang, from Erik Verbruggen!

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

13 years agoProperly parse the 'default' and 'delete' keywords.
Sean Hunt [Thu, 12 May 2011 06:15:49 +0000 (06:15 +0000)]
Properly parse the 'default' and 'delete' keywords.

They are actually grammatically considered definitions and parsed
accordingly.

This fixes the outstanding bugs regarding defaulting functions after
their declarations.

We now really nicely diagnose the following construct (try it!)

int foo() = delete, bar;

Still todo: Defaulted functions other than default constructors
            Test cases (including for the above construct)

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

13 years agoMake it so that we actually generate definitions for explicitly
Sean Hunt [Thu, 12 May 2011 03:51:51 +0000 (03:51 +0000)]
Make it so that we actually generate definitions for explicitly
defaulted default constructors.

As it happens, making sure that we handle out-of-line defaulted
functions properly will involved making sure that we actually parse them
correctly, so that's coming after.

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

13 years agoImplement deletion of explicitly defaulted default constructors.
Sean Hunt [Thu, 12 May 2011 03:51:48 +0000 (03:51 +0000)]
Implement deletion of explicitly defaulted default constructors.

We still don't parse out-of-line defaults correctly, which is needed to
get the full effect out of this patch.

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

13 years agoFix crasher spotted in IWYU.
Nick Lewycky [Thu, 12 May 2011 03:51:24 +0000 (03:51 +0000)]
Fix crasher spotted in IWYU.

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

13 years agoPR9899: handle pseudo-destructors correctly in noexcept() expressions.
Eli Friedman [Thu, 12 May 2011 02:11:32 +0000 (02:11 +0000)]
PR9899: handle pseudo-destructors correctly in noexcept() expressions.

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

13 years agoMake this code more resilient against catch variables which need cleanups.
John McCall [Thu, 12 May 2011 01:00:15 +0000 (01:00 +0000)]
Make this code more resilient against catch variables which need cleanups.

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

13 years agoFix typo in comment.
Nick Lewycky [Thu, 12 May 2011 00:12:46 +0000 (00:12 +0000)]
Fix typo in comment.

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

13 years agoFix PR9902: correctly substitute alias templates within the template in which they...
Richard Smith [Thu, 12 May 2011 00:06:17 +0000 (00:06 +0000)]
Fix PR9902: correctly substitute alias templates within the template in which they are defined: provide an empty list of arguments for each containing template context during substitution.

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

13 years agoImplement CWG1170, which makes access-control errors into template
Douglas Gregor [Wed, 11 May 2011 23:45:11 +0000 (23:45 +0000)]
Implement CWG1170, which makes access-control errors into template
argument deduction failures. Only implemented in C++0x, since this is
a significant change in behavior from C++98/03.

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

13 years agoWhen checking for the necessary 'template<>' headers based on the
Douglas Gregor [Wed, 11 May 2011 23:26:17 +0000 (23:26 +0000)]
When checking for the necessary 'template<>' headers based on the
nested of an out-of-line declaration, only require a 'template<>'
header for each enclosing class template that hasn't been previously
specialized; previously, we were requiring 'template<>' for enclosing
class templates and members of class templates that hadn't been
previously specialized. Fixes <rdar://problem/9422013>.

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

13 years agoPlace "conflicting distributed object modifiers..." warnings under a -W flag.
Ted Kremenek [Wed, 11 May 2011 23:06:50 +0000 (23:06 +0000)]
Place "conflicting distributed object modifiers..." warnings under a -W flag.

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

13 years agoCommit some missing changes to the previous patch.
Sean Hunt [Wed, 11 May 2011 22:50:12 +0000 (22:50 +0000)]
Commit some missing changes to the previous patch.

This means we get C++0x jump-across-intializer semantics correct.

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

13 years agoImplement implicit deletion of default constructors.
Sean Hunt [Wed, 11 May 2011 22:34:38 +0000 (22:34 +0000)]
Implement implicit deletion of default constructors.

Yes, I'm aware that the diagnostics are awful.

Tests to follow.

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

13 years agoAdd a Microsoft C test following r131201.
Francois Pichet [Wed, 11 May 2011 22:28:19 +0000 (22:28 +0000)]
Add a Microsoft C test following r131201.

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

13 years agoIn Microsoft mode, allow conversion from pointer to integral type no matter what...
Francois Pichet [Wed, 11 May 2011 22:13:54 +0000 (22:13 +0000)]
In Microsoft mode, allow conversion from pointer to integral type no matter what size the integral type is. Necessary to parse MFC code.

Example:
void f(char *ptr) {
  char var = (char)ptr;
}

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

13 years agoClean up consequences of cut and paste.
Fariborz Jahanian [Wed, 11 May 2011 17:07:02 +0000 (17:07 +0000)]
Clean up consequences of cut and paste.

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

13 years agoImplenment #pack pragma and ms_struct attribute layout.
Fariborz Jahanian [Wed, 11 May 2011 16:58:31 +0000 (16:58 +0000)]
Implenment #pack pragma and ms_struct attribute layout.
Concludes // radar://8823265.

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

13 years agoHandle gcc-compatible compilers (such as clang) the same way we handle
Oscar Fuentes [Wed, 11 May 2011 13:53:30 +0000 (13:53 +0000)]
Handle gcc-compatible compilers (such as clang) the same way we handle
gcc.

Fixes PR9886.

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

13 years agoTeach CFG building how to deal with CXXMemberCallExprs and BoundMemberTy,
John McCall [Wed, 11 May 2011 07:19:11 +0000 (07:19 +0000)]
Teach CFG building how to deal with CXXMemberCallExprs and BoundMemberTy,
then teach -Wreturn-type to handle the same.  Net effect:  we now correctly
handle noreturn attributes on member calls in the CFG.

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

13 years agoPR9882: Fix noexcept to deal with dependent new, delete, calls, and
Eli Friedman [Wed, 11 May 2011 05:22:44 +0000 (05:22 +0000)]
PR9882: Fix noexcept to deal with dependent new, delete, calls, and
dynamic_cast correctly.

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

13 years agoIn Microsoft mode, allow pure specifier (=0) on inline functions declared at class...
Francois Pichet [Wed, 11 May 2011 02:14:46 +0000 (02:14 +0000)]
In Microsoft mode, allow pure specifier (=0) on inline functions declared at class scope.
This removes 2 errors when parsing MFC code with clang

Example:
class A {
    virtual void f() = 0 { }
}

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

13 years agoUse a heralded conversion to bool in inline-asm constraints.
John McCall [Tue, 10 May 2011 23:39:47 +0000 (23:39 +0000)]
Use a heralded conversion to bool in inline-asm constraints.

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

13 years agoFix crash in -Wuninitialized when using switch statments whose condition is a logical...
Ted Kremenek [Tue, 10 May 2011 22:10:35 +0000 (22:10 +0000)]
Fix crash in -Wuninitialized when using switch statments whose condition is a logical operation.

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

13 years agoTweak the diagnostics for the C++0x extensions to friend types to note
Douglas Gregor [Tue, 10 May 2011 21:23:31 +0000 (21:23 +0000)]
Tweak the diagnostics for the C++0x extensions to friend types to note
that they are C++0x extensions, and put them in the appropriate
group. We already support most of the semantics. Addresses
<rdar://problem/9407525>.

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

13 years agoChange magic string "abc" to better magic string "qux".
Matt Beaumont-Gay [Tue, 10 May 2011 20:28:29 +0000 (20:28 +0000)]
Change magic string "abc" to better magic string "qux".

Wait, what?

So, we run Clang (and LLVM) tests in an environment where the md5sum of the
input files becomes a component of the path. When testing the preprocessor,
the path becomes part of the output (in line directives). In this test, we
were grepping for the absence of "abc" in the output. When the stars aligned
properly, the md5sum component of the path contained "abc" and the test
failed. Oops.

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

13 years agoRe-do R131114 without breaking code.
Sean Hunt [Tue, 10 May 2011 19:08:14 +0000 (19:08 +0000)]
Re-do R131114 without breaking code.

I've edited one diagnostic which would print "copy constructor" for copy
constructors and "constructor" for any other constructor. If anyone is
extremely enamored with this, it can be reinstated with a simple boolean
flag rather than calling getSpecialMember, which is inappropriate.

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

13 years agoSupport pack pragma and ms_struct attributes. // rdar://8823265
Fariborz Jahanian [Tue, 10 May 2011 19:00:50 +0000 (19:00 +0000)]
Support pack pragma and ms_struct attributes. // rdar://8823265

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

13 years agoElide __label__ declarations from the CFG. This resolves a crash in CFGRecStmtDeclVi...
Ted Kremenek [Tue, 10 May 2011 18:42:15 +0000 (18:42 +0000)]
Elide __label__ declarations from the CFG.  This resolves a crash in CFGRecStmtDeclVisitor (crash in static analyzer).

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

13 years agoReimplement Sema::MatchTemplateParametersToScopeSpecifier() based on
Douglas Gregor [Tue, 10 May 2011 18:27:06 +0000 (18:27 +0000)]
Reimplement Sema::MatchTemplateParametersToScopeSpecifier() based on
the semantic context referenced by the nested-name-specifier rather
than the syntactic form of the nested-name-specifier. The previous
incarnation was based on my complete misunderstanding of C++
[temp.expl.spec]. The latest C++0x working draft clarifies the
requirements here, and this rewrite is intended to follow that.

Along the way, improve source location information in the
diagnostics. For example, if we report that a specific type needs or
doesn't need a 'template<>' header, we dig out that type in the
nested-name-specifier and highlight its range.

Fixes: PR5907, PR9421, PR8277, PR8708, PR9482, PR9668, PR9877, and
<rdar://problem/9135379>.

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

13 years agoDon't strlen() every file before parsing it.
Eli Friedman [Tue, 10 May 2011 17:11:21 +0000 (17:11 +0000)]
Don't strlen() every file before parsing it.

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

13 years agoAdd test for PR9884.
Rafael Espindola [Tue, 10 May 2011 14:19:13 +0000 (14:19 +0000)]
Add test for PR9884.

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

13 years agoRevert 131114. This fixes PR9884.
Rafael Espindola [Tue, 10 May 2011 14:12:22 +0000 (14:12 +0000)]
Revert 131114. This fixes PR9884.

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

13 years agoFixes compilation with Visual Studio by replacing the non-standard vector::data(...
Manuel Klimek [Tue, 10 May 2011 00:58:12 +0000 (00:58 +0000)]
Fixes compilation with Visual Studio by replacing the non-standard vector::data() access.

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

13 years agoFurther implement defaulting constructors.
Sean Hunt [Tue, 10 May 2011 00:49:42 +0000 (00:49 +0000)]
Further implement defaulting constructors.

Focus is on default constructors for the time being. Currently the
exception specification and prototype are processed correctly. Codegen
might work but in all likelihood doesn't.

Note that due to an error, out-of-line defaulting of member functions is
currently impossible. It will continue to that until I muster up the
courage to admit that I secretly pray to epimetheus and that I need to
rework the way default gets from Parse -> Sema.

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

13 years agoThe last of the trivial constructor changes, make CXXSpecialMember
Sean Hunt [Tue, 10 May 2011 00:41:46 +0000 (00:41 +0000)]
The last of the trivial constructor changes, make CXXSpecialMember
reflect our new, more accurate AST.

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

13 years agoAdd a __uuidof test where the uuid attribute is on the second declaration.
Francois Pichet [Tue, 10 May 2011 00:08:32 +0000 (00:08 +0000)]
Add a __uuidof test where the uuid attribute is on the second declaration.
Also some -fdelayed-template-parsing test refactoring.

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

13 years agoIgnore const/volatile/restrict qualifiers on anonymous structs and
Douglas Gregor [Mon, 9 May 2011 23:05:33 +0000 (23:05 +0000)]
Ignore const/volatile/restrict qualifiers on anonymous structs and
unions. Fixes PR8326.

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

13 years agoAdd a FIXME.
Francois Pichet [Mon, 9 May 2011 22:32:46 +0000 (22:32 +0000)]
Add a FIXME.

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

13 years ago'long long' requires special treatment in ms_struct
Fariborz Jahanian [Mon, 9 May 2011 22:03:17 +0000 (22:03 +0000)]
'long long' requires special treatment in ms_struct
structs (impacts 32-bit only though).

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

13 years agoExtend the tag-ambiguity hack I committed in r130810 for tag
Douglas Gregor [Mon, 9 May 2011 21:46:33 +0000 (21:46 +0000)]
Extend the tag-ambiguity hack I committed in r130810 for tag
definitions to also include tag declarations. Fixes PR8151.

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

13 years agoClean up trivial default constructors now.
Sean Hunt [Mon, 9 May 2011 21:45:35 +0000 (21:45 +0000)]
Clean up trivial default constructors now.

hasTrivialDefaultConstructor() really really means it now.

Also implement a fun standards bug regarding aggregates. Doug, if you'd
like, I can un-implement that bug if you think it is truly a defect.

The bug is that non-special-member constructors are never considered
user-provided, so the following is an aggregate:

struct foo {
  foo(int);
};

It's kind of bad, but the solution isn't obvious - should

struct foo {
  foo (int) = delete;
};

be an aggregate or not?

Lastly, add a missing initialization to FunctionDecl.

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

13 years agoWhen determining whether we need to instantiate a function type,
Douglas Gregor [Mon, 9 May 2011 20:45:16 +0000 (20:45 +0000)]
When determining whether we need to instantiate a function type,
also consider whether any of the parameter types (as written, prior to
decay) are dependent. Fixes PR9880 and <rdar://problem/9408413>.

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

13 years agoRename "hasTrivialConstructor" to "hasTrivialDefaultConstructor" and
Sean Hunt [Mon, 9 May 2011 18:22:59 +0000 (18:22 +0000)]
Rename "hasTrivialConstructor" to "hasTrivialDefaultConstructor" and
modify the semantics slightly to accomodate default constructors (I
hope).

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

13 years agoDriver/Darwin: Put dsymutil -o arguments first, so that dysmutil doesn't barf
Daniel Dunbar [Mon, 9 May 2011 17:23:16 +0000 (17:23 +0000)]
Driver/Darwin: Put dsymutil -o arguments first, so that dysmutil doesn't barf
when POSIXLY_COMPLIANT is set.
 - Patch by Dave Vasilevsky!

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

13 years ago__builtin_va_list is void* on ARM, not char*.
John McCall [Mon, 9 May 2011 02:19:37 +0000 (02:19 +0000)]
__builtin_va_list is void* on ARM, not char*.
rdar://problem/9391966

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

13 years agoFix test.
Francois Pichet [Sun, 8 May 2011 23:15:10 +0000 (23:15 +0000)]
Fix test.

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

13 years agoAllow implicit conversion from function pointer to void* in Microsoft mode.
Francois Pichet [Sun, 8 May 2011 22:52:41 +0000 (22:52 +0000)]
Allow implicit conversion from function pointer to void* in Microsoft mode.
Necessary to parse MFC code.

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

13 years agoMove code to emit the callee of an CXXOperatorCallExpr out into a separate function...
Anders Carlsson [Sun, 8 May 2011 20:32:23 +0000 (20:32 +0000)]
Move code to emit the callee of an CXXOperatorCallExpr out into a separate function in CGClass.cpp

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

13 years agoRestore an accidentally-deleted word.
Sean Hunt [Sun, 8 May 2011 20:15:27 +0000 (20:15 +0000)]
Restore an accidentally-deleted word.

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

13 years agoDon't emit complete constructors for abstract classes. Also, don't emit
Anders Carlsson [Sun, 8 May 2011 17:25:05 +0000 (17:25 +0000)]
Don't emit complete constructors for abstract classes. Also, don't emit
complete destructors for abstract classes unless the destructor is virtual
and thus needs to be in the vtable.

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

13 years agoLook at all the record redeclaration when looking for a uuid attribute.
Francois Pichet [Sun, 8 May 2011 10:02:20 +0000 (10:02 +0000)]
Look at all the record redeclaration when looking for a uuid attribute.

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

13 years agoRelax the conversion rules for Objective-C GC qualifiers a
Douglas Gregor [Sun, 8 May 2011 06:09:53 +0000 (06:09 +0000)]
Relax the conversion rules for Objective-C GC qualifiers a
bit by allowing __weak and __strong to be added/dropped as part of
implicit conversions (qualification conversions in C++). A little
history: GCC lets one add/remove/change GC qualifiers just about
anywhere, implicitly. Clang did roughly the same before, but we
recently normalized the semantics of qualifiers across the board to
get a semantics that we could reason about (yay). Unfortunately, this
tightened the screws a bit too much for GC qualifiers, where it's
common to add/remove these qualifiers at will.

Overall, we're still in better shape than we were before: we don't
permit directly changing the GC qualifier (e.g., __weak -> __strong),
so type safety is improved. More importantly, we're internally
consistent in our handling of qualifiers, and the logic that allows
adding/removing GC qualifiers (but not adding/removing address
spaces!) only touches two obvious places.

Fixes <rdar://problem/9402499>.

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

13 years agoIn C++, allow us to emit a global as 'constant' even if it has class
Douglas Gregor [Sat, 7 May 2011 22:06:45 +0000 (22:06 +0000)]
In C++, allow us to emit a global as 'constant' even if it has class
type, so long as it is known to have a constant initializer and the
class type is a POD class. Fixes <rdar://problem/9306265>.

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

13 years agoRevert r130717, which caused a regression (<rdar://problem/9402621>).
Douglas Gregor [Sat, 7 May 2011 20:12:26 +0000 (20:12 +0000)]
Revert r130717, which caused a regression (<rdar://problem/9402621>).

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

13 years agoDon't fail at parsing __declspec(property(get=get_func_name)). Just skip everything...
Francois Pichet [Sat, 7 May 2011 19:04:49 +0000 (19:04 +0000)]
Don't fail at parsing __declspec(property(get=get_func_name)). Just skip everything inside property() for now while we wait for the BoostPro people to provide a complete patch.

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

13 years agoPR9866: Fix the implementation of _mm_loadl_pd and _mm_loadh_pd to not make
Eli Friedman [Sat, 7 May 2011 18:59:31 +0000 (18:59 +0000)]
PR9866: Fix the implementation of _mm_loadl_pd and _mm_loadh_pd to not make
bad assumptions about the alignment of the double* argument.

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

13 years agoTemporary preprocessor hack to get around the Microsoft __identifier(x) extension.
Francois Pichet [Sat, 7 May 2011 17:47:38 +0000 (17:47 +0000)]
Temporary preprocessor hack to get around the Microsoft __identifier(x) extension.
http://msdn.microsoft.com/en-us/library/hzc8ytsz(v=VS.100).aspx

Microsoft doc claims this is a C++/CLI feature but it is really always enabled.
This removes 2 error when parsing MFC code with clang.

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

13 years agoAdd support for _if_exists and __if_not_exists at namespace/global scope.
Francois Pichet [Sat, 7 May 2011 17:30:27 +0000 (17:30 +0000)]
Add support for _if_exists and __if_not_exists at namespace/global scope.

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

13 years agoPatch for PR 7409 - only error on definition of invalid typedefs. Suppress errors...
Richard Trieu [Sat, 7 May 2011 01:36:37 +0000 (01:36 +0000)]
Patch for PR 7409 - only error on definition of invalid typedefs.  Suppress errors for additional uses of this invalid typedef.

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

13 years agoImplement a minor optimization by not introducing declarations into
Douglas Gregor [Fri, 6 May 2011 23:32:38 +0000 (23:32 +0000)]
Implement a minor optimization by not introducing declarations into
DeclContext's lookup table when they aren't in any identifier namespace.

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