aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2009-12-22Switch initialization of parameters in a call over toDouglas Gregor
InitializationSequence (when a FunctionDecl is present). This required a few small fixes to initialization sequences: - Make sure to use the adjusted parameter type for initialization of function parameters. - Implement transparent union calling semantics in C git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91902 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22Make sure that we mangle overloaded operators that are member functions ↵Anders Carlsson
correctly, giving them the correct arity. With this seemingly insignificant fix, we are now able to build and link clang using clang itself! (LLVM still has to be built with gcc for the time being). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91893 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22Work around PR5514.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91891 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22fix a bug handling the gnu ?: extension. Patch by Storlek on IRC,Chris Lattner
who prefers to be stealthy and mysterious. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91888 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22When we simply return a retained member expression when instantiating, we ↵Anders Carlsson
must also mark the member decl as referenced. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91887 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22Zap CheckInitializerTypes.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91884 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22Switch default arguments over to InitializationSequence.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91883 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22Switch compound literals over to InitializationSequence.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91882 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22Switch file-scope assignment initialization over to InitializationSequence.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91881 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22x86_64: Structures with no fields but which have padding should be classified asDaniel Dunbar
integer. - This is consistent, but may not be correct. I will revisit x86_64 ABI handling for C++ as a whole at some point. - PR5831. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91874 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22Centralize the emission/suppression/delay of diagnostics describing runtime ↵Douglas Gregor
before in the new function Sema::DiagRuntimeBehavior, addressing one of Chris' comments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91870 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22Stop diagnosing the use of inner classes as friends. ddunbar asked whetherJohn McCall
this was useful, and on review Doug and I decided it was probably on the level of a bug in the standard and therefore not worth a warning even in -pedantic. If someone disagrees and urgently wants clang++ to warn about this in strict c++98 mode, we can talk about it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91868 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22Template code for rewrite of __block variables - wip.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91865 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22Eliminate the ASTContext argument to CXXConstructorDecl::isCopyConstructor, ↵Douglas Gregor
since the context is available in the Decl git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91862 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22When converting from a type to itself or one of its base classes via aDouglas Gregor
constructor call, the conversion is only a standard conversion sequence if that constructor is a copy constructor. This fixes PR5834 in a semi-lame way, because the "real" fix will be to move over to InitializationSequence. That will happen "soonish", but not now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91861 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22When filling in value initializations within an initializer list, beDouglas Gregor
sure to fill in the initialized member of a union when a member was explicitly designated. Fixes PR5843. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91858 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21Providing support for rewriting of block copy/dispose ofFariborz Jahanian
imported block variables. WIP. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91856 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21ARM: Honor -mfpu= and set __VFP_FP__ and __ARM_NEON__ "correctly".Daniel Dunbar
- Correctly is in quotes, because we are following what I interpreted as GCC's intent (which diverges from practice, naturally). - Also, fix the arch define for arm1136jf-s. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91855 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21Improve updating of test/Makefile for out-of-dir builds.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91854 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21When a template-id refers to a single function template, and theDouglas Gregor
explicitly-specified template arguments are enough to determine the instantiation, and either template argument deduction fails or is not performed in that context, we can resolve the template-id down to a function template specialization (so sayeth C++0x [temp.arg.explicit]p3). Fixes PR5811. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91852 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21Introduce an assertion to ensure that template argument deduction doesDouglas Gregor
not deduce an "overload" type. Such a deduction indicates a failure in semantic analysis (e.g., PR5811) that currently isn't caught until code-generation time. This assertions makes it clearer that this particular issue is a semantic-analysis problem, not a code-gen problem. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91844 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21Improve on my previous fix for debug information. Rather thanDouglas Gregor
recursing in CGDebugInfo::CreateTypeNode, teach CanonicalizeTypeForDebugInfo---now called UnwrapTypeForDebugInfo---to keep unwrapping the type until we hit something that can be represented by debug information. Thanks to Anders for pointing this out! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91840 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21Teach debug info generation to handle TemplateSpecializationType,Douglas Gregor
ElaboratedType, QualifiedNameType, and SubstTemplateTypeParmType type nodes. Also, produce an "unsupported" diagnostic for C++0x type nodes and "typeof" nodes, rather than asserting nondescriptly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91837 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21Add ToolChain::getDriver() and use it instead of going through the HostInfoDaniel Dunbar
object. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91830 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21Allow comparison of 'void *' with function pointer Fariborz Jahanian
as a g++ extension (fixes radar 7481987). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91827 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21Reorganize the base-lookup bits of ActOnMemInitializer in order to betterJohn McCall
support diagnostics and error recovery. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91825 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21Add comments.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91818 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21Fix for PR5840: fix the kind of name lookup used for classes inEli Friedman
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91809 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21Small comment fix.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91808 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21indentation fixChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91807 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21Add tests for structs inside anonymous namespaces.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91806 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21Incomplete structs should also have internal linkage.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91805 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-20Correcly handle pointers to member pointer types where the class or the ↵Anders Carlsson
pointee is incomplete. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91804 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-20fix PR4010: add support for the warn_unused_result for function pointersNuno Lopes
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91803 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-20fix PR5500: clang fails to parse inline asm with :: in C++ mode Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91802 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-20refactor asm stmt parsing to avoid nesting as much, andChris Lattner
pull ':' eating out of ParseAsmOperandsOpt. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91801 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-20a really old testcase I apparently forgot to 'svn add'.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91800 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-20Rework the way pointer types are handled by the RTTI builder. We now get the ↵Anders Carlsson
right linkage for indirect pointers to incomplete structs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91799 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-20Make sure we instantiate the destructor for variables initialized byEli Friedman
assignment. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91798 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-20Fix review comment; no visible change.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91797 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-20Switch default-initialization of variables of class type (or array thereof) ↵Douglas Gregor
over to InitializationSequence. I could swear that this fixes a PR somewhere, but I couldn't figure out which one git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91796 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-20Revert accidental commitDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91795 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-20Fix CMake build on windows, from Cedric VenetDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91794 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-20Don't inject the class name until that magical lbrace.John McCall
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91792 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-20Test the lookup I wasn't sure would be done properly after the last patch.John McCall
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91791 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19Parse base specifiers within the scope of the class. This is possibly notJohn McCall
quite right; I'll come back to it later. It does fix PR 5741. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91789 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19comments shouldn't go in the AST, and we already make it easyChris Lattner
to go from a decl to the doc comments for it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91785 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19Remove another ';' after method definition.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91781 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19Remove ';' after method definition. Noticed by clang++, which one would thinkDaniel Dunbar
would have a higher respect for its own code. This is getting old, is this warning really adding value? git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91779 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19Kill off PreDeclaratorDC.John McCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91772 91177308-0d34-0410-b5e6-96231b3b80d8