]> granicus.if.org Git - clang/log
clang
15 years agoHandle returning complex types that get coerced. Fixes PR3131
Anders Carlsson [Tue, 25 Nov 2008 22:21:48 +0000 (22:21 +0000)]
Handle returning complex types that get coerced. Fixes PR3131

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

15 years agoUse RAII objects to ensure proper destruction of expression and statement AST nodes...
Sebastian Redl [Tue, 25 Nov 2008 22:21:31 +0000 (22:21 +0000)]
Use RAII objects to ensure proper destruction of expression and statement AST nodes in the parser in most cases, even on error.

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

15 years agoFix 80-col violations.
Daniel Dunbar [Tue, 25 Nov 2008 21:53:21 +0000 (21:53 +0000)]
Fix 80-col violations.

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

15 years agoRefactored checking on readonly property into a method.
Fariborz Jahanian [Tue, 25 Nov 2008 21:48:26 +0000 (21:48 +0000)]
Refactored checking on readonly property into a method.

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

15 years agoPatch to allow over-riding of readonly property to
Fariborz Jahanian [Tue, 25 Nov 2008 17:56:43 +0000 (17:56 +0000)]
Patch to allow over-riding of readonly property to
a writable property in one of its category.

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

15 years agoRemove more #ifdeffed code
Anders Carlsson [Tue, 25 Nov 2008 17:16:39 +0000 (17:16 +0000)]
Remove more #ifdeffed code

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

15 years agoRemove the #ifdeffed out code.
Anders Carlsson [Tue, 25 Nov 2008 17:10:10 +0000 (17:10 +0000)]
Remove the #ifdeffed out code.

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

15 years agoadd note about running the test suite with valgrind
Nuno Lopes [Tue, 25 Nov 2008 15:46:06 +0000 (15:46 +0000)]
add note about running the test suite with valgrind

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

15 years agoremove unused var
Nuno Lopes [Tue, 25 Nov 2008 12:23:46 +0000 (12:23 +0000)]
remove unused var

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

15 years agoTest another error message, make sure to verify C++ new and delete tests
Douglas Gregor [Tue, 25 Nov 2008 04:08:05 +0000 (04:08 +0000)]
Test another error message, make sure to verify C++ new and delete tests

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

15 years agoSimple parsing of exception specifications, with no semantic analysis yet
Douglas Gregor [Tue, 25 Nov 2008 03:22:00 +0000 (03:22 +0000)]
Simple parsing of exception specifications, with no semantic analysis yet

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

15 years agoAdd documentation for test.
Zhongxing Xu [Tue, 25 Nov 2008 01:45:11 +0000 (01:45 +0000)]
Add documentation for test.

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

15 years agoComment fix.
Daniel Dunbar [Tue, 25 Nov 2008 00:20:22 +0000 (00:20 +0000)]
Comment fix.

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

15 years agoAdd no-warning to test case.
Zhongxing Xu [Mon, 24 Nov 2008 23:45:56 +0000 (23:45 +0000)]
Add no-warning to test case.

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

15 years agoPatch to remove bogus waring when a property declaration
Fariborz Jahanian [Mon, 24 Nov 2008 22:16:00 +0000 (22:16 +0000)]
Patch to remove bogus waring when a property declaration
is imported from a protocol into the implementation.

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

15 years agoRemove an empty if and add a reminder for when we implement C++ try-catch.
Sebastian Redl [Mon, 24 Nov 2008 21:45:59 +0000 (21:45 +0000)]
Remove an empty if and add a reminder for when we implement C++ try-catch.

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

15 years agoDisplay the function we are analyzing before running LiveVariables.
Ted Kremenek [Mon, 24 Nov 2008 20:53:32 +0000 (20:53 +0000)]
Display the function we are analyzing before running LiveVariables.

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

15 years agoFix CFG bug where the 'increment' block for a 'for' statement would not be
Ted Kremenek [Mon, 24 Nov 2008 20:50:24 +0000 (20:50 +0000)]
Fix CFG bug where the 'increment' block for a 'for' statement would not be
properly reversed once constructed.

This fixes PR 3125:

http://llvm.org/bugs/show_bug.cgi?id=3125

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

