summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* most of this is plumbing to get CompileOptions down into Chris Lattner2009-03-263-31/+25
| | | | | | | CodeGenModule. Once there, add a new NoCommon option to it and implement -fno-common. llvm-svn: 67735
* analyzer infrastructure: make a bunch of changes to symbolic expressions thatTed Kremenek2009-03-2614-349/+390
| | | | | | | | | | | | | | | | Zhongxing and I discussed by email. Main changes: - Removed SymIntConstraintVal and SymIntConstraint - Added SymExpr as a parent class to SymbolData, SymSymExpr, SymIntExpr - Added nonloc::SymExprVal to wrap SymExpr - SymbolRef is now just a typedef of 'const SymbolData*' - Bunch of minor code cleanups in how some methods were invoked (no functionality change) This changes are part of a long-term plan to have full symbolic expression trees. This will be useful for lazily evaluating complicated expressions. llvm-svn: 67731
* Set the access specifier for templates inside classes.Anders Carlsson2009-03-261-0/+3
| | | | llvm-svn: 67726
* Factor the member access specifier setting code into its own function. No ↵Anders Carlsson2009-03-263-27/+49
| | | | | | intended functionality change. llvm-svn: 67725
* Handle parsing of templates in member declarations. Pass the AccessSpecifier ↵Anders Carlsson2009-03-265-8/+17
| | | | | | | | all the way down to ActOnClassTemplate. Doug, Sebastian: Plz review! :) llvm-svn: 67723
* Check that the access specifier of a member redeclaration is the same as the ↵Anders Carlsson2009-03-261-3/+26
| | | | | | original declaration. llvm-svn: 67722
* Fix for PR3869: actually enforce that the argument of an indirect goto Eli Friedman2009-03-261-2/+4
| | | | | | is of type void*. I'll try to add the appropriate checking later. llvm-svn: 67721
* The injected-class-name of class templates and class templateDouglas Gregor2009-03-263-2/+29
| | | | | | | | | | | | | | | | | | specializations can be treated as a template. Finally, we can parse and process the first implementation of Fibonacci I wrote! Note that this code does not handle all of the cases where injected-class-names can be treated as templates. In particular, there's an ambiguity case that we should be able to handle (but can't), e.g., template <class T> struct Base { }; template <class T> struct Derived : Base<int>, Base<char> { typename Derived::Base b; // error: ambiguous typename Derived::Base<double> d; // OK }; llvm-svn: 67720
* Tighten the setAccess assert. We now allow AS_none if the decl contex is not ↵Anders Carlsson2009-03-252-1/+11
| | | | | | | | a C++ record decl. Also, fix fallout from the change. llvm-svn: 67717
* Implement template instantiation for static data members of classDouglas Gregor2009-03-253-64/+129
| | | | | | | | | | | | | | | | | | templates, including in-class initializers. For example: template<typename T, T Divisor> class X { public: static const T value = 10 / Divisor; }; instantiated with, e.g., X<int, 5>::value to get the value '2'. llvm-svn: 67715
* More for for objc2's ivar layout map (currentlyFariborz Jahanian2009-03-251-3/+22
| | | | | | is not in use). llvm-svn: 67713
* Pass access specifiers through to member classes and member enums.Douglas Gregor2009-03-255-10/+16
| | | | llvm-svn: 67710
* Fix notes regarding the instantiation of member classes (and test 'em).Douglas Gregor2009-03-251-2/+1
| | | | llvm-svn: 67708
* Instantiation for member classes of class templates. Note that onlyDouglas Gregor2009-03-256-78/+178
| | | | | | | | | | | the declarations of member classes are instantiated when the owning class template is instantiated. The definitions of such member classes are instantiated when a complete type is required. This change also introduces the injected-class-name into a class template specialization. llvm-svn: 67707
* fix PR3880, fixing a comma swallowing bug handling macros that only takeChris Lattner2009-03-251-0/+6
| | | | | | ... arguments. llvm-svn: 67706
* remove some dead code. ArgTokens can never be empty, because it is always Chris Lattner2009-03-251-9/+0
| | | | | | | | | | | | terminated with an EOF token. The condition it is trying to check for is handled by this code above. // Empty arguments are standard in C99 and supported as an extension in // other modes. if (ArgTokens.empty() && !Features.C99) Diag(Tok, diag::ext_empty_fnmacro_arg); llvm-svn: 67705
* Remove -f__block as codegen for __block variables should be solid.Mike Stump2009-03-251-22/+0
| | | | llvm-svn: 67697
* Fixup codegen for block literals that bleed copy/dispose informationMike Stump2009-03-252-6/+12
| | | | | | from previous block literals. llvm-svn: 67696
* Predicate to detect when a RecordDecl is really the injected-class-nameDouglas Gregor2009-03-252-0/+7
| | | | llvm-svn: 67687
* Stub out some declaration kinds that cannot ever be instantiatedDouglas Gregor2009-03-251-0/+14
| | | | llvm-svn: 67686
* Fix parsing of template classes prefixed by nested-name-specifiersDouglas Gregor2009-03-251-2/+14
| | | | llvm-svn: 67685
* Minor refactoring to eliminate an extra switch during template instantiationDouglas Gregor2009-03-251-3/+9
| | | | llvm-svn: 67684
* Driver: Implement Darwin_X86 tool chain level argument translation.Daniel Dunbar2009-03-252-5/+109
| | | | | | | | | | | | | | | | | | | | - This is really gross, but its the easiest way to match gcc. Once we are confident in the driver, we can try and push these translations down into tools. - No test cases for this yet, it's hard to see the effects of these translations before the gcc tool argument translation is pulled over. - Interaction with "unused argument" warning hasn't been worked out yet. - <rdar://problem/6717359> [driver] implement toolchain specific argument translation. "It's horrible in here." llvm-svn: 67683
* Driver: Handle -Xarch_, including warning for nasty -Xarch_ use casesDaniel Dunbar2009-03-251-2/+41
| | | | | | | we aren't going to support. For example: clang -Xarch_i386 -S -Xarch_i386 -o -Xarch_i386 myi386asm.s ... llvm-svn: 67680
* Driver: Replace Option::ForwardToGCC by Option::DriverOption (whichDaniel Dunbar2009-03-252-7/+2
| | | | | | matches the flag in Options.def). llvm-svn: 67679
* This patch adds two more SymbolData subclasses: SymIntExpr and SymSymExpr, forZhongxing Xu2009-03-255-27/+80
| | | | | | | | representing symbolic expressions like 'x'+3 and 'x'+'y'. The design is subjected to change later when we fix the class hierarchy of symbolic expressions. llvm-svn: 67678
* Driver: Fix typo in JoinedAndSeparateArg::render.Daniel Dunbar2009-03-251-1/+1
| | | | llvm-svn: 67677
* Driver: Prep for tool chain specific argument translation.Daniel Dunbar2009-03-257-79/+112
| | | | | | | | | | | | | | | | - Lift ArgList to a base class for InputArgList and DerivedArgList. - This is not a great decomposition, but it does embed the translation into the type system, and keep things efficient for tool chains that don't want to do any translation. - No intended functionality change. Eventually I hope to get rid of tool chain specific translation and have each tool do the right thing, but for now this is the easiest way to match gcc precisely (which is good for testing). llvm-svn: 67676
* simplify some conditionals, don't copy LangOptions.Chris Lattner2009-03-251-11/+15
| | | | llvm-svn: 67674
* gcc 4.3 finds my use of ^ suspicious.Daniel Dunbar2009-03-251-1/+1
| | | | llvm-svn: 67673
* Improve handling of base initializers. We now parse initializers in out of ↵Anders Carlsson2009-03-253-1/+19
| | | | | | | | | | | | | | | | | | | | | | line decls, such as: class C { C() { } int a; }; C::C() : a(10) { } We also diagnose when initializers are used on declarations that aren't constructors: t.cpp:1:10: error: only constructors take base initializers void f() : a(10) { } ^ Doug and/or Sebastian: I'd appreciate a review, especially the nested-name-spec test results (from the looks of it we now match gcc in that test.) llvm-svn: 67672
* Turn on -analyzer-eagerly-assume by default when using 'clang-cc' to performTed Kremenek2009-03-251-0/+1
| | | | | | static analysis. llvm-svn: 67665
* Template instantiation for conversion functionsDouglas Gregor2009-03-251-0/+31
| | | | llvm-svn: 67664
* Move template instantiation for expressions into a separate fileDouglas Gregor2009-03-253-401/+417
| | | | llvm-svn: 67660
* In Parser::ParseClassSpecifier, don't conflate a NULL declaration withDouglas Gregor2009-03-253-34/+32
| | | | | | | | failure to perform a declaration. Instead, explicitly note semantic failures that occur during template parsing with a DeclResult. Fixes PR3872. llvm-svn: 67659
* Parse deleted function definitions and hook them up to Doug's machinery.Sebastian Redl2009-03-243-9/+36
| | | | llvm-svn: 67653
* Encode language.Devang Patel2009-03-241-4/+15
| | | | llvm-svn: 67650
* Type::isObjectType now implements the (more sensible) C++ definitionDouglas Gregor2009-03-244-9/+8
| | | | | | | | | | | | | | | | | | of "object type" rather than the C definition of "object type". The difference is that C's "object type" excludes incomplete types such as struct X; However, C's definition also makes it far too easy to use isObjectType as a means to detect incomplete types when in fact we should use other means (e.g., Sema::RequireCompleteType) that cope with C++ semantics, including template instantiation. I've already audited every use of isObjectType and isIncompleteType to ensure that they are doing the right thing for both C and C++, so this is patch does not change any functionality. llvm-svn: 67648
* Driver: Handle -flto, -O4, and tweak -emit-llvm to match llvm-gcc.Daniel Dunbar2009-03-242-5/+15
| | | | | | | | | | | | - -emit-llvm no longer changes what compilation steps are done. - -emit-llvm and -emit-llvm -S write output files with .o and .s suffixes, respectively. - <rdar://problem/6714125> clang-driver should support -O4 and -flto, like llvm-gcc llvm-svn: 67645
* Fix a few isObjectTypes that really need to be isIncompleteOrObjectDouglas Gregor2009-03-244-17/+15
| | | | | | types; add another use of RequireCompleteType. llvm-svn: 67644
* Make sure to use RequireCompleteType rather than testing forDouglas Gregor2009-03-243-125/+152
| | | | | | | incomplete types. RequireCompleteType is needed when the type may be completed by instantiating a template. llvm-svn: 67643
* Driver: Warn when 'clang' is used to compile a source file we couldDaniel Dunbar2009-03-241-3/+9
| | | | | | conceivably handle, but are defaulting to not using clang for. llvm-svn: 67641
* Driver: Change default use of "clang" compiler.Daniel Dunbar2009-03-241-12/+18
| | | | | | | | | | | | | | | | | | | | | | - Don't default to using clang for C++ (use -ccc-clang-cxx to override). - Default to only using clang on i386 and x86_64 (use -ccc-clang-archs "" to override). - <rdar://problem/6712350> [driver] clang should not be used on powerpc by default - <rdar://problem/6705767> driver should default to -ccc-no-clang-cxx I plan to add a warning that we are not using the clang compiler for the given compilation so that users do not think clang is being used in situations it isn't. This change is motivated by the desire to be able to drop clang into a build and have things "just work", even if it happens to get used to compile C++ code or code for an architecture we don't support yet. llvm-svn: 67640
* Move ToolChain::ShouldUseClangCompiler toDaniel Dunbar2009-03-243-30/+29
| | | | | | | Driver::ShouldUseClangCompiler. - No functionality change. llvm-svn: 67639
* Driver: Translate -fverbose-asm for LLVM backend.Daniel Dunbar2009-03-241-1/+1
| | | | | | | - <rdar://problem/6715707> driver should translate -fverbose-asm into -asm-verbose llvm-svn: 67634
* Really fix cmake style builds.Mike Stump2009-03-243-1/+7
| | | | llvm-svn: 67633
* Driver: Result files shouldn't be removed on failure when -save-tempsDaniel Dunbar2009-03-241-1/+1
| | | | | | | | is specified. - No easy way to make a safe test case for this (given where the driver is supposed to put temp files). llvm-svn: 67632
* Driver: ArgList::getLastArg was in fact returning the first matching arg.Daniel Dunbar2009-03-241-3/+1
| | | | | | | - <rdar://problem/6715818> clang doesn't honor gcc semantic that last -O optimization option wins. llvm-svn: 67628
* Fix the bug that Eli noticed where we wouldn't look at function decls ↵Anders Carlsson2009-03-242-22/+47
| | | | | | outside the class declaration. llvm-svn: 67627
* improve error recovery for when type parsing fails.Chris Lattner2009-03-241-1/+5
| | | | llvm-svn: 67626
OpenPOWER on IntegriCloud