]> granicus.if.org Git - clang/log
clang
15 years agomost of this is plumbing to get CompileOptions down into
Chris Lattner [Thu, 26 Mar 2009 05:00:52 +0000 (05:00 +0000)]
most of this is plumbing to get CompileOptions down into
CodeGenModule.  Once there, add a new NoCommon option to
it and implement -fno-common.

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

15 years agomake this self contained, declare everything as 'class'.
Chris Lattner [Thu, 26 Mar 2009 05:00:03 +0000 (05:00 +0000)]
make this self contained, declare everything as 'class'.

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

15 years agosort items.
Chris Lattner [Thu, 26 Mar 2009 04:59:37 +0000 (04:59 +0000)]
sort items.

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

15 years agoadd driver and clang-cc to project.
Chris Lattner [Thu, 26 Mar 2009 04:27:05 +0000 (04:27 +0000)]
add driver and clang-cc to project.

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

15 years agoanalyzer infrastructure: make a bunch of changes to symbolic expressions that
Ted Kremenek [Thu, 26 Mar 2009 03:35:11 +0000 (03:35 +0000)]
analyzer infrastructure: make a bunch of changes to symbolic expressions that
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.

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

15 years agoSet the access specifier for templates inside classes.
Anders Carlsson [Thu, 26 Mar 2009 01:24:28 +0000 (01:24 +0000)]
Set the access specifier for templates inside classes.

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

15 years agoFactor the member access specifier setting code into its own function. No intended...
Anders Carlsson [Thu, 26 Mar 2009 01:19:02 +0000 (01:19 +0000)]
Factor the member access specifier setting code into its own function. No intended functionality change.

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

15 years agoHandle parsing of templates in member declarations. Pass the AccessSpecifier all...
Anders Carlsson [Thu, 26 Mar 2009 00:52:18 +0000 (00:52 +0000)]
Handle parsing of templates in member declarations. Pass the AccessSpecifier all the way down to ActOnClassTemplate.

Doug, Sebastian: Plz review! :)

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

15 years agoCheck that the access specifier of a member redeclaration is the same as the original...
Anders Carlsson [Thu, 26 Mar 2009 00:24:17 +0000 (00:24 +0000)]
Check that the access specifier of a member redeclaration is the same as the original declaration.

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

15 years agoFix for PR3869: actually enforce that the argument of an indirect goto
Eli Friedman [Thu, 26 Mar 2009 00:18:06 +0000 (00:18 +0000)]
Fix for PR3869: actually enforce that the argument of an indirect goto
is of type void*.  I'll try to add the appropriate checking later.

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

15 years agoThe injected-class-name of class templates and class template
Douglas Gregor [Thu, 26 Mar 2009 00:10:35 +0000 (00:10 +0000)]
The injected-class-name of class templates and class template
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
  };

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

15 years agoTighten the setAccess assert. We now allow AS_none if the decl contex is not a C...
Anders Carlsson [Wed, 25 Mar 2009 23:38:06 +0000 (23:38 +0000)]
Tighten the setAccess assert. We now allow AS_none if the decl contex is not a C++ record decl.

Also, fix fallout from the change.

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

15 years agoImplement template instantiation for static data members of class
Douglas Gregor [Wed, 25 Mar 2009 23:32:15 +0000 (23:32 +0000)]
Implement template instantiation for static data members of class
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'.

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

15 years agoMore for for objc2's ivar layout map (currently
Fariborz Jahanian [Wed, 25 Mar 2009 22:36:49 +0000 (22:36 +0000)]
More for for objc2's ivar layout map (currently
is not in use).

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

15 years agoPass access specifiers through to member classes and member enums.
Douglas Gregor [Wed, 25 Mar 2009 22:00:53 +0000 (22:00 +0000)]
Pass access specifiers through to member classes and member enums.

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