15 years agoRemove some bad characters from comment.
Sebastian Redl [Mon, 24 Nov 2008 20:06:50 +0000 (20:06 +0000)]
Remove some bad characters from comment.

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

15 years agoFix the fix of revision 59974. Now array-struct.c passes too.
Sebastian Redl [Mon, 24 Nov 2008 19:39:40 +0000 (19:39 +0000)]
Fix the fix of revision 59974. Now array-struct.c passes too.

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

15 years agoFix crash of array bounds checking under 64-bit.
Sebastian Redl [Mon, 24 Nov 2008 19:35:33 +0000 (19:35 +0000)]
Fix crash of array bounds checking under 64-bit.
There might be other, similar bugs lurking there.

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

15 years agoRemove FIXME comment.
Ted Kremenek [Mon, 24 Nov 2008 19:27:06 +0000 (19:27 +0000)]
Remove FIXME comment.

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

15 years agoAdd support for AllocaRegion extent with GDM.
Zhongxing Xu [Mon, 24 Nov 2008 09:44:56 +0000 (09:44 +0000)]
Add support for AllocaRegion extent with GDM.

One design problem that is emerging is the signed-ness problem during static
analysis. Many unsigned value have to be converted into signed value because
it partipates in operations with signed values.

On the other hand, we cannot blindly make all values occuring in static analysis
signed, because we do have cases where unsignedness is required, for example,
integer overflow detection.

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

15 years agoAdd utility methods.
Zhongxing Xu [Mon, 24 Nov 2008 09:38:21 +0000 (09:38 +0000)]
Add utility methods.

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

15 years agoFix 80-col violation.
Zhongxing Xu [Mon, 24 Nov 2008 07:38:01 +0000 (07:38 +0000)]
Fix 80-col violation.

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

15 years agoCleanup code with utility method.
Zhongxing Xu [Mon, 24 Nov 2008 07:02:06 +0000 (07:02 +0000)]
Cleanup code with utility method.

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

15 years agoChange a whole lot of diagnostics to take QualType's directly
Chris Lattner [Mon, 24 Nov 2008 06:25:27 +0000 (06:25 +0000)]
Change a whole lot of diagnostics to take QualType's directly
instead of converting them to strings first.  This also fixes a
bunch of minor inconsistencies in the diagnostics emitted by clang
and adds a bunch of FIXME's to DiagnosticKinds.def.

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

15 years agoRename NamedDecl::getName() to getNameAsString(). Replace a bunch of
Chris Lattner [Mon, 24 Nov 2008 05:29:24 +0000 (05:29 +0000)]
Rename NamedDecl::getName() to getNameAsString().  Replace a bunch of
uses of getName() with uses of getDeclName().  This upgrades a bunch of
diags to take DeclNames instead of std::strings.

This also tweaks a couple of diagnostics to be cleaner and changes
CheckInitializerTypes/PerformInitializationByConstructor to pass
around DeclarationNames instead of std::strings.

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

15 years agoReimplement Expr::isConstantExpr in terms of Expr::Evaluate. This fixes PR2832.
Anders Carlsson [Mon, 24 Nov 2008 05:23:59 +0000 (05:23 +0000)]
Reimplement Expr::isConstantExpr in terms of Expr::Evaluate. This fixes PR2832.

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

15 years ago__builtin_constant_p takes an argument that can have any type.
Anders Carlsson [Mon, 24 Nov 2008 05:23:12 +0000 (05:23 +0000)]
__builtin_constant_p takes an argument that can have any type.

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

15 years agoStrings are NULL terminated. So the region size should plus one.
Zhongxing Xu [Mon, 24 Nov 2008 05:16:01 +0000 (05:16 +0000)]
Strings are NULL terminated. So the region size should plus one.

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

15 years agoForgot the newline :)
Anders Carlsson [Mon, 24 Nov 2008 05:13:45 +0000 (05:13 +0000)]
Forgot the newline :)

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

15 years agoAdd test case for bug that's been fixed.
Anders Carlsson [Mon, 24 Nov 2008 05:11:21 +0000 (05:11 +0000)]
Add test case for bug that's been fixed.

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

15 years agoThe address of a variable is only constant if the variable has global storage.
Anders Carlsson [Mon, 24 Nov 2008 04:41:22 +0000 (04:41 +0000)]
The address of a variable is only constant if the variable has global storage.

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

