Граф коммитов

6527 Коммитов

Автор SHA1 Сообщение Дата
Chris Lattner 6ff0fc341f Tweak duplicate category diagnostic to work like the duplicate protocol diagnostic.
Also, point out where the previous decl was.  This unxfails two tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59918 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 22:38:38 +00:00
Chris Lattner 08631c5fa0 Convert IdentifierInfo's to be printed the same as DeclarationNames
with implicit quotes around them.  This has a bunch of follow-on 
effects and requires tweaking to a whole lot of code.  This causes
a regression in two tests (xfailed) by causing it to emit things like:

  Line 10: duplicate interface declaration for category 'MyClass1' ('Category1')

instead of:

  Line 10: duplicate interface declaration for category 'MyClass1(Category1)'

I will fix this in a follow-up commit.

As part of this, I had to start switching stuff to use ->getDeclName() instead
of Decl::getName() for consistency.  This is good, but I was planning to do this
as an independent patch.  There will be several follow-on patches
to clean up some of the mess, but this patch is already too big.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59917 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 21:45:46 +00:00
Chris Lattner 011bb4edf7 add support for inserting a DeclarationName into a diagnostic directly
without calling getAsString().  This implicitly puts quotes around the
name, so diagnostics need to be tweaked to accommodate this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59916 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 20:28:15 +00:00
Chris Lattner 545b368e61 inserting a qualtype adds quotes implicitly
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59915 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 20:27:13 +00:00
Chris Lattner 3fdf4b071d Genericize the qualtype formating callback to support any diag argument.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59908 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 09:21:17 +00:00
Chris Lattner 22caddc91d Add support for sending QualType's directly into diags and convert two
diags over to use this.  QualTypes implicitly print single quotes around 
them for uniformity and future extension.

Doing this requires a little function pointer dance to prevent libbasic
from depending on libast.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59907 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 09:13:29 +00:00
Chris Lattner 3fcbb89cac other minor edits.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59906 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 08:32:53 +00:00
Chris Lattner 552de0a0a4 minor cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59905 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 08:16:56 +00:00
Zhongxing Xu 1c0c233253 Add out-of-bound memory access warning report code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59903 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 05:52:28 +00:00
Zhongxing Xu ea06544bea Improve test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59902 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 05:50:21 +00:00
Zhongxing Xu 63123d8e48 Clean up code by using utility methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59899 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 04:30:35 +00:00
Chris Lattner fd408eab4c finish up the diagnostics documentation. We don't
support QualType and DeclarationName yet, so some of it
is lies, however, this will be fixed shortly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59896 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 00:42:53 +00:00
Chris Lattner 627b705fa1 more updates
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59895 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 00:28:33 +00:00
Chris Lattner cc54334ba4 finish documentation of %select.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59892 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 23:50:47 +00:00
Anders Carlsson 9d4c157baa Return false if we encounter a type we can't handle.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59889 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 22:56:32 +00:00
Sebastian Redl 9f4d86389f Fix test cases broken by quote normalization in diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59888 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 22:39:41 +00:00
Anders Carlsson ef5a66d817 An expression is not foldable if it can't be fully evaluated. Fixes PR3060
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59887 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 22:32:07 +00:00
Fariborz Jahanian 43f447098d Implemented ir-gen for 'implicit' properties using the new AST nodes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59886 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 22:30:21 +00:00
Sebastian Redl 6816856fb1 Documentation for the plural modifier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59885 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 22:16:45 +00:00
Anders Carlsson 6dde0d5dc0 Case values must be evaluated
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59884 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 21:50:49 +00:00
Chris Lattner 62fd278ff9 start documenting Diagnostics. Sebastian, I'd appreciate it
if you can fill in the section for %plural.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59883 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 21:41:31 +00:00
Chris Lattner 717596279b consistently use single quotes for quoted things.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59882 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 21:16:43 +00:00
Anders Carlsson 51fe996231 Use Expr::Evaluate for case statements. Fixes PR2525
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59881 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 21:04:56 +00:00
Anders Carlsson f3a05d9362 Fix indentation width.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59880 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 20:49:42 +00:00
Chris Lattner 32b939b51b remove a dead enum
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59879 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 20:47:38 +00:00
Fariborz Jahanian ba8d2d684e 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
2008-11-22 20:25:50 +00:00
Chris Lattner 7ca1425773 add a silly testcase
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59877 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 19:57:03 +00:00
Fariborz Jahanian b7611f2812 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
2008-11-22 18:40:47 +00:00
Fariborz Jahanian 5daf570d0c 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
2008-11-22 18:39:36 +00:00
Sebastian Redl e4c452c4c7 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
2008-11-22 13:44:36 +00:00
Zhongxing Xu 369f42971b Remove debug code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59870 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 13:23:00 +00:00
Zhongxing Xu e8a964bdb4 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
2008-11-22 13:21:46 +00:00
Chris Lattner 254be6ac14 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
2008-11-22 08:32:36 +00:00
Chris Lattner 3cfa928f9c 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
2008-11-22 08:28:49 +00:00
Chris Lattner 6afbf3f219 alphabeticalize.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59866 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 08:22:53 +00:00
Chris Lattner 4984212fce 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
2008-11-22 07:39:03 +00:00
Chris Lattner ac92d82911 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
2008-11-22 07:23:31 +00:00
Chris Lattner adc4eeb080 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
2008-11-22 07:03:46 +00:00
Anders Carlsson cd761cd1a7 Add test for PR2992.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59861 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 06:42:54 +00:00
Chris Lattner 9efe970928 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
2008-11-22 06:42:31 +00:00
Chris Lattner 30c6476e8e actually, this version isn't really needed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59859 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 06:22:39 +00:00
Chris Lattner 306fda76b0 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
2008-11-22 06:20:42 +00:00
Anders Carlsson bcf6225ad6 Use tryEvaluate for constant exprs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59857 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 02:34:39 +00:00
Chris Lattner 74d15dfd18 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
2008-11-22 02:02:22 +00:00
Chris Lattner a4f34eaab2 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
2008-11-22 01:15:33 +00:00
Chris Lattner 9634379265 fit in 80 cols
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59851 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 01:04:49 +00:00
Ted Kremenek 3f0850e6f2 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
2008-11-22 01:04:48 +00:00
Chris Lattner 3cbfe2c415 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
2008-11-22 00:59:29 +00:00
Ted Kremenek 3296ccea50 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
2008-11-22 00:41:34 +00:00
Ted Kremenek d2bdeed072 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
2008-11-21 23:28:56 +00:00