Commit Graph

19100 Commits

Author SHA1 Message Date
Douglas Gregor 0915b43ac2 Teach debug info generation to handle TemplateSpecializationType,
ElaboratedType, QualifiedNameType, and SubstTemplateTypeParmType type
nodes. Also, produce an "unsupported" diagnostic for C++0x type nodes
and "typeof" nodes, rather than asserting nondescriptly.

llvm-svn: 91837
2009-12-21 19:57:21 +00:00
Daniel Dunbar 083edf70a5 Add ToolChain::getDriver() and use it instead of going through the HostInfo
object.

llvm-svn: 91830
2009-12-21 18:54:17 +00:00
Fariborz Jahanian ffc420cb51 Allow comparison of 'void *' with function pointer
as a g++ extension (fixes radar 7481987).

llvm-svn: 91827
2009-12-21 18:19:17 +00:00
John McCall b5a0d316dc Reorganize the base-lookup bits of ActOnMemInitializer in order to better
support diagnostics and error recovery.

llvm-svn: 91825
2009-12-21 10:41:20 +00:00
Zhongxing Xu fd62a33616 Add comments.
llvm-svn: 91818
2009-12-21 06:52:24 +00:00
Eli Friedman 9025ec2ee5 Fix for PR5840: fix the kind of name lookup used for classes in
Sema::getTypeName.

"LookupNestedNameSpecifierName" isn't quite the right kind of lookup, though; 
it doesn't ignore namespaces.  Someone more familiar with the lookup code
should fix this properly.

llvm-svn: 91809
2009-12-21 01:42:38 +00:00
Eli Friedman a26001bf96 Small comment fix.
llvm-svn: 91808
2009-12-21 01:26:45 +00:00
Chris Lattner 3a6af3de6c indentation fix
llvm-svn: 91807
2009-12-21 01:10:56 +00:00
Anders Carlsson 9a98ac993f Add tests for structs inside anonymous namespaces.
llvm-svn: 91806
2009-12-21 00:57:38 +00:00
Anders Carlsson 2b7f444366 Incomplete structs should also have internal linkage.
llvm-svn: 91805
2009-12-21 00:41:42 +00:00
Anders Carlsson 18e6ee1b20 Correcly handle pointers to member pointer types where the class or the pointee is incomplete.
llvm-svn: 91804
2009-12-20 23:37:55 +00:00
Nuno Lopes 518e370719 fix PR4010: add support for the warn_unused_result for function pointers
llvm-svn: 91803
2009-12-20 23:11:08 +00:00
Chris Lattner 1576850a76 fix PR5500: clang fails to parse inline asm with :: in C++ mode
llvm-svn: 91802
2009-12-20 23:08:04 +00:00
Chris Lattner bf5fff5fbb refactor asm stmt parsing to avoid nesting as much, and
pull ':' eating out of ParseAsmOperandsOpt.

llvm-svn: 91801
2009-12-20 23:00:41 +00:00
Chris Lattner 2fe080c83e a really old testcase I apparently forgot to 'svn add'.
llvm-svn: 91800
2009-12-20 23:00:15 +00:00
Anders Carlsson d008129f34 Rework the way pointer types are handled by the RTTI builder. We now get the right linkage for indirect pointers to incomplete structs.
llvm-svn: 91799
2009-12-20 22:30:54 +00:00
Eli Friedman 7dac3712a2 Make sure we instantiate the destructor for variables initialized by
assignment.

llvm-svn: 91798
2009-12-20 22:29:11 +00:00
Eli Friedman 4afe9a3518 Fix review comment; no visible change.
llvm-svn: 91797
2009-12-20 22:12:03 +00:00
Douglas Gregor 39c778b443 Switch default-initialization of variables of class type (or array thereof) over to InitializationSequence. I could swear that this fixes a PR somewhere, but I couldn't figure out which one
llvm-svn: 91796
2009-12-20 22:01:25 +00:00
Douglas Gregor 1b6d10555f Revert accidental commit
llvm-svn: 91795
2009-12-20 21:10:58 +00:00
Douglas Gregor b752f1e25c Fix CMake build on windows, from Cedric Venet
llvm-svn: 91794
2009-12-20 20:56:30 +00:00
John McCall 1c7e6ec27b Don't inject the class name until that magical lbrace.
Because of the rules of base-class lookup* and the restrictions on typedefs, it
was actually impossible for this to cause any problems more serious than the
spurious acceptance of
  template <class T> class A : B<A> { ... };
instead of
  template <class T> class A : B<A<T> > { ... };
but I'm sure we can all agree that that is a very important restriction which
is well worth making another Parser->Sema call for.

(*) n.b. clang++ does not implement these rules correctly;  we are not ignoring
    non-type names

llvm-svn: 91792
2009-12-20 07:58:13 +00:00
John McCall bffb990c23 Test the lookup I wasn't sure would be done properly after the last patch.
Clang reasonably adds all the base specifiers in one pass;  this is now required
for correctness to prevent lookup from going mad.  But this has the advantage of
establishing the correct context when looking up base specifiers, which will be
important for access control.

llvm-svn: 91791
2009-12-20 05:57:29 +00:00
John McCall 2d814c305e Parse base specifiers within the scope of the class. This is possibly not
quite right;  I'll come back to it later.  It does fix PR 5741.

llvm-svn: 91789
2009-12-19 21:48:58 +00:00
Chris Lattner f0b0cb2dcb comments shouldn't go in the AST, and we already make it easy
to go from a decl to the doc comments for it.