15 years agoFix bug in the constant evaluator. Fixes PR3115.
Anders Carlsson [Mon, 24 Nov 2008 04:21:33 +0000 (04:21 +0000)]
Fix bug in the constant evaluator. Fixes PR3115.

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

15 years agoMigrate some stuff from NamedDecl::getName() to
Chris Lattner [Mon, 24 Nov 2008 04:00:27 +0000 (04:00 +0000)]
Migrate some stuff from NamedDecl::getName() to
NamedDecl::getNameAsString() to make it more explicit.

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

15 years agoRename NamedDecl::getIdentifierName() to ::getNameAsCString() and make it
Chris Lattner [Mon, 24 Nov 2008 03:54:41 +0000 (03:54 +0000)]
Rename NamedDecl::getIdentifierName() to ::getNameAsCString() and make it
assert if the name is not an identifier.  Update callers to do the right
thing and avoid this method in unsafe cases.  This also fixes an objc
warning that was missing a space, and migrates a couple more to taking
IdentifierInfo and QualTypes instead of std::strings.

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

15 years agosimplify this code.
Chris Lattner [Mon, 24 Nov 2008 03:52:59 +0000 (03:52 +0000)]
simplify this code.

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

15 years agoRename Selector::getName() to Selector::getAsString(), and add
Chris Lattner [Mon, 24 Nov 2008 03:33:13 +0000 (03:33 +0000)]
Rename Selector::getName() to Selector::getAsString(), and add
a new NamedDecl::getAsString() method.

Change uses of Selector::getName() to just pass in a Selector
where possible (e.g. to diagnostics) instead of going through
an std::string.

This also adds new formatters for objcinstance and objcclass
as described in the dox.

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

15 years agoAdd a comment about the signedness.
Zhongxing Xu [Mon, 24 Nov 2008 02:30:48 +0000 (02:30 +0000)]
Add a comment about the signedness.

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

15 years agoAdd test case for out-of-bound memory access checking.
Zhongxing Xu [Mon, 24 Nov 2008 02:19:49 +0000 (02:19 +0000)]
Add test case for out-of-bound memory access checking.

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

15 years agoAdd getSize() support for StringRegion.
Zhongxing Xu [Mon, 24 Nov 2008 02:18:56 +0000 (02:18 +0000)]
Add getSize() support for StringRegion.

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