15 years agoFix notes regarding the instantiation of member classes (and test 'em).
Douglas Gregor [Wed, 25 Mar 2009 21:23:52 +0000 (21:23 +0000)]
Fix notes regarding the instantiation of member classes (and test 'em).

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

15 years agoInstantiation for member classes of class templates. Note that only
Douglas Gregor [Wed, 25 Mar 2009 21:17:03 +0000 (21:17 +0000)]
Instantiation for member classes of class templates. Note that only
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.

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

15 years agofix PR3880, fixing a comma swallowing bug handling macros that only take
Chris Lattner [Wed, 25 Mar 2009 21:08:24 +0000 (21:08 +0000)]
fix PR3880, fixing a comma swallowing bug handling macros that only take
... arguments.

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

15 years agoremove some dead code. ArgTokens can never be empty, because it is always
Chris Lattner [Wed, 25 Mar 2009 21:01:40 +0000 (21:01 +0000)]
remove some dead code.  ArgTokens can never be empty, because it is always
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);

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

15 years agoCMake: Also include header files in target when the generator is 'XCode'.
Ted Kremenek [Wed, 25 Mar 2009 20:34:07 +0000 (20:34 +0000)]
CMake: Also include header files in target when the generator is 'XCode'.

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

15 years agoIt doesn't make sense to set the access specifier to AS_none (I think)
Anders Carlsson [Wed, 25 Mar 2009 20:19:57 +0000 (20:19 +0000)]
It doesn't make sense to set the access specifier to AS_none (I think)

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

15 years agoRemove -f__block as codegen for __block variables should be solid.
Mike Stump [Wed, 25 Mar 2009 18:05:39 +0000 (18:05 +0000)]
Remove -f__block as codegen for __block variables should be solid.

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

15 years agoFixup codegen for block literals that bleed copy/dispose information
Mike Stump [Wed, 25 Mar 2009 17:58:24 +0000 (17:58 +0000)]
Fixup codegen for block literals that bleed copy/dispose information
from previous block literals.

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

15 years agoUpdate to account for the great driver renaming.
Mike Stump [Wed, 25 Mar 2009 17:56:16 +0000 (17:56 +0000)]
Update to account for the great driver renaming.

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

15 years agoPredicate to detect when a RecordDecl is really the injected-class-name
Douglas Gregor [Wed, 25 Mar 2009 15:59:44 +0000 (15:59 +0000)]
Predicate to detect when a RecordDecl is really the injected-class-name

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

15 years agoStub out some declaration kinds that cannot ever be instantiated
Douglas Gregor [Wed, 25 Mar 2009 15:45:12 +0000 (15:45 +0000)]
Stub out some declaration kinds that cannot ever be instantiated

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

15 years agoFix parsing of template classes prefixed by nested-name-specifiers
Douglas Gregor [Wed, 25 Mar 2009 15:40:00 +0000 (15:40 +0000)]
Fix parsing of template classes prefixed by nested-name-specifiers

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

15 years agoMinor refactoring to eliminate an extra switch during template instantiation
Douglas Gregor [Wed, 25 Mar 2009 15:04:13 +0000 (15:04 +0000)]
Minor refactoring to eliminate an extra switch during template instantiation

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

15 years agoDriver: Implement Darwin_X86 tool chain level argument translation.
Daniel Dunbar [Wed, 25 Mar 2009 06:58:31 +0000 (06:58 +0000)]
Driver: Implement Darwin_X86 tool chain level argument translation.
 - 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."

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

15 years agoDriver: Handle -Xarch_, including warning for nasty -Xarch_ use cases
Daniel Dunbar [Wed, 25 Mar 2009 06:12:34 +0000 (06:12 +0000)]
Driver: Handle -Xarch_, including warning for nasty -Xarch_ use cases
we aren't going to support. For example:
  clang -Xarch_i386 -S -Xarch_i386 -o -Xarch_i386 myi386asm.s ...

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

15 years agoDriver: Replace Option::ForwardToGCC by Option::DriverOption (which
Daniel Dunbar [Wed, 25 Mar 2009 06:08:46 +0000 (06:08 +0000)]
Driver: Replace Option::ForwardToGCC by Option::DriverOption (which
matches the flag in Options.def).

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

15 years agoThis patch adds two more SymbolData subclasses: SymIntExpr and SymSymExpr, for
Zhongxing Xu [Wed, 25 Mar 2009 05:58:37 +0000 (05:58 +0000)]
This patch adds two more SymbolData subclasses: SymIntExpr and SymSymExpr, for
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.

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

15 years agoDriver: Fix typo in JoinedAndSeparateArg::render.
Daniel Dunbar [Wed, 25 Mar 2009 05:23:40 +0000 (05:23 +0000)]
Driver: Fix typo in JoinedAndSeparateArg::render.

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

15 years agoDriver: Prep for tool chain specific argument translation.
Daniel Dunbar [Wed, 25 Mar 2009 04:13:45 +0000 (04:13 +0000)]
Driver: Prep for tool chain specific argument translation.
 - 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).

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

15 years agosimplify some conditionals, don't copy LangOptions.
Chris Lattner [Wed, 25 Mar 2009 03:28:08 +0000 (03:28 +0000)]
simplify some conditionals, don't copy LangOptions.

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

15 years agogcc 4.3 finds my use of ^ suspicious.
Daniel Dunbar [Wed, 25 Mar 2009 03:06:26 +0000 (03:06 +0000)]
gcc 4.3 finds my use of ^ suspicious.

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

15 years agoImprove handling of base initializers. We now parse initializers in out of line decls...
Anders Carlsson [Wed, 25 Mar 2009 02:58:17 +0000 (02:58 +0000)]
Improve handling of base initializers. We now parse initializers in out of 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.)

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

