]> granicus.if.org Git - clang/log
clang
15 years agoDon't print canonical types in overloading-related diagnostics
Douglas Gregor [Fri, 21 Nov 2008 02:54:28 +0000 (02:54 +0000)]
Don't print canonical types in overloading-related diagnostics

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

15 years agoChange -verify mode to find the "expected-error" and "expected-warning" strings
Chris Lattner [Fri, 21 Nov 2008 01:18:36 +0000 (01:18 +0000)]
Change -verify mode to find the "expected-error" and "expected-warning" strings
with a raw lexer instead of a PP lexer.  This means that -verify doesn't scan
#include'd headers for expected-error/warning strings, and it also means that it
doesn't ignore them in #if 0.

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

15 years agoAdd comment to IsFileLexer, clean up indentation, and tighten how it's written.
Ted Kremenek [Fri, 21 Nov 2008 01:07:52 +0000 (01:07 +0000)]
Add comment to IsFileLexer, clean up indentation, and tighten how it's written.

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

15 years agoremove expected-error from #if 0 section of code.
Chris Lattner [Fri, 21 Nov 2008 01:05:35 +0000 (01:05 +0000)]
remove expected-error from #if 0 section of code.

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

15 years agodisable expected-errors in #if parts of the test.
Chris Lattner [Fri, 21 Nov 2008 01:05:04 +0000 (01:05 +0000)]
disable expected-errors in #if parts of the test.

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

15 years agosplit into two tests.
Chris Lattner [Fri, 21 Nov 2008 01:04:13 +0000 (01:04 +0000)]
split into two tests.

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

15 years agoPTHLexer:
Ted Kremenek [Fri, 21 Nov 2008 00:58:35 +0000 (00:58 +0000)]
PTHLexer:
- Move out logic for handling the end-of-file to LexEndOfFile (to match the Lexer) class.  The logic now mirrors the Lexer class more, which allows us to pass most of the Preprocessor test cases.

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

15 years agoConsolidated @try and @synchronize into a single
Fariborz Jahanian [Fri, 21 Nov 2008 00:49:24 +0000 (00:49 +0000)]
Consolidated @try and @synchronize into a single
code gen. method.

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

15 years agoAdd checker test case: warn about returning an uninitialized value to the caller.
Ted Kremenek [Fri, 21 Nov 2008 00:28:47 +0000 (00:28 +0000)]
Add checker test case: warn about returning an uninitialized value to the caller.

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

15 years ago- Clean up transfer function logic for 'return' statements.
Ted Kremenek [Fri, 21 Nov 2008 00:27:44 +0000 (00:27 +0000)]
- Clean up transfer function logic for 'return' statements.
- Add check for returning an undefined value to a caller.

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

15 years agoEnable test file for 'region store' in addition to basic store.
Ted Kremenek [Fri, 21 Nov 2008 00:15:15 +0000 (00:15 +0000)]
Enable test file for 'region store' in addition to basic store.

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

15 years agoSupport generation of objc_assign_ivar for ivar
Fariborz Jahanian [Thu, 20 Nov 2008 20:53:20 +0000 (20:53 +0000)]
Support generation of objc_assign_ivar for ivar
write-barriers.

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

15 years agoPTHLexer:
Ted Kremenek [Thu, 20 Nov 2008 19:49:00 +0000 (19:49 +0000)]
PTHLexer:
- Move PTHLexer::GetToken() to be inside PTHLexer.cpp.
- When lexing in raw mode, null out identifiers.

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

15 years ago__weak ivar need not warn.
Fariborz Jahanian [Thu, 20 Nov 2008 19:35:51 +0000 (19:35 +0000)]
__weak ivar need not warn.

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

15 years agoIntroducing objc_assign_ivar to clang.
Fariborz Jahanian [Thu, 20 Nov 2008 19:23:36 +0000 (19:23 +0000)]
Introducing objc_assign_ivar to clang.

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

15 years agoAdded a test case for __weak field decls. Change SetVarDeclObjCAttribute
Fariborz Jahanian [Thu, 20 Nov 2008 18:10:58 +0000 (18:10 +0000)]
Added a test case for __weak field decls. Change SetVarDeclObjCAttribute
to static function. Added comments.

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