15 years agoRewrite FindDiagnostics to be more strict about the formatting of the
Chris Lattner [Mon, 24 Nov 2008 01:28:17 +0000 (01:28 +0000)]
Rewrite FindDiagnostics to be more strict about the formatting of the
expected-foo strings.  Now the only allowed characters between
expected-error and {{  is whitespace.

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

15 years agoclean up -verify mode output. If the expected-error string is
Chris Lattner [Sun, 23 Nov 2008 23:38:26 +0000 (23:38 +0000)]
clean up -verify mode output.  If the expected-error string is
mangled, report it using the diagnostics machinery instead of printf.

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

15 years agoconvert some more warnings to NOTEs.
Chris Lattner [Sun, 23 Nov 2008 23:26:13 +0000 (23:26 +0000)]
convert some more warnings to NOTEs.

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

15 years agoremove warn_previous_declaration
Chris Lattner [Sun, 23 Nov 2008 23:20:13 +0000 (23:20 +0000)]
remove warn_previous_declaration

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

15 years agomake the 'to match this' diagnostic a note.
Chris Lattner [Sun, 23 Nov 2008 23:17:07 +0000 (23:17 +0000)]
make the 'to match this' diagnostic a note.

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

15 years agoMake all the 'redefinition' diagnostics more consistent, and make the
Chris Lattner [Sun, 23 Nov 2008 23:12:31 +0000 (23:12 +0000)]
Make all the 'redefinition' diagnostics more consistent, and make the
"previously defined here" diagnostics all notes.

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

15 years agomake some objc redefinition warnings more consistent: call definitions
Chris Lattner [Sun, 23 Nov 2008 22:46:27 +0000 (22:46 +0000)]
make some objc redefinition warnings more consistent: call definitions
"definitions", not declarations.  Point out the location of the
original definition.

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

15 years agoTweak duplicate category diagnostic to work like the duplicate protocol diagnostic.
Chris Lattner [Sun, 23 Nov 2008 22:38:38 +0000 (22:38 +0000)]
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

15 years agoConvert IdentifierInfo's to be printed the same as DeclarationNames
Chris Lattner [Sun, 23 Nov 2008 21:45:46 +0000 (21:45 +0000)]
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

15 years agoadd support for inserting a DeclarationName into a diagnostic directly
Chris Lattner [Sun, 23 Nov 2008 20:28:15 +0000 (20:28 +0000)]
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

15 years agoinserting a qualtype adds quotes implicitly
Chris Lattner [Sun, 23 Nov 2008 20:27:13 +0000 (20:27 +0000)]
inserting a qualtype adds quotes implicitly

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

15 years agoGenericize the qualtype formating callback to support any diag argument.
Chris Lattner [Sun, 23 Nov 2008 09:21:17 +0000 (09:21 +0000)]
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

15 years agoAdd support for sending QualType's directly into diags and convert two
Chris Lattner [Sun, 23 Nov 2008 09:13:29 +0000 (09:13 +0000)]
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

15 years agoother minor edits.
Chris Lattner [Sun, 23 Nov 2008 08:32:53 +0000 (08:32 +0000)]
other minor edits.

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

15 years agominor cleanups.
Chris Lattner [Sun, 23 Nov 2008 08:16:56 +0000 (08:16 +0000)]
minor cleanups.

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

15 years agoAdd out-of-bound memory access warning report code.
Zhongxing Xu [Sun, 23 Nov 2008 05:52:28 +0000 (05:52 +0000)]
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

15 years agoImprove test case.
Zhongxing Xu [Sun, 23 Nov 2008 05:50:21 +0000 (05:50 +0000)]
Improve test case.

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

15 years agoClean up code by using utility methods.
Zhongxing Xu [Sun, 23 Nov 2008 04:30:35 +0000 (04:30 +0000)]
Clean up code by using utility methods.

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

15 years agofinish up the diagnostics documentation. We don't
Chris Lattner [Sun, 23 Nov 2008 00:42:53 +0000 (00:42 +0000)]
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

15 years agomore updates
Chris Lattner [Sun, 23 Nov 2008 00:28:33 +0000 (00:28 +0000)]
more updates

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

15 years agofinish documentation of %select.
Chris Lattner [Sat, 22 Nov 2008 23:50:47 +0000 (23:50 +0000)]
finish documentation of %select.

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

15 years agoReturn false if we encounter a type we can't handle.
Anders Carlsson [Sat, 22 Nov 2008 22:56:32 +0000 (22:56 +0000)]
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

15 years agoFix test cases broken by quote normalization in diagnostics.
Sebastian Redl [Sat, 22 Nov 2008 22:39:41 +0000 (22:39 +0000)]
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

15 years agoAn expression is not foldable if it can't be fully evaluated. Fixes PR3060
Anders Carlsson [Sat, 22 Nov 2008 22:32:07 +0000 (22:32 +0000)]
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

15 years agoImplemented ir-gen for 'implicit' properties using the new AST nodes.
Fariborz Jahanian [Sat, 22 Nov 2008 22:30:21 +0000 (22:30 +0000)]
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

15 years agoDocumentation for the plural modifier.
Sebastian Redl [Sat, 22 Nov 2008 22:16:45 +0000 (22:16 +0000)]
Documentation for the plural modifier.

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

15 years agoCase values must be evaluated
Anders Carlsson [Sat, 22 Nov 2008 21:50:49 +0000 (21:50 +0000)]
Case values must be evaluated

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

15 years agostart documenting Diagnostics. Sebastian, I'd appreciate it
Chris Lattner [Sat, 22 Nov 2008 21:41:31 +0000 (21:41 +0000)]
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

15 years agoconsistently use single quotes for quoted things.
Chris Lattner [Sat, 22 Nov 2008 21:16:43 +0000 (21:16 +0000)]
consistently use single quotes for quoted things.

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

15 years agoUse Expr::Evaluate for case statements. Fixes PR2525
Anders Carlsson [Sat, 22 Nov 2008 21:04:56 +0000 (21:04 +0000)]
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

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