15 years agoAdd the .td files and remove the .def files from the Xcode project.
Anders Carlsson [Wed, 25 Mar 2009 02:54:43 +0000 (02:54 +0000)]
Add the .td files and remove the .def files from the Xcode project.

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

15 years agoTurn on -analyzer-eagerly-assume by default when using 'clang-cc' to perform
Ted Kremenek [Wed, 25 Mar 2009 00:38:14 +0000 (00:38 +0000)]
Turn on -analyzer-eagerly-assume by default when using 'clang-cc' to perform
static analysis.

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

15 years agoTemplate instantiation for conversion functions
Douglas Gregor [Wed, 25 Mar 2009 00:34:44 +0000 (00:34 +0000)]
Template instantiation for conversion functions

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

15 years agoTurn on '-analyzer-eagerly-assume' by default in ccc for the static analyzer.
Ted Kremenek [Wed, 25 Mar 2009 00:32:30 +0000 (00:32 +0000)]
Turn on '-analyzer-eagerly-assume' by default in ccc for the static analyzer.

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

15 years agoMove template instantiation for expressions into a separate file
Douglas Gregor [Wed, 25 Mar 2009 00:27:28 +0000 (00:27 +0000)]
Move template instantiation for expressions into a separate file

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

15 years agoIn Parser::ParseClassSpecifier, don't conflate a NULL declaration with
Douglas Gregor [Wed, 25 Mar 2009 00:13:59 +0000 (00:13 +0000)]
In Parser::ParseClassSpecifier, don't conflate a NULL declaration with
failure to perform a declaration. Instead, explicitly note semantic
failures that occur during template parsing with a DeclResult. Fixes
PR3872.

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

15 years agoParse deleted function definitions and hook them up to Doug's machinery.
Sebastian Redl [Tue, 24 Mar 2009 22:27:57 +0000 (22:27 +0000)]
Parse deleted function definitions and hook them up to Doug's machinery.

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

15 years agoEncode language.
Devang Patel [Tue, 24 Mar 2009 20:35:51 +0000 (20:35 +0000)]
Encode language.

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

15 years agoType::isObjectType now implements the (more sensible) C++ definition
Douglas Gregor [Tue, 24 Mar 2009 20:32:41 +0000 (20:32 +0000)]
Type::isObjectType now implements the (more sensible) C++ definition
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.

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

