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.
Douglas Gregor [Wed, 29 Sep 2010 21:14:36 +0000 (21:14 +0000)]
When performing template argument deduction of a function template
against a function type, be sure to check the type of the resulting
function template specialization against the desired function type
after substituting the deduced/defaulted template arguments. Fixes PR8196.
Douglas Gregor [Wed, 29 Sep 2010 04:25:11 +0000 (04:25 +0000)]
Move the management of the set of conversion functions in a C++ class
into CXXRecordDecl. The only part that we do not handle this way are
using declarations, since that would require extra name lookup that we
don't currently want to pay for. This fixes <rdar://problem/8459981>,
so that LLDB can build a CXXRecordDecl and magically get all of the
right bits set.
Douglas Gregor [Wed, 29 Sep 2010 00:15:42 +0000 (00:15 +0000)]
Move the maintenance of CXXRecordDecl::DefinitionData's Abstract bit
completely into CXXRecordDecl, by adding a new completeDefinition()
function. This required a little reshuffling of the final-overrider
checking code, since the "abstract" calculation in the presence of
abstract base classes needs to occur in
CXXRecordDecl::completeDefinition() but we don't want to compute final
overriders more than one in the common case.
Douglas Gregor [Tue, 28 Sep 2010 20:38:10 +0000 (20:38 +0000)]
Centralize the management of CXXRecordDecl::DefinitionData's Empty bit
in CXXRecordDecl itself. Yes, this is also part of <rdar://problem/8459981>.
This reinstates r114924, with one crucial bug fix: we were ignoring
the implicit fields created by anonymous structs/unions when updating
the bits in CXXRecordDecl, which means that a class/struct containing
only an anonymous class/struct would be considered "empty". Hilarity
follows.
Sebastian Redl [Tue, 28 Sep 2010 20:23:00 +0000 (20:23 +0000)]
Move ExternalSemaSource::ReadMethodPool's implementation to Sema.cpp so that the header can get away with forward declarations only for ObjCMethodList and Selector. Fixes <rdar://8467631>.
Douglas Gregor [Tue, 28 Sep 2010 19:45:33 +0000 (19:45 +0000)]
Reinstate r114921, which I've exonerated via a self-host build.
Centralize the management of CXXRecordDecl::DefinitionData's Aggregate
and PlainOldData bits in CXXRecordDecl itself. Another milepost on the
road toward <rdar://problem/8459981>.
Douglas Gregor [Tue, 28 Sep 2010 17:48:56 +0000 (17:48 +0000)]
When we have two identifiers in a row in Objective-C, make sure to
verify that we aren't in a message-send expression before digging into
the identifier or looking ahead more tokens. Fixes a regression
(<rdar://problem/8483253>) I introduced with bracket insertion.
svn merge -c -114929 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114929 into '.':
U include/clang/Sema/Sema.h
U include/clang/AST/DeclCXX.h
U lib/Sema/SemaDeclCXX.cpp
U lib/Sema/SemaTemplateInstantiateDecl.cpp
U lib/Sema/SemaDecl.cpp
U lib/Sema/SemaTemplateInstantiate.cpp
U lib/AST/DeclCXX.cpp
svn merge -c -114925 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114925 into '.':
G include/clang/AST/DeclCXX.h
G lib/Sema/SemaDeclCXX.cpp
G lib/AST/DeclCXX.cpp
svn merge -c -114924 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114924 into '.':
G include/clang/AST/DeclCXX.h
G lib/Sema/SemaDeclCXX.cpp
G lib/Sema/SemaDecl.cpp
G lib/AST/DeclCXX.cpp
U lib/AST/ASTContext.cpp
svn merge -c -114921 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114921 into '.':
G include/clang/AST/DeclCXX.h
G lib/Sema/SemaDeclCXX.cpp
G lib/Sema/SemaDecl.cpp
G lib/AST/DeclCXX.cpp
Douglas Gregor [Tue, 28 Sep 2010 00:00:00 +0000 (00:00 +0000)]
Centralize the management of CXXRecordDecl::DefinitionData's
HasTrivialConstructor, HasTrivialCopyConstructor,
HasTrivialCopyAssignment, and HasTrivialDestructor bits in
CXXRecordDecl's methods. This completes all but the Abstract bit and
the set of conversion functions, both of which will require a bit of
extra work. The majority of <rdar://problem/8459981> is now
implemented (but not all of it).