Chris Lattner [Mon, 26 Jan 2009 06:49:09 +0000 (06:49 +0000)]
Bitmangle file characteristic bits into the low bits of
the content cache pointer. This saves 105876 bytes on
cocoa.h because it shrinks the SLocEntry union, which
we have a big array of. It would be nice to use
PointerIntPair here, but we can't because it is in a
union.
Chris Lattner [Mon, 26 Jan 2009 04:33:10 +0000 (04:33 +0000)]
eagerly resolve the spelling locations of macro argument preexpansions.
This reduces fsyntax-only time on c99-intconst-1.c from 2.43s down to
2.01s (20%), reducing the number of fileid lookups from 2529040 linear
and 64771121 binary to 5625902 linear and 4151182 binary.
This knocks getFileID down to only 4.6% of compile time on this testcase.
At this point, malloc/free is over 35% of compile time, primarily allocating
MacroArgs objects and their argument preexpansion vectors.
I don't feel like malloc avoiding right now, so I'm just going to call
this good.
Chris Lattner [Mon, 26 Jan 2009 04:06:48 +0000 (04:06 +0000)]
Eagerly resolve the spelling location of the tokens in a definition
of a macro. Since these tokens may themselves be from macro
expansions, we need to resolve down to the spelling loc when the
macro ends up being instantiated. Instead of resolving this for
each token expanded from the macro definition, just do it once when
the macro is defined. This speeds up clang on c99-intconst-1.c from
2.66s to 2.43s (9.5%), reducing the FileID lookups from 407244 linear and 114175649 binary to 2529040 linear and 64771121 binary.
Chris Lattner [Mon, 26 Jan 2009 03:46:22 +0000 (03:46 +0000)]
Only resolve a macro's instantiation loc once per macro, instead of once
per token lexed from it. This speeds up clang on c99-intconst-1.c from
the GCC testsuite from 3.64s to 2.66s (36%). This reduces the number of
binary search FileID lookups from 251570522 to 114175649 on this testcase.
Eli Friedman [Sun, 25 Jan 2009 02:32:41 +0000 (02:32 +0000)]
Rename Expr::isConstantExpr to Expr::isConstantInitializer; this more
accurately states what the function is trying to do and how it is
different from Expr::isEvaluatable. Also get rid of a parameter that is both
unused and inaccurate.
Eli Friedman [Sun, 25 Jan 2009 01:54:01 +0000 (01:54 +0000)]
Make the constant folder aware of
__builtin___CFStringMakeConstantString. (We get into trouble in
GenerateStaticBlockVarDecl if the constant folder isn't accurate.)
Eli Friedman [Sat, 24 Jan 2009 23:09:00 +0000 (23:09 +0000)]
PR3062: statement expressions should be illegal at file scope. I don't
think this has any significant effects at the moment, but it could
matter if we start constant-folding statement expressions like gcc does.
Chris Lattner [Sat, 24 Jan 2009 21:53:27 +0000 (21:53 +0000)]
add initial support for the gcc "alignof(decl) is the alignment of the decl
not the type" semantics. This can definitely be improved, but is better than
what we had.
Ted Kremenek [Sat, 24 Jan 2009 00:55:43 +0000 (00:55 +0000)]
More hacking on static analyzer diagnostics. When emitting summary diagnostics the code paths for diagnostics involving paths or single locations are now unified. This patch also constifies many arguments/methods that are touched by this logic, leading to a nice overall code cleanup.
Ted Kremenek [Fri, 23 Jan 2009 20:52:26 +0000 (20:52 +0000)]
Added clang option '--analyzer-display-progress' to indicate that the analyzer should output 'ANALYZE:' messages to display its progress on a source file.
Ted Kremenek [Fri, 23 Jan 2009 20:28:53 +0000 (20:28 +0000)]
Added virtual method DiagnosticClient::IncludeInDiagnosticCounts(). This is used by Diagnostics to determine if a diagnostic sent to a given DiagnosticClient should be included in the count of diagnostics. The default implementation of this method returns 'true'.
Implemented DiagCollector::IncludeInDiagnosticCounts() to return 'false' so that the batching of diagnostics for use with BugReporter doesn't mess up the count of real diagnostics.
Daniel Dunbar [Fri, 23 Jan 2009 20:08:16 +0000 (20:08 +0000)]
ccc: Finish definition of long argument translations.
- However, these last ones do not actually work; the issue is that
they translate to batches of options and need to be reparsed. For
now we just give an unsupported error on them.
Daniel Dunbar [Fri, 23 Jan 2009 18:51:09 +0000 (18:51 +0000)]
Handle pointer arithmetic on function pointers.
- <rdar://problem/6518844> Clang-generated bitcode crashes LLVM while compiling function pointer addition expression
Chris Lattner [Fri, 23 Jan 2009 18:35:48 +0000 (18:35 +0000)]
This is a follow-up to r62675:
Refactor how the preprocessor changes a token from being an tok::identifier to a
keyword (e.g. tok::kw_for). Instead of doing this in HandleIdentifier, hoist this
common case out into the caller, so that every keyword doesn't have to go through
HandleIdentifier. This drops time in HandleIdentifier from 1.25ms to .62ms, and
speeds up clang -Eonly with PTH by about 1%.
Douglas Gregor [Fri, 23 Jan 2009 16:23:13 +0000 (16:23 +0000)]
Handle any undeclared parameters in a K&R-style function with a
special action, inside function prototype scope. This avoids confusion
when we try to inject these parameters into the scope of the function
body before the function itself has been added to the surrounding
scope. Fixes <rdar://problem/6097326>.
Daniel Dunbar [Fri, 23 Jan 2009 00:54:03 +0000 (00:54 +0000)]
ccc: Add support for several more aliases (--ansi, --assemble,
--assert, --classpath).
- Requires providing some option parameters to over-ride rendering in
order to match gcc. There may be a cleaner way to do this (probably
by introducing a new option type for long JoinedOrSeparate forms).
Daniel Dunbar [Fri, 23 Jan 2009 00:39:52 +0000 (00:39 +0000)]
ccc: Darwin/x86/link: Fix a few incompatibilities with gcc (missed
forwarding -s to linker, and was only taking last arg in some cases
when should have been taking all).
Daniel Dunbar [Fri, 23 Jan 2009 00:14:46 +0000 (00:14 +0000)]
ccc: Add support for "alias" options.
- Unlike groups (which gather distinct but related options), aliases
are for options like '--all-warnings' which are effectively treated
like some other option ('-Wall') both in the driver logic and when
passing to tools.
Ted Kremenek [Thu, 22 Jan 2009 23:56:56 +0000 (23:56 +0000)]
For now, return UnknownVal() in RegionStore::getElementsSize() for AnonTypedRegions. It wasn't really doing the right thing and was crashing on rdar-6442306-1.m. This fix causes all path-sensitive test cases to pass with RegionStore.
Ted Kremenek [Thu, 22 Jan 2009 23:43:57 +0000 (23:43 +0000)]
Add RegionStore support for the implicit object region that 'self' references. This causes tests 'ObjCProperties.m' and 'refcnt_naming.m' to now pass with RegionStore.
Douglas Gregor [Thu, 22 Jan 2009 23:26:18 +0000 (23:26 +0000)]
Reimplement the handling of the "current object" in designator
initializers, so that we are within the appropriate subobject after
we've processed a multi-designator designation. We're matching GCC and
EDG's behavior on all examples I've found thus far.
*Huge* thanks to Eli Friedman for pointing out my fundamental
misunderstanding of "current object" in the C99 spec.