15 years agoDriver: Handle -flto, -O4, and tweak -emit-llvm to match llvm-gcc.
Daniel Dunbar [Tue, 24 Mar 2009 20:17:30 +0000 (20:17 +0000)]
Driver: Handle -flto, -O4, and tweak -emit-llvm to match llvm-gcc.
 - -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

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

15 years agoFix a few isObjectTypes that really need to be isIncompleteOrObject
Douglas Gregor [Tue, 24 Mar 2009 20:13:58 +0000 (20:13 +0000)]
Fix a few isObjectTypes that really need to be isIncompleteOrObject
types; add another use of RequireCompleteType.

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

15 years agoMake sure to use RequireCompleteType rather than testing for
Douglas Gregor [Tue, 24 Mar 2009 19:52:54 +0000 (19:52 +0000)]
Make sure to use RequireCompleteType rather than testing for
incomplete types. RequireCompleteType is needed when the type may be
completed by instantiating a template.

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

15 years agoDriver: Warn when 'clang' is used to compile a source file we could
Daniel Dunbar [Tue, 24 Mar 2009 19:14:56 +0000 (19:14 +0000)]
Driver: Warn when 'clang' is used to compile a source file we could
conceivably handle, but are defaulting to not using clang for.

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

15 years agoDriver: Change default use of "clang" compiler.
Daniel Dunbar [Tue, 24 Mar 2009 19:02:31 +0000 (19:02 +0000)]
Driver: Change default use of "clang" compiler.
 - 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.

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

15 years agoMove ToolChain::ShouldUseClangCompiler to
Daniel Dunbar [Tue, 24 Mar 2009 18:57:02 +0000 (18:57 +0000)]
Move ToolChain::ShouldUseClangCompiler to
Driver::ShouldUseClangCompiler.
 - No functionality change.

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

15 years agoDriver: Translate -fverbose-asm for LLVM backend.
Daniel Dunbar [Tue, 24 Mar 2009 17:59:06 +0000 (17:59 +0000)]
Driver: Translate -fverbose-asm for LLVM backend.
 - <rdar://problem/6715707> driver should translate -fverbose-asm into
   -asm-verbose

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

15 years agoReally fix cmake style builds.
Mike Stump [Tue, 24 Mar 2009 17:52:34 +0000 (17:52 +0000)]
Really fix cmake style builds.

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

15 years agoDriver: Result files shouldn't be removed on failure when -save-temps
Daniel Dunbar [Tue, 24 Mar 2009 17:49:01 +0000 (17:49 +0000)]
Driver: Result files shouldn't be removed on failure when -save-temps
is specified.
 - No easy way to make a safe test case for this (given where the
   driver is supposed to put temp files).

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

15 years agoDriver: ArgList::getLastArg was in fact returning the first matching arg.
Daniel Dunbar [Tue, 24 Mar 2009 17:31:30 +0000 (17:31 +0000)]
Driver: ArgList::getLastArg was in fact returning the first matching arg.
 - <rdar://problem/6715818> clang doesn't honor gcc semantic that last
    -O optimization option wins.

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

15 years agoFix the bug that Eli noticed where we wouldn't look at function decls outside the...
Anders Carlsson [Tue, 24 Mar 2009 17:23:42 +0000 (17:23 +0000)]
Fix the bug that Eli noticed where we wouldn't look at function decls outside the class declaration.

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

15 years agoimprove error recovery for when type parsing fails.
Chris Lattner [Tue, 24 Mar 2009 17:21:43 +0000 (17:21 +0000)]
improve error recovery for when type parsing fails.

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

15 years agofix "Comment#1" from PR3872
Chris Lattner [Tue, 24 Mar 2009 17:05:27 +0000 (17:05 +0000)]
fix "Comment#1" from PR3872

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

15 years agorandom cleanups.
Chris Lattner [Tue, 24 Mar 2009 17:04:48 +0000 (17:04 +0000)]
random cleanups.

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

15 years agoTemplate instantiation for constructors
Douglas Gregor [Tue, 24 Mar 2009 16:43:20 +0000 (16:43 +0000)]
Template instantiation for constructors

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