llvm-svn: 91785
2009-12-19 20:59:13 +00:00
Daniel Dunbar 535dc0a5e2 Remove another ';' after method definition.
llvm-svn: 91781
2009-12-19 18:58:59 +00:00
Daniel Dunbar e017ecc9e2 Remove ';' after method definition. Noticed by clang++, which one would think
would have a higher respect for its own code. This is getting old, is this
warning really adding value?

llvm-svn: 91779
2009-12-19 17:50:07 +00:00
John McCall b878801046 Kill off PreDeclaratorDC.
llvm-svn: 91772
2009-12-19 10:53:49 +00:00
John McCall 6df5fef637 Refactor to remove more dependencies on PreDeclaratorDC. I seem to have made
the redeclaration problems in the [temp.explicit]p3 testcase worse, but I can
live with that;  they'll need to be fixed more holistically anyhow.

llvm-svn: 91771
2009-12-19 10:49:29 +00:00
John McCall 4d6d6137a0 Don't use EnterDeclaratorContext when rebuilding a type in the current
instantiation, since we're not using a Scope object for that anyway.

llvm-svn: 91770
2009-12-19 09:35:56 +00:00
John McCall 1f4ee7bd2f Just push a new scope when parsing an out-of-line variable definition.
Magically fixes all the terrible lookup problems associated with not pushing
a new scope.  Resolves an ancient xfail and an LLVM misparse.

llvm-svn: 91769
2009-12-19 09:28:58 +00:00
Eli Friedman 7827520ce8 Initialization improvements: addition of string initialization and a few
small bug fixes in SemaInit, switch over SemaDecl to use it more often, and
change a bunch of diagnostics which are different with the new initialization
code.

llvm-svn: 91767
2009-12-19 08:11:05 +00:00
Douglas Gregor 5103effb1d A CXXExprWithTemporaries expression is an lvalue if its subexpression
is an lvalue. Fixes PR5787.

llvm-svn: 91765
2009-12-19 07:07:47 +00:00
Anders Carlsson 8281ee980d Fix tyop.
llvm-svn: 91761
2009-12-19 06:37:03 +00:00
Eli Friedman e75e9b9d64 Some small Builtins.def improvements.
llvm-svn: 91758
2009-12-19 05:23:20 +00:00
Daniel Dunbar 893d475ba8 ARM: Use front-end specific target features "soft-float" and "soft-float-abi" to communicate FP mode to target; __SOFTFP__ is set correctly now.
llvm-svn: 91755
2009-12-19 04:15:38 +00:00
Daniel Dunbar 7b245eda5e Targets: Allow CreateTargetInfo to mutate the target features.
- In particular, it can claim features for itself instead of always passing them on to LLVM.
 - This allows using the target features as a generic mechanism for passing target specific options to the TargetInfo instance, which may need them for initializing preprocessor defines, etc.

llvm-svn: 91753
2009-12-19 03:30:57 +00:00
Zhongxing Xu 4794801e27 Use the FunctionDecl's result type to know exactly if it returns a reference.
llvm-svn: 91751
2009-12-19 03:17:55 +00:00
Douglas Gregor a4b592a7d5 Switch more of Sema::CheckInitializerTypes over to
InitializationSequence. Specially, switch initialization of a C++
class type (either copy- or direct-initialization). 

Also, make sure that we create an elidable copy-construction when
performing copy initialization of a C++ class variable. Fixes PR5826.

llvm-svn: 91750
2009-12-19 03:01:41 +00:00
Anders Carlsson 6fda43f4c1 Correctly initialize the PrimaryBaseInfo if a base is null. Fixes PR5832.
llvm-svn: 91748
2009-12-19 02:13:41 +00:00
John McCall 7173903ea6 Unresolved implicit member accesses are dependent if the object type is dependent.
Avoids an assertion arising during object-argument initialization in overload
resolution.  In theory we can resolve this at definition time if the class
hierarchy for the member is fully known.

llvm-svn: 91747
2009-12-19 02:05:44 +00:00
Anton Korobeynikov d7e4a095c9 Add f80 entry for windows targets
llvm-svn: 91746
2009-12-19 02:05:07 +00:00
Anton Korobeynikov d94329a545 Use proper alignment for i16/i32 on msp430. This fixes PR5815.
llvm-svn: 91739
2009-12-19 01:32:37 +00:00
Chris Lattner 25d862bb17 eliminate a call to NextToken() when parsing ::foo
llvm-svn: 91738
2009-12-19 01:11:05 +00:00
Chris Lattner fc7055668b <string> already comes in from CharUnits.h
llvm-svn: 91737
2009-12-19 01:08:23 +00:00
John McCall e2ade289be Teach TryAnnotateTypeOrScopeToken to deal with already-annotated
scope specifiers.  Fix a tentative parsing bug that came up in LLVM.
Incidentally fixes some random FIXMEs in an existing testcase.

llvm-svn: 91734
2009-12-19 00:35:18 +00:00
Eli Friedman 357e8c94d6 Fix for PR5524: make reference binding in default argument work correctly.
llvm-svn: 91733
2009-12-19 00:20:10 +00:00
Eli Friedman 70724ad2ff Work in progress for setting the vtable pointers for all bases correctly in
the constructor.  This doesn't handle cases requiring the VTT at the moment,
and generates unnecessary stores, but I think it's essentially correct.

llvm-svn: 91731
2009-12-18 23:47:41 +00:00
Eli Friedman 726b878574 Test for r91724.
llvm-svn: 91730
2009-12-18 23:42:55 +00:00
Eli Friedman 2b677cd4ff Cleanup switch so it doesn't have a default case.
llvm-svn: 91725
2009-12-18 23:28:34 +00:00