]> granicus.if.org Git - clang/log
clang
15 years agoFix indentation width.
Anders Carlsson [Sat, 22 Nov 2008 20:49:42 +0000 (20:49 +0000)]
Fix indentation width.

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

15 years agoremove a dead enum
Chris Lattner [Sat, 22 Nov 2008 20:47:38 +0000 (20:47 +0000)]
remove a dead enum

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

15 years agoSupport for implicit property assignment. Error assigning to
Fariborz Jahanian [Sat, 22 Nov 2008 20:25:50 +0000 (20:25 +0000)]
Support for implicit property assignment. Error assigning to
'implicit' property with no 'setter'.

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

15 years agoadd a silly testcase
Chris Lattner [Sat, 22 Nov 2008 19:57:03 +0000 (19:57 +0000)]
add a silly testcase

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

15 years agoAnd a test case for my last patch.
Fariborz Jahanian [Sat, 22 Nov 2008 18:40:47 +0000 (18:40 +0000)]
And a test case for my last patch.

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

15 years agoNew AST node to access "implicit" setter/getter using property dor syntax.
Fariborz Jahanian [Sat, 22 Nov 2008 18:39:36 +0000 (18:39 +0000)]
New AST node to access "implicit" setter/getter using property dor syntax.
Issuing diagnostics when assigning to read-only properties.
This is work in progress.

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

15 years agoImplement a %plural modifier for complex plural forms in diagnostics. Use it in the...
Sebastian Redl [Sat, 22 Nov 2008 13:44:36 +0000 (13:44 +0000)]
Implement a %plural modifier for complex plural forms in diagnostics. Use it in the overload diagnostics.

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

15 years agoRemove debug code.
Zhongxing Xu [Sat, 22 Nov 2008 13:23:00 +0000 (13:23 +0000)]
Remove debug code.

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

15 years agoInitial support for checking out of bound memory access. Only support
Zhongxing Xu [Sat, 22 Nov 2008 13:21:46 +0000 (13:21 +0000)]
Initial support for checking out of bound memory access. Only support
ConcreteInt index for now.

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

15 years agoremove some more old Diag methods, replace with a single static helper function
Chris Lattner [Sat, 22 Nov 2008 08:32:36 +0000 (08:32 +0000)]
remove some more old Diag methods, replace with a single static helper function

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

15 years agomove the Diag method for Sema to be inline. This shrinks the release-asserts
Chris Lattner [Sat, 22 Nov 2008 08:28:49 +0000 (08:28 +0000)]
move the Diag method for Sema to be inline.  This shrinks the release-asserts
clang executable (when built with gcc 4.2 on the mac) from 14519740 to
14495028 bytes.  This shrinks individual object files as well: SemaChecking
from 23580->22248, SemaDeclObjc from 61368->57376, SemaExpr from
115628->110516, as well as several others.

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

15 years agoalphabeticalize.
Chris Lattner [Sat, 22 Nov 2008 08:22:53 +0000 (08:22 +0000)]
alphabeticalize.

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

15 years agoFix a weird inconsistency with hex floats. Previously the lexer
Chris Lattner [Sat, 22 Nov 2008 07:39:03 +0000 (07:39 +0000)]
Fix a weird inconsistency with hex floats.  Previously the lexer
would not eat the "-1" in "0x0p-1", but LiteralSupport would accept
it when extensions are on.  This caused strangeness and failures
when hexfloats were properly treated as an extension (not error)
in LiteralSupport.

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

15 years agoremove the NumericLiteralParser::Diag helper method, inlining it into
Chris Lattner [Sat, 22 Nov 2008 07:23:31 +0000 (07:23 +0000)]
remove the NumericLiteralParser::Diag helper method, inlining it into
its call sites.  This makes it more explicit when the hasError flag is
getting set and removes a confusing difference in behavior between
PP.Diag and Diag in this code.

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

15 years agoMove the Preprocessor::Diag methods inline. This has the interesting
Chris Lattner [Sat, 22 Nov 2008 07:03:46 +0000 (07:03 +0000)]
Move the Preprocessor::Diag methods inline.  This has the interesting
(and carefully calculated) effect of allowing the compiler to reason
about the aliasing properties of DiagnosticBuilder object better,
allowing the whole thing to be promoted to registers instead of
resulting in a ton of stack traffic.

While I'm not very concerned about the performance of the Diag() method
invocations, I *am* more concerned about their code size and impact on the
non-diagnostic code.  This patch shrinks the clang executable (in
release-asserts mode with gcc-4.2) from 14523980 to 14519816 bytes.  This
isn't much, but it shrinks the lexer from 38192 to 37776, PPDirectives.o
from 31116 to 28868 bytes, etc.

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

15 years agoAdd test for PR2992.
Anders Carlsson [Sat, 22 Nov 2008 06:42:54 +0000 (06:42 +0000)]
Add test for PR2992.

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

15 years agoinline a method into its only two call sites.
Chris Lattner [Sat, 22 Nov 2008 06:42:31 +0000 (06:42 +0000)]
inline a method into its only two call sites.

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