15 years ago-arch ppc should change the triple to powerpc-foo not to ppc-foo.
Chris Lattner [Tue, 24 Mar 2009 16:18:41 +0000 (16:18 +0000)]
-arch ppc should change the triple to powerpc-foo not to ppc-foo.
Similarly for ppc64.  This should probably move into the driver, along
with all the other target selection stuff other than -triple.

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

15 years agoAdd another C++ open project
Douglas Gregor [Tue, 24 Mar 2009 16:16:53 +0000 (16:16 +0000)]
Add another C++ open project

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

15 years agochange the __VERSION__ string to be more sensible. It would be useful to include...
Chris Lattner [Tue, 24 Mar 2009 16:09:18 +0000 (16:09 +0000)]
change the __VERSION__ string to be more sensible.  It would be useful to include the clang version # too.

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

15 years agoDriver: Forward -MMD (not -MM) to clang-cc; this got lost in
Daniel Dunbar [Tue, 24 Mar 2009 07:20:59 +0000 (07:20 +0000)]
Driver: Forward -MMD (not -MM) to clang-cc; this got lost in
translation, the former we support, the later we don't (yet).

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

15 years agoUpdate TestRunner.sh for renaming.
Daniel Dunbar [Tue, 24 Mar 2009 06:17:45 +0000 (06:17 +0000)]
Update TestRunner.sh for renaming.
 - Substitutes both clang and clang-cc.

 - Incorporates patch from Jon Simons to diagnose if clang or clang-cc
   isn't found.

 - Uses full path when running scripts, for more precision in the
   output.

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

15 years agoMore path updates with clang-cc...
Ted Kremenek [Tue, 24 Mar 2009 05:30:14 +0000 (05:30 +0000)]
More path updates with clang-cc...

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

15 years agoUpdate scan-build/ccc-analyzer to use 'clang-cc' instead of 'clang'.
Ted Kremenek [Tue, 24 Mar 2009 04:29:13 +0000 (04:29 +0000)]
Update scan-build/ccc-analyzer to use 'clang-cc' instead of 'clang'.

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

15 years agoInstall clang-cc to libexec/clang-cc (instead of bin/clang-cc).
Daniel Dunbar [Tue, 24 Mar 2009 04:07:10 +0000 (04:07 +0000)]
Install clang-cc to libexec/clang-cc (instead of bin/clang-cc).
 - Updated ccc & driver to look in libexec/ for tools.

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

15 years agoRename clang-driver to clang.
Daniel Dunbar [Tue, 24 Mar 2009 03:07:05 +0000 (03:07 +0000)]
Rename clang-driver to clang.

Again, I tried to update cmake but it is untested.

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

15 years agoMove <root>/Driver into <root>/tools/clang-cc.
Daniel Dunbar [Tue, 24 Mar 2009 03:00:12 +0000 (03:00 +0000)]
Move <root>/Driver into <root>/tools/clang-cc.

Again, I tried to update cmake but it is untested.

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

15 years agoAdd CMake files for tools/driver; I am just guessing here, can someone test/fix?
Daniel Dunbar [Tue, 24 Mar 2009 02:52:57 +0000 (02:52 +0000)]
Add CMake files for tools/driver; I am just guessing here, can someone test/fix?

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

15 years agoSupport member reference on ?: of struct type.
Daniel Dunbar [Tue, 24 Mar 2009 02:38:23 +0000 (02:38 +0000)]
Support member reference on ?: of struct type.

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

15 years agoRename clang to clang-cc.
Daniel Dunbar [Tue, 24 Mar 2009 02:24:46 +0000 (02:24 +0000)]
Rename clang to clang-cc.

Tests and drivers updated, still need to shuffle dirs.

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

15 years agoUse not instead of ! in tests.
Daniel Dunbar [Tue, 24 Mar 2009 01:59:55 +0000 (01:59 +0000)]
Use not instead of ! in tests.

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

15 years agoHandle pointers to arrays of abstract types.
Anders Carlsson [Tue, 24 Mar 2009 01:46:45 +0000 (01:46 +0000)]
Handle pointers to arrays of abstract types.

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

