]> granicus.if.org Git - clang/log
clang
15 years agoSimplify CXXScopeSpec a lot. No more weird SmallVector-like hacks here
Douglas Gregor [Thu, 26 Mar 2009 23:56:24 +0000 (23:56 +0000)]
Simplify CXXScopeSpec a lot. No more weird SmallVector-like hacks here

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

15 years agoRevamp our representation of C++ nested-name-specifiers. We now have a
Douglas Gregor [Thu, 26 Mar 2009 23:50:42 +0000 (23:50 +0000)]
Revamp our representation of C++ nested-name-specifiers. We now have a
uniqued representation that should both save some memory and make it
far easier to properly build canonical types for types involving
dependent nested-name-specifiers, e.g., "typename T::Nested::type".

This approach will greatly simplify the representation of
CXXScopeSpec. That'll be next.

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

15 years agoI said _fix_ the build, don't break it.
Anders Carlsson [Thu, 26 Mar 2009 23:48:49 +0000 (23:48 +0000)]
I said _fix_ the build, don't break it.

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

15 years agoFix build.
Anders Carlsson [Thu, 26 Mar 2009 23:47:48 +0000 (23:47 +0000)]
Fix build.

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

15 years agoAdd
Anders Carlsson [Thu, 26 Mar 2009 23:46:50 +0000 (23:46 +0000)]
Add

const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB,
                                    AccessSpecifier AS);

so we can easily add access specifiers to diagnostics.

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

15 years ago- Add class PathDiagosticLocationPair.
Ted Kremenek [Thu, 26 Mar 2009 23:12:02 +0000 (23:12 +0000)]
- Add class PathDiagosticLocationPair.
- Have PathDiagnosticControlFlowPiece use a vector of PathDiagnosticLocationPairs to represent transitions.

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

15 years agoImplement PathDiagnosticLocation::asRange() and PathDiagnosticLocation::asStmt().
Ted Kremenek [Thu, 26 Mar 2009 21:48:17 +0000 (21:48 +0000)]
Implement PathDiagnosticLocation::asRange() and PathDiagnosticLocation::asStmt().

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

15 years agoAdd comment.
Ted Kremenek [Thu, 26 Mar 2009 21:42:51 +0000 (21:42 +0000)]
Add comment.

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

15 years agoRestructure code to silence bogus GCC warning.
Ted Kremenek [Thu, 26 Mar 2009 21:42:00 +0000 (21:42 +0000)]
Restructure code to silence bogus GCC warning.

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

15 years ago- Implement PathDiagnosticLocation::asLocation.
Ted Kremenek [Thu, 26 Mar 2009 21:39:39 +0000 (21:39 +0000)]
- Implement PathDiagnosticLocation::asLocation.
- Switch PathDiagnosticEventPiece and PathDiagnosticMacroPiece to use
  PathDiagnosticLocation.

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

15 years agoBecause of the use of 'cast<TagDecl>', ASTContext.h now depends on Decl.h.
Ted Kremenek [Thu, 26 Mar 2009 21:36:37 +0000 (21:36 +0000)]
Because of the use of 'cast<TagDecl>', ASTContext.h now depends on Decl.h.

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

15 years agoRemove dead code.
Mike Stump [Thu, 26 Mar 2009 21:25:00 +0000 (21:25 +0000)]
Remove dead code.

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

15 years agoPathDiagnostics (analyzer):
Ted Kremenek [Thu, 26 Mar 2009 21:21:35 +0000 (21:21 +0000)]
PathDiagnostics (analyzer):
- Added a new class, 'PathDiagnosticLocation', that is a variant for
  SourceLocation, SourceRange, or Stmt*. This will be used soon by
  PathDiagnosticPieces to describe locations for targets of branches, locations
  of events, etc.
- Did some prep. refactoring of PathDiagnosticPieces to prepare them for
  adopting the new PathDiagnosticLocation

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

