John McCall [Tue, 5 Oct 2010 20:48:15 +0000 (20:48 +0000)]
Teach PopCleanupBlock to correctly handle the possibility of branching through
a EH-only cleanup as part of a fallthrough branch-through. That this happens
for this test case is actually a separate bug.
Douglas Gregor [Tue, 5 Oct 2010 18:37:06 +0000 (18:37 +0000)]
Fix a marvelous chained AST writing bug, where we end up with the
following amusing sequence:
- AST writing schedules writing a type X* that it had never seen
before
- AST writing starts writing another declaration, ends up
deserializing X* from a prior AST file. Now we have two type IDs for
the same type!
- AST writer tries to write X*. It only has the lower-numbered ID
from the the prior AST file, so references to the higher-numbered ID
that was scheduled for writing go off into lalaland.
To fix this, keep the higher-numbered ID so we end up writing the type
twice. Since this issue occurs so rarely, and type records are
generally rather small, I deemed this better than the alternative: to
keep a separate mapping from the higher-numbered IDs to the
lower-numbered IDs, which we would end up having to check whenever we
want to deserialize any type.
Fix a block rewriter bug where copy/dispose entries in
block descriptor for outer block was missing even though
the block was importing objects into its inner blocks.
//rdar://84995992
Douglas Gregor [Tue, 5 Oct 2010 15:41:24 +0000 (15:41 +0000)]
Register the __builtin_va_list_type node when we parse it, rather than
waiting until we think we need it: we didn't catch all of the places
where we actually needed it, and we probably wouldn't ever. Fixes a
C++ PCH crasher.
Douglas Gregor [Tue, 5 Oct 2010 14:55:45 +0000 (14:55 +0000)]
Register the __builtin_va_list_type node when we parse it, rather than
waiting until we think we need it: we didn't catch all of the places
where we actually needed it, and we probably wouldn't ever. Fixes a
C++ PCH crasher.
In Sema's TryRefInitWithConversionFunction, suppress user conversions for the overload candidates.
Fixes an infinite recursion in overload resolution for rdar://8499524.
Many thanks to Doug!
John McCall [Tue, 5 Oct 2010 02:33:56 +0000 (02:33 +0000)]
If we're resolving all outstanding fixups, and there are multiple fixups
for the same destination, then we must potentially rewrite the initial branch
of every fixup. Without this patch, a short-circuit check meant to prevent
a switch case from being redundantly added was preventing later fixups from
being processed. Fixes PR8175 (again).
John McCall [Mon, 4 Oct 2010 23:42:51 +0000 (23:42 +0000)]
In the fragile ObjC ABI, save the caught exception to the side if there are
both @catches and a @finally, because the second call to @objc_exception_try_enter
will clobber the exception slot. Fixes rdar://problem/8440970.
Douglas Gregor [Sat, 2 Oct 2010 23:49:58 +0000 (23:49 +0000)]
When providing a block literal as a code completion for a
function/method argument, include the parameter name and always
include parentheses (even for zero-parameter blocks). Otherwise, the
block literal placeholder '^' can look very weird.
Douglas Gregor [Sat, 2 Oct 2010 22:49:11 +0000 (22:49 +0000)]
Introduce a new libclang function, clang_getCursorDisplayName(), which
produces a simple "display" name that captures the
arguments/parameters for a function, function template, class
template, or class template specialization.
Chris Lattner [Sat, 2 Oct 2010 21:32:59 +0000 (21:32 +0000)]
the mmx intrinsic for pshufw should map to the IR intrinsic, not
to a shufflevector. Otherwise it doesn't turn into a pshufw.
This bug was introduced in the mmx rewrite.
Douglas Gregor [Sat, 2 Oct 2010 21:06:43 +0000 (21:06 +0000)]
When we insert a category (or class extension) into an interface, mark
the interface as having changed since it was originally
serialized. This ensures that we see class extensions/categories in
chained PCH files.
Douglas Gregor [Sat, 2 Oct 2010 19:51:13 +0000 (19:51 +0000)]
Provide proper source location and range information for C++ base
specifier cursors in libclang. FIXME -=2, fixes the rest of
<rdar://problem/8274883>.
Chris Lattner [Sat, 2 Oct 2010 00:09:12 +0000 (00:09 +0000)]
when expanding a builtin, if the argument is required to be a constant,
force it to be a constant instead of emitting with EmitScalarExpr. In
-ftrapv mode, they are not the same.
Douglas Gregor [Fri, 1 Oct 2010 23:55:07 +0000 (23:55 +0000)]
Don't add an imported function into its lexical context until *after*
we've set all of its parameters. Fixes <rdar://problem/8499598>;
thanks to Sean for the diagnosis.
we used to get:
fatal error: error in backend: Cannot yet select: intrinsic %llvm.x86.sse2.psll.dq
now we get:
/Users/sabre/t.c:4:11: error: argument to '__builtin_ia32_pslldqi128' must be a
constant integer
white2 = _mm_slli_si128(white2, N);
^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /Users/sabre/t.c:1:
/Volumes/Projects/cvs/llvm/Debug+Asserts/lib/clang/2.9/include/emmintrin.h:781:13: note: instantiated from:
((__m128i)__builtin_ia32_pslldqi128((__m128i)(VEC), (IMM)*8))
^ ~~~~~~~
1 error generated.
Gabor Greif [Fri, 1 Oct 2010 22:05:14 +0000 (22:05 +0000)]
Factor out enumerator APSInt adjustment into
a helper function (AdjustAPSInt) and use that
for adjusting the high bounds of case ranges
before APSInt comparisons. Fixes
http://llvm.org/bugs/show_bug.cgi?id=8135
Douglas Gregor [Fri, 1 Oct 2010 20:25:15 +0000 (20:25 +0000)]
Extend libclang with an API that determines, given a C++ virtual
member function or an Objective-C method, which other member
functions/methods it overrides.
Chris Lattner [Fri, 1 Oct 2010 07:13:18 +0000 (07:13 +0000)]
Various builtins a require an integer constant. Not providing
one results in an obscure error from the backend that doesn't make
sense. Capture this information in the .def files for builtins with
a new "I" modifier letter indicating the an argument needs to be an ICE.
Nothing uses this yet, but sema will eventually enforce this (eliminating
some special cases from semachecking.cpp) and codegen will use this to
force an ICE value, preventing backend error messages.
Chris Lattner [Fri, 1 Oct 2010 06:52:23 +0000 (06:52 +0000)]
the second argument to __builtin_ia32_pslldqi128 must be an immediate,
so it needs to be called from a macro, not a function. This is a necessary
but insufficient step towards fixing PR8221
Zhongxing Xu [Fri, 1 Oct 2010 02:47:11 +0000 (02:47 +0000)]
The old logic would add non-struct and non C++ struct variables to the local
scope. Now we only add C++ struct with non-trivial destructor variables to the
local scope.
Douglas Gregor [Fri, 1 Oct 2010 01:18:02 +0000 (01:18 +0000)]
If we get a TU_CONTEXT update from a chained PCH file before we
actually have an ASTContext, delay the processing of that
update. Patch by Sebastian Redl! Fixes <rdar://problem/8499034>.
Douglas Gregor [Fri, 1 Oct 2010 01:03:07 +0000 (01:03 +0000)]
When an identifier that has a macro definition in the original PCH
file is somehow changed in a chained PCH file, make sure that we write
out the macro definition. Fixes part of <rdar://problem/8499034>.
Added:
- Adding LocalScope for CompoundStmt,
- Adding CFGAutomaticObjDtors for end of scope, return, goto, break, continue,
- Regression tests for above cases.
Daniel Dunbar [Thu, 30 Sep 2010 20:39:47 +0000 (20:39 +0000)]
c-index-test: Run inside a separate thread iff we have pthread support, to
ensure we at least get some minimal testing of running in a multithreaded
environment (for example, having a reduced stack size).
Introduce -flimit-debug-info.
In this experimental mode try avoiding debug info emission for classes as much as possible. The goal is to reduce size of produced debuginfo without reducing quality of debug info in general. This is a work in progress.
Support implicit includes when generating a PCH and allow the user to pass a -include on the command line following the PCH include.
Fixes rdar://7382084.
Marcin Swiderski [Thu, 30 Sep 2010 07:41:24 +0000 (07:41 +0000)]
Added two new command line arguments:
-cfg-add-implicit-dtors - sets CFG::BuildOptions::AddImplicitDtors for AnalysisCosumer to true,
-cfg-add-initializers - sets CFG::BuildOptions::AddInitializers for AnalysisCosumer to true.
Tom Care [Thu, 30 Sep 2010 01:12:05 +0000 (01:12 +0000)]
Updated scan-build:
- Idempotent operations are on by default, to match --analyze in the driver.
- Integrated stats calculation based on parsing warnings emitted with the -analyzer-stats flag. The new -stats flag enables this.
- New -maxloop flag to pass down a maxloop value to the analyzer.
Change CheckerVisitor so that [Pre,Post]VisitCallExpr only handles CallExprs for simple C functions, not
all CallExprs (including CXXMemberCallExpr, etc.). Now the generic handler for all CallExprs is [Pre,Post]VisitGenericCallExpr.
Also add [Pre,Post]Visit hooks for CXXMemberCallExpr.
Change GRExprEngine::VisitCXXMemberCallExpr() to do pre/post checker visits of the call.
Tom Care [Wed, 29 Sep 2010 23:48:34 +0000 (23:48 +0000)]
AnalyzerStatsChecker improvements:
- Use BlockEntrance rather than BlockEdge to bring in line with UnreachableCodeChecker. Fixes an issue where unreached blocks would still be counted as reachable.
- Added warnings for all BlockAborted locations. This allows us to see where the analyzer stopped analyzing.