15 years agoHandle another case where we should use PTHLexer as an alternative to the normal...
Ted Kremenek [Thu, 20 Nov 2008 16:46:54 +0000 (16:46 +0000)]
Handle another case where we should use PTHLexer as an alternative to the normal Lexer.

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

15 years agoUpdate C++ status
Douglas Gregor [Thu, 20 Nov 2008 16:46:32 +0000 (16:46 +0000)]
Update C++ status

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

15 years agoPTHLexer:
Ted Kremenek [Thu, 20 Nov 2008 16:32:22 +0000 (16:32 +0000)]
PTHLexer:
- Rename 'CurToken' and 'LastToken' to 'CurTokenIdx' and 'LastTokenIdx'
  respectively.
- Add helper methods GetToken(), AdvanceToken(), AtLastToken() to abstract away
  details of the token stream. This also allows us to easily replace their
  implementation later.

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

15 years agoAdd support for overloaded operator-> when used in a member access
Douglas Gregor [Thu, 20 Nov 2008 16:27:02 +0000 (16:27 +0000)]
Add support for overloaded operator-> when used in a member access
expression (smart_ptr->mem).

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

15 years agoRename IsNonPragmaNonMacroLexer to IsFileLexer.
Ted Kremenek [Thu, 20 Nov 2008 16:19:53 +0000 (16:19 +0000)]
Rename IsNonPragmaNonMacroLexer to IsFileLexer.

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

15 years agoOutput 'ANALYZE' messages to standard error. This should address the intermixing...
Ted Kremenek [Thu, 20 Nov 2008 16:14:48 +0000 (16:14 +0000)]
Output 'ANALYZE' messages to standard error.  This should address the intermixing of 'ANALYZE' and the other diagnostics the clang driver emits to standard error.

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

15 years agoFix strange quote characters
Douglas Gregor [Thu, 20 Nov 2008 13:33:37 +0000 (13:33 +0000)]
Fix strange quote characters

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

15 years agoDe-unionize fields in Token class.
Daniel Dunbar [Thu, 20 Nov 2008 08:01:39 +0000 (08:01 +0000)]
De-unionize fields in Token class.
 - This is fairly gross but although the code is conceptually the
   same, introducting the union causes gcc 4.2 on x86 (darwin, if that
   matters) to pessimize LexTokenInternal which is critical to our
   preprocessor performance.

This speeds up -Eonly lexing of Cocoa.h by ~4.7% in my timings and
reduces the code size of LexTokenInternal by 8.6%.

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

15 years agoRewrote PTHLexer::Lex by digging through the sources of Lexer again. Now we can...
Ted Kremenek [Thu, 20 Nov 2008 07:58:05 +0000 (07:58 +0000)]
Rewrote PTHLexer::Lex by digging through the sources of Lexer again.  Now we can do basic macro expansion using the PTHLexer.

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

15 years agoAdd ugly "test harness" for PTHLexer that is not enabled by default. The
Ted Kremenek [Thu, 20 Nov 2008 07:56:33 +0000 (07:56 +0000)]
Add ugly "test harness" for PTHLexer that is not enabled by default. The
(temporary hack) to test the PTHLexer is that whenever we would create a Lexer
object we instead raw lex a memory buffer first and then use the PTHLexer. This
logic exists only to driver the PTHLexer and will be removed/changed in the
future. Note that the regular path using normal Lexer objects is what is used by
default.

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

15 years agoAdded virtual method 'IndirectLex' to PTHLexer. This will likely get removed in...
Ted Kremenek [Thu, 20 Nov 2008 07:54:06 +0000 (07:54 +0000)]
Added virtual method 'IndirectLex' to PTHLexer.  This will likely get removed in the future when we correctly handle #include processing.

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

15 years agoPreprocessor::isCurrentLexer() now takes a PreprocessorLexer* argument to match again...
Ted Kremenek [Thu, 20 Nov 2008 07:53:31 +0000 (07:53 +0000)]
Preprocessor::isCurrentLexer() now takes a PreprocessorLexer* argument to match against CurPPLexer instead of CurLexer.

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

15 years agoDaniel really really likes = instead of += :)
Chris Lattner [Thu, 20 Nov 2008 07:09:32 +0000 (07:09 +0000)]
Daniel really really likes = instead of += :)

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