15 years agoactually, this version isn't really needed.
Chris Lattner [Sat, 22 Nov 2008 06:22:39 +0000 (06:22 +0000)]
actually, this version isn't really needed.

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

15 years agoremove a sneaky version of Diag hiding in PreprocessorLexer.
Chris Lattner [Sat, 22 Nov 2008 06:20:42 +0000 (06:20 +0000)]
remove a sneaky version of Diag hiding in PreprocessorLexer.

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

15 years agoUse tryEvaluate for constant exprs.
Anders Carlsson [Sat, 22 Nov 2008 02:34:39 +0000 (02:34 +0000)]
Use tryEvaluate for constant exprs.

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

15 years agoChange the Lexer::Diag method to not magically silence warnings,
Chris Lattner [Sat, 22 Nov 2008 02:02:22 +0000 (02:02 +0000)]
Change the Lexer::Diag method to not magically silence warnings,
force the caller to check instead.  This eliminates the need (and the
risk!) of weird null DiagnosticBuilder's floating around.

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

15 years agoTeach tentative parsing to handle block pointers (rdar://6394309)
Chris Lattner [Sat, 22 Nov 2008 01:15:33 +0000 (01:15 +0000)]
Teach tentative parsing to handle block pointers (rdar://6394309)

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

15 years agofit in 80 cols
Chris Lattner [Sat, 22 Nov 2008 01:04:49 +0000 (01:04 +0000)]
fit in 80 cols

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

15 years agoreverting this because it breaks some blocks cases, I'll send doug a testcase
Ted Kremenek [Sat, 22 Nov 2008 01:04:48 +0000 (01:04 +0000)]
reverting this because it breaks some blocks cases, I'll send doug a testcase

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

15 years agoSplit the DiagnosticInfo class into two disjoint classes:
Chris Lattner [Sat, 22 Nov 2008 00:59:29 +0000 (00:59 +0000)]
Split the DiagnosticInfo class into two disjoint classes:
one for building up the diagnostic that is in flight (DiagnosticBuilder)
and one for pulling structured information out of the diagnostic when
formatting and presenting it.

There is no functionality change with this patch.

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

15 years agoFix predicate: we're not in caching mode if CurPPLexer == 0, not CurLexer == 0.
Ted Kremenek [Sat, 22 Nov 2008 00:41:34 +0000 (00:41 +0000)]
Fix predicate: we're not in caching mode if CurPPLexer == 0, not CurLexer == 0.

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

15 years agoIn PTHLexer::DiscardToEndOfLine() use Lex() instead of AdvanceToken(). This handles...
Ted Kremenek [Fri, 21 Nov 2008 23:28:56 +0000 (23:28 +0000)]
In PTHLexer::DiscardToEndOfLine() use Lex() instead of AdvanceToken().  This handles transitions in the preprocessor state.

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

15 years agoReenable the default lexer.
Ted Kremenek [Fri, 21 Nov 2008 20:51:59 +0000 (20:51 +0000)]
Reenable the default lexer.

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

15 years agoWhen creating the raw tokens for PTHLexer, make sure the token representing the file...
Ted Kremenek [Fri, 21 Nov 2008 20:51:15 +0000 (20:51 +0000)]
When creating the raw tokens for PTHLexer, make sure the token representing the file to include is checked for being an identifier.

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

15 years agoWhen creating raw tokens for the PTHLexer specially handle angled strings for #includ...
Ted Kremenek [Fri, 21 Nov 2008 19:41:29 +0000 (19:41 +0000)]
When creating raw tokens for the PTHLexer specially handle angled strings for #include directives.

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

15 years agoFixed bugzilla bug# 3095 related to code gen. for @synchronized.
Fariborz Jahanian [Fri, 21 Nov 2008 19:21:53 +0000 (19:21 +0000)]
Fixed bugzilla bug# 3095 related to code gen. for @synchronized.

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

15 years agoImplementation of new and delete parsing and sema.
Sebastian Redl [Fri, 21 Nov 2008 19:14:01 +0000 (19:14 +0000)]
Implementation of new and delete parsing and sema.
This version uses VLAs to represent arrays. I'll try an alternative way next, but I want this safe first.

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

15 years agorearrange some fields.
Chris Lattner [Fri, 21 Nov 2008 18:59:21 +0000 (18:59 +0000)]
rearrange some fields.

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

15 years agomerge some simple call diagnostics.
Chris Lattner [Fri, 21 Nov 2008 18:44:24 +0000 (18:44 +0000)]
merge some simple call diagnostics.

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

15 years agoprint a type in a diagnostic.
Chris Lattner [Fri, 21 Nov 2008 18:27:34 +0000 (18:27 +0000)]
print a type in a diagnostic.

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

15 years agoFields of ivars of struct types are considered ivars
Fariborz Jahanian [Fri, 21 Nov 2008 18:14:01 +0000 (18:14 +0000)]
Fields of ivars of struct types are considered ivars
themselves for gc API generation purposes.

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

15 years agoDon't turn off blocks in C++
Douglas Gregor [Fri, 21 Nov 2008 17:10:06 +0000 (17:10 +0000)]
Don't turn off blocks in C++

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

15 years agoreapply the (corrected) patch to use the new llvm intrinsics for memcpy/memmove etc.
Chris Lattner [Fri, 21 Nov 2008 16:43:15 +0000 (16:43 +0000)]
reapply the (corrected) patch to use the new llvm intrinsics for memcpy/memmove etc.

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

15 years agoAllow redeclaration of typedefs in C++
Douglas Gregor [Fri, 21 Nov 2008 16:29:06 +0000 (16:29 +0000)]
Allow redeclaration of typedefs in C++

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

15 years agotemporarily revert Sangiv's patch.
Chris Lattner [Fri, 21 Nov 2008 16:26:37 +0000 (16:26 +0000)]
temporarily revert Sangiv's patch.

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

15 years agoTiny fix to the parsing of linkage-specifications
Douglas Gregor [Fri, 21 Nov 2008 16:10:08 +0000 (16:10 +0000)]
Tiny fix to the parsing of linkage-specifications

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

15 years agoFix overloading of non-static member functions that differ in their cv-qualifiers
Douglas Gregor [Fri, 21 Nov 2008 15:36:28 +0000 (15:36 +0000)]
Fix overloading of non-static member functions that differ in their cv-qualifiers

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

15 years agoEnable some more operator overloading tests, and don't look into an identifier for...
Douglas Gregor [Fri, 21 Nov 2008 15:30:19 +0000 (15:30 +0000)]
Enable some more operator overloading tests, and don't look into an identifier for functions that might not have one

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

15 years agomem[cpy,set,move] intrinsics are now overloaded.
Sanjiv Gupta [Fri, 21 Nov 2008 07:57:42 +0000 (07:57 +0000)]
mem[cpy,set,move] intrinsics are now overloaded.

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

15 years agomerge 3 more diagnostics into 1.
Chris Lattner [Fri, 21 Nov 2008 07:57:12 +0000 (07:57 +0000)]
merge 3 more diagnostics into 1.

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

15 years agoAdd the concept of "modifiers" to the clang diagnostic format
Chris Lattner [Fri, 21 Nov 2008 07:50:02 +0000 (07:50 +0000)]
Add the concept of "modifiers" to the clang diagnostic format
strings.  This allows us to have considerable flexibility in how
these things are displayed and provides extra information that
allows us to merge away diagnostics that are very similar.

Diagnostic modifiers are a string of characters with the regex
[-a-z]+ that occur between the % and digit.  They may
optionally have an argument that can parameterize them.

For now, I've added two example modifiers.  One is a very useful
tool that allows you to factor commonality across diagnostics
that need single words or phrases combined.  Basically you can
use %select{a|b|c}4 with with an integer argument that selects
either a/b/c based on an integer value in the range [0..3).

The second modifier is also an integer modifier, aimed to help
English diagnostics handle plurality.  "%s3" prints to 's' if
integer argument #3 is not 1, otherwise it prints to nothing.
I'm fully aware that 's' is an English concept and doesn't
apply to all situations (mouse vs mice).  However, this is very
useful and we can add other crazy modifiers once we add support
for polish! ;-)

I converted a couple C++ diagnostics over to use this as an
example, I'd appreciate it if others could merge the other
likely candiates.  If you have other modifiers that you want,
lets talk on cfe-dev.

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

15 years agoChange CheckIncrementDecrementOperand to test for common cases first
Chris Lattner [Fri, 21 Nov 2008 07:05:48 +0000 (07:05 +0000)]
Change CheckIncrementDecrementOperand to test for common cases first
and fall through better.

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

15 years agomove the diagnostic location and ID out of DiagnosticInfo and store it in
Chris Lattner [Fri, 21 Nov 2008 06:59:12 +0000 (06:59 +0000)]
move the diagnostic location and ID out of DiagnosticInfo and store it in
the Diagnostic class. Since we can already only have one diagnostic in
flight at a time, this shrinks DiagnosticInfo.

This reduces DiagnosticInfo to being basically a rather crazy smart pointer
to a DiagnosticInfo :)

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

15 years agomove diagnostic insertion methods to be free methods instead of
Chris Lattner [Fri, 21 Nov 2008 06:54:20 +0000 (06:54 +0000)]
move diagnostic insertion methods to be free methods instead of
in the DiagnosticInfo class.  This requires marking them as taking
a const DiagnosticInfo, which is bogus (they logically mutate DI),
but works with the C++ type system.

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

15 years agotestcase for PR3096
Chris Lattner [Fri, 21 Nov 2008 06:19:48 +0000 (06:19 +0000)]
testcase for PR3096

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

15 years agoCleanup memory management in overloading of operator->, slightly
Douglas Gregor [Fri, 21 Nov 2008 03:04:22 +0000 (03:04 +0000)]
Cleanup memory management in overloading of operator->, slightly

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

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