15 years ago- Minor change to dump of ivar layout map.
Fariborz Jahanian [Thu, 26 Mar 2009 19:10:36 +0000 (19:10 +0000)]
- Minor change to dump of ivar layout map.
- Temporarily undef'ed __OBJC2__ in nonfragile objc abi mode
  as it was forcing ivar synthesis in a certain project which clang
  does not yet support.

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

15 years agoDriver: Forward -fno-common to clang.
Daniel Dunbar [Thu, 26 Mar 2009 16:37:00 +0000 (16:37 +0000)]
Driver: Forward -fno-common to clang.
 - <rdar://problem/6710978> ccc/clang-driver ignore -fno-common

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

15 years agoDriver: Test case for darwin::Link
Daniel Dunbar [Thu, 26 Mar 2009 16:29:05 +0000 (16:29 +0000)]
Driver: Test case for darwin::Link

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

15 years agoDriver: Add darwin::Link tool.
Daniel Dunbar [Thu, 26 Mar 2009 16:23:12 +0000 (16:23 +0000)]
Driver: Add darwin::Link tool.
 - <rdar://problem/6717381> [driver] implement ld argument translation
   in new driver

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

15 years agoAdd a high-level intro to the memory regions design document.
Ted Kremenek [Thu, 26 Mar 2009 16:19:54 +0000 (16:19 +0000)]
Add a high-level intro to the memory regions design document.

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

15 years agoDriver: Fix a number of option definition mismatches (flags instead of
Daniel Dunbar [Thu, 26 Mar 2009 16:12:09 +0000 (16:12 +0000)]
Driver: Fix a number of option definition mismatches (flags instead of
separate, or vice versa).

Also, fix initialization of LinkingOutput variable.

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

15 years agoDriver: Print the correct target when printing the version.
Daniel Dunbar [Thu, 26 Mar 2009 16:09:13 +0000 (16:09 +0000)]
Driver: Print the correct target when printing the version.

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

15 years agoFix <rdar://problem/6697053> instance variable is protected.
Steve Naroff [Thu, 26 Mar 2009 16:01:08 +0000 (16:01 +0000)]
Fix <rdar://problem/6697053> instance variable is protected.

Treat @package the same as @public. The documentation for @package says it is analogous to private_extern for variables/functions. Fully implementing this requires some kind of linker support (so access is denied to code outside the classes executable image). I don't believe GCC fully implements this semantic. Will discuss with Fariborz offline.

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

15 years agoDriver: Move GetReleaseVersion to static Driver::GetReleaseVersion method.
Daniel Dunbar [Thu, 26 Mar 2009 15:58:36 +0000 (15:58 +0000)]
Driver: Move GetReleaseVersion to static Driver::GetReleaseVersion method.

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

15 years agoDriver: Add ArgList::AddAllArgsTranslated; for forwarding options to
Daniel Dunbar [Thu, 26 Mar 2009 15:39:22 +0000 (15:39 +0000)]
Driver: Add ArgList::AddAllArgsTranslated; for forwarding options to
tools with the name of the option replace, and arguments rendered
separately.

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

15 years agoMove "regions" analyzer design document to 'docs'.
Ted Kremenek [Thu, 26 Mar 2009 15:29:38 +0000 (15:29 +0000)]
Move "regions" analyzer design document to 'docs'.

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

15 years agoSimplify some code. No functionality change.
Zhongxing Xu [Thu, 26 Mar 2009 08:40:37 +0000 (08:40 +0000)]
Simplify some code. No functionality change.

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

15 years agoCheck in some design documents to centralize ideas around region store and the
Zhongxing Xu [Thu, 26 Mar 2009 08:23:58 +0000 (08:23 +0000)]
Check in some design documents to centralize ideas around region store and the
analysis engine.

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

15 years agoSanity-check argument to indirect goto.
Eli Friedman [Thu, 26 Mar 2009 07:32:37 +0000 (07:32 +0000)]
Sanity-check argument to indirect goto.

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

15 years agohopefully fix VC++ build error.
Chris Lattner [Thu, 26 Mar 2009 05:56:24 +0000 (05:56 +0000)]
hopefully fix VC++ build error.

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

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