15 years agoremove the last old-fashioned Diag method. Transition complete!
Chris Lattner [Thu, 20 Nov 2008 06:38:18 +0000 (06:38 +0000)]
remove the last old-fashioned Diag method.  Transition complete!

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

15 years agoremove another old Diag method.
Chris Lattner [Thu, 20 Nov 2008 06:13:02 +0000 (06:13 +0000)]
remove another old Diag method.

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

15 years agoremove another old-school Diag method.
Chris Lattner [Thu, 20 Nov 2008 06:06:08 +0000 (06:06 +0000)]
remove another old-school Diag method.

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

15 years agoremove the type_info identifier cache. Compared to the cost
Chris Lattner [Thu, 20 Nov 2008 05:51:55 +0000 (05:51 +0000)]
remove the type_info identifier cache.  Compared to the cost
of doing the lookup_decl, the hash lookup is cheap.  Also,
typeid doesn't happen enough in real world code to worry about
it.

I'd like to eventually get rid of KnownFunctionIDs from Sema
also, but today is not that day.

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

15 years agocompared to the rest of the code in Sema::GetStdNamespace(),
Chris Lattner [Thu, 20 Nov 2008 05:45:14 +0000 (05:45 +0000)]
compared to the rest of the code in Sema::GetStdNamespace(),
looking up the "std" identifier is trivial.  Just do it, particularly
since this is only done if the namespace hasn't already been looked up.

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

15 years agoremove some other identifiers that are looked up really early and only
Chris Lattner [Thu, 20 Nov 2008 05:41:43 +0000 (05:41 +0000)]
remove some other identifiers that are looked up really early and only
used in one cold place.

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

15 years agoinstead of looking up super at startup time,
Chris Lattner [Thu, 20 Nov 2008 05:35:30 +0000 (05:35 +0000)]
instead of looking up super at startup time,
just check for it when needed.  It doesn't incur real cost
in any hot paths.

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

15 years agoRename IdentifierInfo::isName to ::isStr. Use a nifty trick
Chris Lattner [Thu, 20 Nov 2008 04:42:34 +0000 (04:42 +0000)]
Rename IdentifierInfo::isName to ::isStr.  Use a nifty trick
from Sebastian to enforce that a literal string is passed in,
and use this to avoid having to call strlen on it.

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

15 years agoMake FIXME a hard assertion.
Ted Kremenek [Thu, 20 Nov 2008 01:52:55 +0000 (01:52 +0000)]
Make FIXME a hard assertion.

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

15 years agoPreprocessor::getCurrentFileLexer() now returns a PreprocessorLexer* instead of
Ted Kremenek [Thu, 20 Nov 2008 01:49:44 +0000 (01:49 +0000)]
Preprocessor::getCurrentFileLexer() now returns a PreprocessorLexer* instead of
a Lexer*. This means it will either return the current (normal) file Lexer or a
PTHLexer.

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

15 years agoJust use the SourceLocation of SysHeaderTok when doing a callback to emit #line
Ted Kremenek [Thu, 20 Nov 2008 01:45:11 +0000 (01:45 +0000)]
Just use the SourceLocation of SysHeaderTok when doing a callback to emit #line
information. A diff of the -E output for Cocoa.h shows that there is no change
in output.

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

15 years agoAssign the result of getCurrentFileLexer() to a PreprocessorLexer* instead of Lexer...
Ted Kremenek [Thu, 20 Nov 2008 01:35:24 +0000 (01:35 +0000)]
Assign the result of getCurrentFileLexer() to a PreprocessorLexer* instead of Lexer* (narrower interface).

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

15 years ago- Default initialize ParsingPreprocessorDirective, ParsingFilename, and
Ted Kremenek [Thu, 20 Nov 2008 01:29:45 +0000 (01:29 +0000)]
- Default initialize ParsingPreprocessorDirective, ParsingFilename, and
  LexingRawMode in the ctor of PreprocessorLexer.

- PTHLexer: Use "LastToken" instead of "NumToken"

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

15 years agoAdd (untested) implementation of PTHLexer::isNextPPTokenLParen() and PTHLexer::Discar...
Ted Kremenek [Thu, 20 Nov 2008 01:16:50 +0000 (01:16 +0000)]
Add (untested) implementation of PTHLexer::isNextPPTokenLParen() and PTHLexer::DiscardToEndOfLine().

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