15 years agoRemove a task that's completed now.
Anders Carlsson [Tue, 24 Mar 2009 01:25:56 +0000 (01:25 +0000)]
Remove a task that's completed now.

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

15 years agoclass.abstract is complete. Anything that doesn't work is a bug.
Anders Carlsson [Tue, 24 Mar 2009 01:24:06 +0000 (01:24 +0000)]
class.abstract is complete. Anything that doesn't work is a bug.

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

15 years agoMore work on diagnosing abstract classes. We can now handle cases like
Anders Carlsson [Tue, 24 Mar 2009 01:19:16 +0000 (01:19 +0000)]
More work on diagnosing abstract classes. We can now handle cases like

class C {
  void g(C c);

  virtual void f() = 0;
};

In this case, C is not known to be abstract when doing semantic analysis on g. This is done by recursively traversing the abstract class and checking the types of member functions.

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

15 years agoFix PR3868 by making Evaluate handle cases like "(long)&a + 4".
Eli Friedman [Tue, 24 Mar 2009 01:14:50 +0000 (01:14 +0000)]
Fix PR3868 by making Evaluate handle cases like "(long)&a + 4".

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

15 years agoFix a couple of tests.
Eli Friedman [Tue, 24 Mar 2009 01:11:18 +0000 (01:11 +0000)]
Fix a couple of tests.

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

15 years agoccc: Have generic GCC tool chain search the driver directory for
Daniel Dunbar [Tue, 24 Mar 2009 01:06:18 +0000 (01:06 +0000)]
ccc: Have generic GCC tool chain search the driver directory for
executables (e.g., clang).
 - This matches the clang-driver behavior.

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

15 years agoCleanup template instantiation for methods, destructors
Douglas Gregor [Tue, 24 Mar 2009 00:38:23 +0000 (00:38 +0000)]
Cleanup template instantiation for methods, destructors

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

15 years agoUpdate checker build.
Ted Kremenek [Tue, 24 Mar 2009 00:35:59 +0000 (00:35 +0000)]
Update checker build.

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

15 years agoDriver: lipo wasn't being called correctly (translation failure from
Daniel Dunbar [Tue, 24 Mar 2009 00:24:37 +0000 (00:24 +0000)]
Driver: lipo wasn't being called correctly (translation failure from
ccc due to the different way we handle output arguments).

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

15 years agoccc/Driver: -r option doesn't take an argument.
Daniel Dunbar [Tue, 24 Mar 2009 00:20:13 +0000 (00:20 +0000)]
ccc/Driver: -r option doesn't take an argument.

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

15 years agoTemplate instantiation for destructors. This is somewhat repetitive;
Douglas Gregor [Tue, 24 Mar 2009 00:15:49 +0000 (00:15 +0000)]
Template instantiation for destructors. This is somewhat repetitive;
eliminating the duplication is next on the list.

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

15 years agoFix the ABI convention for struct returns on x86 outside of Darwin.
Eli Friedman [Mon, 23 Mar 2009 23:26:24 +0000 (23:26 +0000)]
Fix the ABI convention for struct returns on x86 outside of Darwin.

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

15 years agoAnother use of adjustParameterType. Plus, GetTypeForDeclarator will
Douglas Gregor [Mon, 23 Mar 2009 23:17:00 +0000 (23:17 +0000)]
Another use of adjustParameterType. Plus, GetTypeForDeclarator will
always get ParmVarDecls with already-adjusted types. Assert it.

Thanks, Anders!

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

15 years agoTemplate instantiation for the declarations of member functions within
Douglas Gregor [Mon, 23 Mar 2009 23:06:20 +0000 (23:06 +0000)]
Template instantiation for the declarations of member functions within
a class template. At present, we can only instantiation normal
methods, but not constructors, destructors, or conversion operators.

