Daniel Dunbar [Tue, 25 Nov 2008 23:05:24 +0000 (23:05 +0000)]
Only call TryAnnotateScopeToken when parsing C++.
- This improves -parse-noop of Carbon.h by +2%, and I believe
compensates for the majority of the performance regression in r58913.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.