15 years agoUse ScheduleDAGSDNodes.h instead of ScheduleDAG.h (stuff moved around).
Ted Kremenek [Thu, 20 Nov 2008 00:52:19 +0000 (00:52 +0000)]
Use ScheduleDAGSDNodes.h instead of ScheduleDAG.h (stuff moved around).

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

15 years agoSplit region store specific test cases.
Zhongxing Xu [Thu, 20 Nov 2008 00:46:15 +0000 (00:46 +0000)]
Split region store specific test cases.

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

15 years agoMore objc gc stuff. Read/Write barriers for local static/extern,
Fariborz Jahanian [Thu, 20 Nov 2008 00:15:42 +0000 (00:15 +0000)]
More objc gc stuff. Read/Write barriers for local static/extern,
diagnostics on use of __weak attribute on fields,
Early support for read/write barriers for objc fields.

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

15 years agoBeef up the test for function call operators slightly
Douglas Gregor [Wed, 19 Nov 2008 22:59:19 +0000 (22:59 +0000)]
Beef up the test for function call operators slightly

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

15 years agoImplement the rest of C++ [over.call.object], which permits the object
Douglas Gregor [Wed, 19 Nov 2008 22:57:39 +0000 (22:57 +0000)]
Implement the rest of C++ [over.call.object], which permits the object
being called to be converted to a reference-to-function,
pointer-to-function, or reference-to-pointer-to-function. This is done
through "surrogate" candidate functions that model the conversions
from the object to the function (reference/pointer) and the
conversions in the arguments.

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

15 years agoFix comment.
Ted Kremenek [Wed, 19 Nov 2008 22:55:55 +0000 (22:55 +0000)]
Fix comment.

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

15 years agoUse PreprocessorLexer::getFileID() instead of Lexer::getFileLoc(). This is an interm...
Ted Kremenek [Wed, 19 Nov 2008 22:55:25 +0000 (22:55 +0000)]
Use PreprocessorLexer::getFileID() instead of Lexer::getFileLoc().  This is an intermediate step to having getCurrentLexer() return a PreprocessorLexer* instead of a Lexer*.

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

15 years agoMove more cases of using 'CurLexer' to 'CurPPLexer'.
Ted Kremenek [Wed, 19 Nov 2008 22:43:49 +0000 (22:43 +0000)]
Move more cases of using 'CurLexer' to 'CurPPLexer'.
Use PTHLexer::isNextPPTokenLParen() when using the PTHLexer.

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

15 years agoAdd stub for PTHLexer::isNextPPTokenLParen().
Ted Kremenek [Wed, 19 Nov 2008 22:42:26 +0000 (22:42 +0000)]
Add stub for PTHLexer::isNextPPTokenLParen().

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

15 years agoAdd version of 'getFileCharacteristic()' for FileIDs.
Ted Kremenek [Wed, 19 Nov 2008 22:41:46 +0000 (22:41 +0000)]
Add version of 'getFileCharacteristic()' for FileIDs.

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

15 years agoWhen using a PTHLexer, use DiscardToEndOfLine() instead of ReadToEndOfLine().
Ted Kremenek [Wed, 19 Nov 2008 22:21:33 +0000 (22:21 +0000)]
When using a PTHLexer, use DiscardToEndOfLine() instead of ReadToEndOfLine().

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

15 years ago- Move static function IsNonPragmaNonMacroLexer into Preprocessor.h.
Ted Kremenek [Wed, 19 Nov 2008 21:57:25 +0000 (21:57 +0000)]
- Move static function IsNonPragmaNonMacroLexer into Preprocessor.h.
- Add variants of IsNonPragmaNonMacroLexer to accept an IncludeMacroStack entry
  (simplifies some uses).
- Use IsNonPragmaNonMacroLexer in Preprocessor::LookupFile.
- Add 'FileID' to PreprocessorLexer, and have Preprocessor query this fileid
  when looking up the FileEntry for a file

Performance testing of -Eonly on Cocoa.h shows no performance regression because
of this patch.

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

15 years agoFix <rdar://problem/6291588> assertion failure: SourceManager.h line 489.
Steve Naroff [Wed, 19 Nov 2008 21:15:47 +0000 (21:15 +0000)]
Fix <rdar://problem/6291588> assertion failure: SourceManager.h line 489.

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