As ever, this contains a bit of refactoring in Sema's type-checking. In
particular:

  - Split ActOnFunctionDeclarator into ActOnFunctionDeclarator
    (handling the declarator itself) and CheckFunctionDeclaration
    (checking for the the function declaration), the latter of which
    is also used by template instantiation.
  - We were performing the adjustment of function parameter types in
    three places; collect those into a single new routine.
  - When the type of a parameter is adjusted, allocate an
    OriginalParmVarDecl to keep track of the type as it was written.
  - Eliminate a redundant check for out-of-line declarations of member
    functions; hide more C++-specific checks on function declarations
    behind if(getLangOptions().CPlusPlus).

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

15 years agoDeallocate 'DeclRefExpr's in correctly formed '#pragma unused'
Ted Kremenek [Mon, 23 Mar 2009 22:50:47 +0000 (22:50 +0000)]
Deallocate 'DeclRefExpr's in correctly formed '#pragma unused'

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

15 years agoA test case to test that -warn-dead-stores does not emit a warning for stores to...
Ted Kremenek [Mon, 23 Mar 2009 22:30:58 +0000 (22:30 +0000)]
A test case to test that -warn-dead-stores does not emit a warning for stores to variables marked with '#pragma unused'.

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

15 years agoImplement '#pragma unused'.
Ted Kremenek [Mon, 23 Mar 2009 22:28:25 +0000 (22:28 +0000)]
Implement '#pragma unused'.

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

15 years agoDriver: Make argument parsing fast.
Daniel Dunbar [Mon, 23 Mar 2009 21:50:40 +0000 (21:50 +0000)]
Driver: Make argument parsing fast.

On a synthetic command line consisting of almost all defined options,
this drops wall time from .00494 to .00336 and user time from .00258
to .00105.

On the same benchmark, clang-driver is about 15% faster than the
primary gcc driver and almost twice as fast as the gcc driver driver.

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

15 years agoAdd SemaTypeInstantiateDecl.cpp
Anders Carlsson [Mon, 23 Mar 2009 20:47:43 +0000 (20:47 +0000)]
Add SemaTypeInstantiateDecl.cpp

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

15 years agoUpdate checker build.
Ted Kremenek [Mon, 23 Mar 2009 19:53:30 +0000 (19:53 +0000)]
Update checker build.

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

15 years agoDriver: Fix off by one in computation of first searchable option.
Daniel Dunbar [Mon, 23 Mar 2009 19:19:19 +0000 (19:19 +0000)]
Driver: Fix off by one in computation of first searchable option.

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

15 years agoMust allow for strong cast of floats as well (objc2 gc).
Fariborz Jahanian [Mon, 23 Mar 2009 19:10:40 +0000 (19:10 +0000)]
Must allow for strong cast of floats as well (objc2 gc).

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

15 years agoMore improvements to abstract type checking. Handle arrays correctly, and make sure...
Anders Carlsson [Mon, 23 Mar 2009 19:10:31 +0000 (19:10 +0000)]
More improvements to abstract type checking. Handle arrays correctly, and make sure to check parameter types before they decay.

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

15 years agoDriver: Add two special groups of "whitelisted" options which we know
Daniel Dunbar [Mon, 23 Mar 2009 19:03:36 +0000 (19:03 +0000)]
Driver: Add two special groups of "whitelisted" options which we know
clang doesn't support, and don't want to warn are unused. Eventually
these should disappear.

Here is a more readable list than is in the diff:

W options: -Wall, -Wcast-align, -Wchar-align, -Wchar-subscripts,
-Werror, -Wextra, -Winline, -Wint-to-pointer-cast, -Wmissing-braces,
-Wmost, -Wnested-externs, -Wno-format-y2k, -Wno-four-char-constants,
-Wno-missing-field-initializers, -Wno-trigraphs, -Wno-unknown-pragmas,
-Wno-unused-parameter, -Wparentheses, -Wpointer-arith,
-Wpointer-to-int-cast, -Wreturn-type, -Wshorten-64-to-32, -Wswitch,
-Wunused-function, -Wunused-label, -Wunused-value, -Wunused-variable,
-Wwrite-strings.

f options: -fasm-blocks, -fmessage-length=.

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