]> granicus.if.org Git - clang/log
clang
15 years agominor cleanups: make getIdentifierNamespace() be a single load
Chris Lattner [Fri, 27 Mar 2009 20:18:19 +0000 (20:18 +0000)]
minor cleanups: make getIdentifierNamespace() be a single load
instead of a load + large inlined switch.

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

15 years agoFixup -fcommon and -fno-common to be more gcc compatible.
Mike Stump [Fri, 27 Mar 2009 20:15:22 +0000 (20:15 +0000)]
Fixup -fcommon and -fno-common to be more gcc compatible.

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

15 years agoreduce # const_casts, no functionality change.
Chris Lattner [Fri, 27 Mar 2009 19:19:59 +0000 (19:19 +0000)]
reduce # const_casts, no functionality change.

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

15 years agoIt is OK to cast to a private base class if the current member belongs to the class...
Anders Carlsson [Fri, 27 Mar 2009 19:01:12 +0000 (19:01 +0000)]
It is OK to cast to a private base class if the current member belongs to the class that the private base class is a base of:

class A {};
class B : private A {
  void f(B *b) { A* a = b; }
};

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

15 years agoAdd a Class field to the base path element structure. This holds the record decl...
Anders Carlsson [Fri, 27 Mar 2009 18:54:29 +0000 (18:54 +0000)]
Add a Class field to the base path element structure. This holds the record decl of the class taht the base is a base of.

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

15 years agochange Decl::DeclCtx to use a PointerIntPair instead of hand bitmangling.
Chris Lattner [Fri, 27 Mar 2009 18:46:15 +0000 (18:46 +0000)]
change Decl::DeclCtx to use a PointerIntPair instead of hand bitmangling.

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

15 years agoBesides the warning, issue unsupported diagnostics in
Fariborz Jahanian [Fri, 27 Mar 2009 18:38:55 +0000 (18:38 +0000)]
Besides the warning, issue unsupported diagnostics in
ir gen. No intended change in functionality.

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

15 years agopush line markers through -E mode.
Chris Lattner [Fri, 27 Mar 2009 17:13:49 +0000 (17:13 +0000)]
push line markers through -E mode.

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

15 years agoUpdate "Getting Started" with more current information about 'clang-cc' and 'clang'.
Ted Kremenek [Fri, 27 Mar 2009 16:32:57 +0000 (16:32 +0000)]
Update "Getting Started" with more current information about 'clang-cc' and 'clang'.

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

15 years agoanalyzer plist: For PathDiagnosticControlFlowPieces, now output an array of
Ted Kremenek [Fri, 27 Mar 2009 15:53:20 +0000 (15:53 +0000)]
analyzer plist: For PathDiagnosticControlFlowPieces, now output an array of
start-end points, where start and end are source ranges.

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

15 years agoEmit aggregate "location" for PathDiagnostic to plist. This fixes <rdar://problem...
Ted Kremenek [Fri, 27 Mar 2009 15:31:11 +0000 (15:31 +0000)]
Emit aggregate "location" for PathDiagnostic to plist.  This fixes <rdar://problem/6729558>.

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

15 years agoMove declaration of 'PathDiagnostic' to the end of PathDiagnostic.h and add PathDiagn...
Ted Kremenek [Fri, 27 Mar 2009 15:24:36 +0000 (15:24 +0000)]
Move declaration of 'PathDiagnostic' to the end of PathDiagnostic.h and add PathDiagnostic::getLocation().

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

15 years agoDriver: Pass -f[no-]pascal-strings on to clang, even if it has been
Daniel Dunbar [Fri, 27 Mar 2009 15:22:28 +0000 (15:22 +0000)]
Driver: Pass -f[no-]pascal-strings on to clang, even if it has been
turned into -m[no-]pascal-strings by the tool chain.
 - This still has issue that derived arguments don't propogate "used"
   information correctly so spurious "argument unused" warnings will
   still show up.

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

15 years agoPathDiagnostic: replace 'std::list' with 'std::deque'
Ted Kremenek [Fri, 27 Mar 2009 14:59:04 +0000 (14:59 +0000)]
PathDiagnostic: replace 'std::list' with 'std::deque'

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

15 years agoAdd iterators to PathDiagnosticControlFlowDiagnostic for iterating over the
Ted Kremenek [Fri, 27 Mar 2009 14:54:49 +0000 (14:54 +0000)]
Add iterators to PathDiagnosticControlFlowDiagnostic for iterating over the
multiple location vectors.

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

15 years agoDriver: -print-libgcc-file-name was searching wrong path list.
Daniel Dunbar [Fri, 27 Mar 2009 14:26:33 +0000 (14:26 +0000)]
Driver: -print-libgcc-file-name was searching wrong path list.

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