15 years agoSupport for calling overloaded function call operators (operator())
Douglas Gregor [Wed, 19 Nov 2008 21:05:33 +0000 (21:05 +0000)]
Support for calling overloaded function call operators (operator())
with function call syntax, e.g.,

  Functor f;
  f(x, y);

This is the easy part of handling calls to objects of class type
(C++ [over.call.object]). The hard part (coping with conversions from
f to function pointer or reference types) will come later. Nobody uses
that stuff anyway, right? :)

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

15 years agoSome tweaks suggested by Argiris
Douglas Gregor [Wed, 19 Nov 2008 19:09:45 +0000 (19:09 +0000)]
Some tweaks suggested by Argiris

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

15 years agoIgnore Output directories when searching for tests.
Daniel Dunbar [Wed, 19 Nov 2008 19:06:57 +0000 (19:06 +0000)]
Ignore Output directories when searching for tests.

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

15 years agoCMake: Added some source files.
Oscar Fuentes [Wed, 19 Nov 2008 18:46:39 +0000 (18:46 +0000)]
CMake: Added some source files.

Patch contributed by Jay Foad!

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

15 years agoMore of objective-c's gc code-gen. Treat objective-c
Fariborz Jahanian [Wed, 19 Nov 2008 18:38:10 +0000 (18:38 +0000)]
More of objective-c's gc code-gen. Treat objective-c
objects as __strong when attribute unspecified.

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

15 years agoMake DeclContext::getLexicalParent reuse DeclContext::getParent.
Argyrios Kyrtzidis [Wed, 19 Nov 2008 18:07:24 +0000 (18:07 +0000)]
Make DeclContext::getLexicalParent reuse DeclContext::getParent.

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

15 years agoTake care another assert:
Argyrios Kyrtzidis [Wed, 19 Nov 2008 18:01:13 +0000 (18:01 +0000)]
Take care another assert:

struct A {
  struct B;
};

struct A::B {
  void m() {} // Assertion failed: getContainingDC(DC) == CurContext && "The next DeclContext should be lexically contained in the current one."
};

Introduce DeclContext::getLexicalParent which may be different from DeclContext::getParent when nested-names are involved, e.g:

   namespace A {
      struct S;
   }
   struct A::S {}; // getParent() == namespace 'A'
                   // getLexicalParent() == translation unit

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

15 years agofix folding of '*doubleArray'
Nuno Lopes [Wed, 19 Nov 2008 17:44:31 +0000 (17:44 +0000)]
fix folding of '*doubleArray'

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

15 years agoMake the non-const DeclContext::getParent call the const version, instead of the...
Argyrios Kyrtzidis [Wed, 19 Nov 2008 17:36:39 +0000 (17:36 +0000)]
Make the non-const DeclContext::getParent call the const version, instead of the other way around.

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

15 years agoFew more changes due to Daniel's feedback.
Fariborz Jahanian [Wed, 19 Nov 2008 17:34:06 +0000 (17:34 +0000)]
Few more changes due to Daniel's feedback.

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

15 years agoSupport overloading of the subscript operator[], including support for
Douglas Gregor [Wed, 19 Nov 2008 17:17:41 +0000 (17:17 +0000)]
Support overloading of the subscript operator[], including support for
built-in operator candidates. Test overloading of '&' and ','.

In C++, a comma expression is an lvalue if its right-hand
subexpression is an lvalue. Update Expr::isLvalue accordingly.

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

15 years agoFix <rdar://problem/6150376> [sema] crash on invalid message send.
Steve Naroff [Wed, 19 Nov 2008 15:54:23 +0000 (15:54 +0000)]
Fix <rdar://problem/6150376> [sema] crash on invalid message send.

The core fix in Sema::ActOnClassMessage(). All the other changes have to do with passing down the SourceLocation for the receiver (to properly position the cursor when producing an error diagnostic).

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

15 years agoAdded operator overloading for unary operators, post-increment, and
Douglas Gregor [Wed, 19 Nov 2008 15:42:04 +0000 (15:42 +0000)]
Added operator overloading for unary operators, post-increment, and
post-decrement, including support for generating all of the built-in
operator candidates for these operators.

C++ and C have different rules for the arguments to the builtin unary
'+' and '-'. Implemented both variants in Sema::ActOnUnaryOp.

In C++, pre-increment and pre-decrement return lvalues. Update
Expr::isLvalue accordingly.

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

15 years agoFix this:
Argyrios Kyrtzidis [Wed, 19 Nov 2008 15:22:16 +0000 (15:22 +0000)]
Fix this:

With this snippet:
  void f(a::b);

An assert is hit:
Assertion failed: CachedTokens[CachedLexPos-1].getLocation() == Tok.getAnnotationEndLoc() && "The annotation should be until the most recent cached token", file ..\..\lib\Lex\PPCaching.cpp, line 98

Introduce Preprocessor::RevertCachedTokens that reverts a specific number of tokens when backtracking is enabled.

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

15 years agoRemove Preprocessor::CacheTokens boolean data member. The same functionality can...
Argyrios Kyrtzidis [Wed, 19 Nov 2008 14:23:14 +0000 (14:23 +0000)]
Remove Preprocessor::CacheTokens boolean data member. The same functionality can be provided by using Preprocessor::isBacktrackEnabled().

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

15 years agoAdd spec ref to comment.
Daniel Dunbar [Wed, 19 Nov 2008 11:54:05 +0000 (11:54 +0000)]
Add spec ref to comment.

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

15 years agoAdd test for path-sensitive uninit-val detection involving struct field.
Zhongxing Xu [Wed, 19 Nov 2008 11:10:42 +0000 (11:10 +0000)]
Add test for path-sensitive uninit-val detection involving struct field.

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

15 years agoAdd support for symbolicating global structs and arrays in RegionStoreManager::getIni...
Zhongxing Xu [Wed, 19 Nov 2008 11:06:24 +0000 (11:06 +0000)]
Add support for symbolicating global structs and arrays in RegionStoreManager::getInitialStore().

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

15 years agoAdd SymbolData for array elements and struct fields.
Zhongxing Xu [Wed, 19 Nov 2008 11:03:17 +0000 (11:03 +0000)]
Add SymbolData for array elements and struct fields.

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

15 years agoFix silly code, use IdentifierInfo* instead of std::string in
Daniel Dunbar [Wed, 19 Nov 2008 10:32:38 +0000 (10:32 +0000)]
Fix silly code, use IdentifierInfo* instead of std::string in
PragmaPackStack. Thanks Chris!

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