15 years agoImplement checking for base class access. Right now it's overly conservative but...
Anders Carlsson [Fri, 27 Mar 2009 06:03:27 +0000 (06:03 +0000)]
Implement checking for base class access. Right now it's overly conservative but that will change. (Also, protected isn't implemented right now).

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

15 years agoIf the user is trying to apply the -> or . member reference operator
Douglas Gregor [Fri, 27 Mar 2009 06:00:30 +0000 (06:00 +0000)]
If the user is trying to apply the -> or . member reference operator
to a function or function pointer, it's probably because the user
forgot to put in parentheses () to call the function.

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

15 years agoremove dead code.
Zhongxing Xu [Fri, 27 Mar 2009 05:31:12 +0000 (05:31 +0000)]
remove dead code.

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

15 years agoUpdate CMake
Douglas Gregor [Fri, 27 Mar 2009 05:18:33 +0000 (05:18 +0000)]
Update CMake

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

15 years agoRemove the code insertion hint for implicit int. Too often, we're wrong about this...
Douglas Gregor [Fri, 27 Mar 2009 05:10:56 +0000 (05:10 +0000)]
Remove the code insertion hint for implicit int. Too often, we're wrong about this hint, so it loses its usefulness. Maybe some day we can make the hint smart enough to be useful.

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

15 years agoBugReporter:
Ted Kremenek [Fri, 27 Mar 2009 05:06:10 +0000 (05:06 +0000)]
BugReporter:
- Added an internal helper class 'PathDiagnosticBuilder' which now bundles the
  'ExecutionContinues' methods.
- Added preliminary diagnostics for short-circuit '&&' and '||'

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

15 years agoAdd a stubbed out CheckBaseClassAccess method.
Anders Carlsson [Fri, 27 Mar 2009 05:05:05 +0000 (05:05 +0000)]
Add a stubbed out CheckBaseClassAccess method.

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

15 years agoMove Sema::SetMemberAccessSpecifier to SemaAccess.cpp
Anders Carlsson [Fri, 27 Mar 2009 04:54:36 +0000 (04:54 +0000)]
Move Sema::SetMemberAccessSpecifier to SemaAccess.cpp

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

15 years agoAdd SemaAccess.cpp
Anders Carlsson [Fri, 27 Mar 2009 04:43:36 +0000 (04:43 +0000)]
Add SemaAccess.cpp

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

15 years agoImprove recovery when a constructor fails to type-check. Test case from Anders
Douglas Gregor [Fri, 27 Mar 2009 04:38:56 +0000 (04:38 +0000)]
Improve recovery when a constructor fails to type-check. Test case from Anders

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

15 years agoTests and fixes for templates declared within (non-template)
Douglas Gregor [Fri, 27 Mar 2009 04:21:56 +0000 (04:21 +0000)]
Tests and fixes for templates declared within (non-template)
classes. Test case from Anders Carlsson, fix from Piotr Rak!

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

15 years agoFix rdar://6719156 - clang should emit a better error when blocks are disabled but...
Chris Lattner [Fri, 27 Mar 2009 04:18:06 +0000 (04:18 +0000)]
Fix rdar://6719156 - clang should emit a better error when blocks are disabled but are used anyway
by changing blocks from being disabled in the parser to being disabled
in Sema.

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

15 years agoremove the updated notes.
Zhongxing Xu [Fri, 27 Mar 2009 02:22:41 +0000 (02:22 +0000)]
remove the updated notes.

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

15 years ago- Fix thinko in implementation of PathDiagnosticLocation::asStmt(). Thanks to
Ted Kremenek [Fri, 27 Mar 2009 02:22:03 +0000 (02:22 +0000)]
- Fix thinko in implementation of PathDiagnosticLocation::asStmt(). Thanks to
  Anders Johnsen for pointing this out.
- Have PathDiagnosticControlFlowPiece take PathDiagnosticLocation for the
  arguments to its constructors.

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

15 years agoFix searching for gcc, we only want executable files.
Mike Stump [Fri, 27 Mar 2009 00:40:20 +0000 (00:40 +0000)]
Fix searching for gcc, we only want executable files.

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

15 years agoClarify that QualifiedNameType is sugar-only. This will matter once we can parse...
Douglas Gregor [Fri, 27 Mar 2009 00:03:43 +0000 (00:03 +0000)]
Clarify that QualifiedNameType is sugar-only. This will matter once we can parse typename-specifiers

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

15 years agoPut back __OBJC2__ definition.
Fariborz Jahanian [Thu, 26 Mar 2009 23:57:56 +0000 (23:57 +0000)]
Put back __OBJC2__ definition.

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

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