15 years agoFix redundant load of bit-fields on assignment (to get the updated
Daniel Dunbar [Wed, 19 Nov 2008 09:36:46 +0000 (09:36 +0000)]
Fix redundant load of bit-fields on assignment (to get the updated
value).
 - Use extra argument to EmitStoreThroughLValue to provide place to
   write update bit-field value if caller requires it.
 - This fixes several FIXMEs.

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

15 years agoPointer width for PIC16 is 16 bits. Modify getMemCpy, getMemMove and getMemSet accord...
Sanjiv Gupta [Wed, 19 Nov 2008 09:02:07 +0000 (09:02 +0000)]
Pointer width for PIC16 is 16 bits. Modify getMemCpy, getMemMove and getMemSet accordingly.

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

15 years agofix save-o
Chris Lattner [Wed, 19 Nov 2008 08:26:36 +0000 (08:26 +0000)]
fix save-o

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

15 years agosimplify
Chris Lattner [Wed, 19 Nov 2008 08:24:49 +0000 (08:24 +0000)]
simplify

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

15 years agostop calling II::getName() unnecesarily in sema
Chris Lattner [Wed, 19 Nov 2008 08:23:25 +0000 (08:23 +0000)]
stop calling II::getName() unnecesarily in sema

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

15 years agosimplify some code.
Chris Lattner [Wed, 19 Nov 2008 07:55:04 +0000 (07:55 +0000)]
simplify some code.

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

15 years agoremove uses of IdentifierInfo::getName()
Chris Lattner [Wed, 19 Nov 2008 07:51:13 +0000 (07:51 +0000)]
remove uses of IdentifierInfo::getName()

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

15 years agoremove some uses of IdentifierInfo::getName()
Chris Lattner [Wed, 19 Nov 2008 07:49:38 +0000 (07:49 +0000)]
remove some uses of IdentifierInfo::getName()

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

15 years agoadd a new helper method. It is unclear to me why this doesn't work, but GCC
Chris Lattner [Wed, 19 Nov 2008 07:49:14 +0000 (07:49 +0000)]
add a new helper method.  It is unclear to me why this doesn't work, but GCC
won't match it:

  template<std::size_t StrLen>
  bool isName(const char Str[StrLen]) const {
    return getLength() == StrLen-1 && !memcmp(getName(), Str, StrLen-1);
  }

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

15 years agoUse smallstring instead of new[]'ing a string. This simplifies
Chris Lattner [Wed, 19 Nov 2008 07:41:27 +0000 (07:41 +0000)]
Use smallstring instead of new[]'ing a string.  This simplifies
the code and speeds it up.

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

15 years agoremove uses of IdentifierInfo::getName()
Chris Lattner [Wed, 19 Nov 2008 07:37:42 +0000 (07:37 +0000)]
remove uses of IdentifierInfo::getName()

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

15 years agodon't turn identifierinfo's into strings in diagnostics.
Chris Lattner [Wed, 19 Nov 2008 07:33:58 +0000 (07:33 +0000)]
don't turn identifierinfo's into strings in diagnostics.

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

15 years agoAllow sending IdentifierInfo*'s into Diagnostics without turning them into strings
Chris Lattner [Wed, 19 Nov 2008 07:32:16 +0000 (07:32 +0000)]
Allow sending IdentifierInfo*'s into Diagnostics without turning them into strings
first.  This should allow removal of a bunch of II->getName() calls.

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

15 years agoconvert some diags to use numbers instead of strings.
Chris Lattner [Wed, 19 Nov 2008 07:25:44 +0000 (07:25 +0000)]
convert some diags to use numbers instead of strings.

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

15 years agoformatting
Chris Lattner [Wed, 19 Nov 2008 07:24:05 +0000 (07:24 +0000)]
formatting

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

15 years agoadd direct support for signed and unsigned integer arguments to diagnostics.
Chris Lattner [Wed, 19 Nov 2008 07:22:31 +0000 (07:22 +0000)]
add direct support for signed and unsigned integer arguments to diagnostics.

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

15 years agoswitch TextDiagnosticPrinter to raw_ostream.
Chris Lattner [Wed, 19 Nov 2008 06:56:25 +0000 (06:56 +0000)]
switch TextDiagnosticPrinter to raw_ostream.

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

15 years agorewrite FormatDiagnostic to be less gross and a lot more efficient.
Chris Lattner [Wed, 19 Nov 2008 06:51:40 +0000 (06:51 +0000)]
rewrite FormatDiagnostic to be less gross and a lot more efficient.
This also makes it illegal to have bare '%'s in diagnostics.  If you
want a % in a diagnostic, use %%.

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

15 years agoDiscard unused runtime function declarations (for readability).
Daniel Dunbar [Wed, 19 Nov 2008 06:15:35 +0000 (06:15 +0000)]
Discard unused runtime function declarations (for readability).

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

15 years agoimplement a transparent optimization with the diagnostics stuff:
Chris Lattner [Wed, 19 Nov 2008 06:04:55 +0000 (06:04 +0000)]
implement a transparent optimization with the diagnostics stuff:
const char*'s are now not converted to std::strings when the diagnostic
is formed, we just hold onto their pointer and format as needed.

This commit makes DiagnosticClient::FormatDiagnostic even more of a
mess, I'll fix it in the next commit.

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

15 years agoUpdated checker build.
Ted Kremenek [Wed, 19 Nov 2008 05:46:43 +0000 (05:46 +0000)]
Updated checker build.

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

15 years agoAddress Sebastian and Doug's objections with taking pointers to temporaries.
Chris Lattner [Wed, 19 Nov 2008 05:34:22 +0000 (05:34 +0000)]
Address Sebastian and Doug's objections with taking pointers to temporaries.
Instead of doing that, copy the strings into the diagnostic info.

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

15 years agoremove one more old-style Diag method.
Chris Lattner [Wed, 19 Nov 2008 05:27:50 +0000 (05:27 +0000)]
remove one more old-style Diag method.

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

15 years agoSwitch several more Sema Diag methods over. This simplifies the
Chris Lattner [Wed, 19 Nov 2008 05:08:23 +0000 (05:08 +0000)]
Switch several more Sema Diag methods over.  This simplifies the
__builtin_prefetch code to only emit one diagnostic per builtin_prefetch.
While this has nothing to do with the rest of the patch, the code seemed
like overkill when I was updating it.

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