Bob Wilson [Tue, 16 Nov 2010 00:32:24 +0000 (00:32 +0000)]
Add support for "neon_vector_type" and "neon_polyvector_type" attributes
to create the special Neon vector types. These are intended to be used in
Clang's version of <arm_neon.h> to define special Neon vector types that will
be mangled according to ARM's ABI.
Bob Wilson [Tue, 16 Nov 2010 00:32:20 +0000 (00:32 +0000)]
ASTContext::getVectorType should preserve the vector kind for canonical types.
This is needed for Neon types when it is most natural to define them in terms
of a typedef. For example, Neon poly8_t is a typedef for "signed char", and
we want to define polynomial vectors as vectors of that typedef. Without this
change, the result will be a generic GCC-style vector. I think this is safe
for other vector types as well, but I would appreciate a review of this.
Bob Wilson [Tue, 16 Nov 2010 00:32:18 +0000 (00:32 +0000)]
Change CXXNameMangler::mangleNeonVectorType to require the vector type to be
one of the special Neon types. We'll check for invalid Neon vectors when
they are created, so there's no point in handling them when mangling.
John McCall [Mon, 15 Nov 2010 23:31:06 +0000 (23:31 +0000)]
Add a new expression kind, OpaqueValueExpr, which is useful for
certain internal type-checking procedures as well as for representing
certain implicitly-generated operations. Uses to follow.
Douglas Gregor [Mon, 15 Nov 2010 23:00:34 +0000 (23:00 +0000)]
Tweak libclang's heuristics for building precompiled preambles and
caching global code-completion results. In particular, don't perform
either operation the first time we parse, but do both after the first
reparse.
Ted Kremenek [Mon, 15 Nov 2010 22:59:22 +0000 (22:59 +0000)]
Remove invalid assertion from CFG builder. When building the CFG pieces for a ternary '?' expression,
it is possible for the confluence block to only have a single predecessor due to calls to 'noreturn'
functions. Fixes assertion failure reported in PR 8619.
Ted Kremenek [Mon, 15 Nov 2010 22:23:24 +0000 (22:23 +0000)]
Annotate CursorVisitor::VisitDataRecursive() with attribute 'noinline'.
Clang currently uses a ridiculous amount of stack space when inlining
this function, which can lead to premature stack overflows.
Ted Kremenek [Mon, 15 Nov 2010 20:09:42 +0000 (20:09 +0000)]
Relax assertion in SValuator so that we don't crash when analyzing a call via a function pointer that
casts the return value to something completely different. While we need better reasoning here,
we should definately not crash.
Rafael Espindola [Mon, 15 Nov 2010 18:28:16 +0000 (18:28 +0000)]
Fixes PR8611.
Silence warning about -g not being used during linking. I couldn't find any
change in behavior in gcc liking when given -g. Please open another bug if
I missed something.
Douglas Gregor [Mon, 15 Nov 2010 15:41:16 +0000 (15:41 +0000)]
Implement C++0x [temp.func.order]p3 (aka DR532) properly. In
particular, we only add the implement object parameter type if only
one of the function templates is a non-static member function
template.
Moreover, since this DR differs from existing practice in C++98/03,
this commit implements the existing practice (which ignores the
first parameter of the function template that is not the non-static
member function template) in C++98/03 mode.
Chandler Carruth [Mon, 15 Nov 2010 07:15:26 +0000 (07:15 +0000)]
Clean up some names and fix the handling of default sysroots on Windows and
other platforms where the textual default of '/' isn't the system's root
directory. We should probably still make the textual default platform specific,
but this should avoid the particularly bad problem with the previous state: we
applied a sysroot of '/' to '/usr/local/google' which added
'//usr/local/include' to the windows header search path, a share on another
machine named 'usr'. Oops.
Ted Kremenek [Sun, 14 Nov 2010 17:47:35 +0000 (17:47 +0000)]
"Fix" some unintentional fallout from converting
the Stmt* visitation in CursorVisitor to be
data-recursive.
Since AnnotationTokensWorker explicitly calls
CursorVisitor::VisitChildren(), it essentially
transforms the data-recursive algorithm in
CursorVisitor back into a non-data recursive one.
This is particularly bad because the data-recursive
algorithm uses more stack space per stack frame,
which can cause us to blow the stack in some cases.
"Fix" this by making the stack that AnnotationTokensWorker
runs in really huge. The real fix is to modify
AnnotationTokensWorker not to do the explicit
recursive call.
Ted Kremenek [Sun, 14 Nov 2010 17:04:23 +0000 (17:04 +0000)]
Clean up initialization of LangOptions object by splitting part of it into a parent class
'LangOptionsBase' that default initializes all flags to 0. Now the ctor of LangOptions
only initializes the flags that might be non-zero (significantly simplifying things).
This also appeases Valgrind on Mac OS X, which no longer reports that one of the flags
may be uninitialized.
Zhongxing Xu [Sun, 14 Nov 2010 15:23:50 +0000 (15:23 +0000)]
Revert r118991.
Elidable CXXConstructExpr should inhibit calling destructor for temporary
that is copied, not the one created. This is because eliding copy constructor
means that the object that was to be copied will be constructed directly in
memory the copy would be constructed in.
John McCall [Sun, 14 Nov 2010 09:40:28 +0000 (09:40 +0000)]
Always emit full loads from volatile complex l-values.
Return the result of a complex assignment with the original values,
not by performing a load from the l-value; this is the correct
semantics in C, although not in C++.
John McCall [Sun, 14 Nov 2010 08:17:51 +0000 (08:17 +0000)]
Add a few more complex-related cast kinds that arise due to arbitrary
implicit conversions; the last batch was specific to promotions.
I think this is the full set we need. I do think dividing the cast
kinds into floating and integral is probably a good idea.
Annotate a *lot* more C casts with useful cast kinds.
Block API patch to do copy ctor of copied-in cxx objects in
copy helper function and dtor of copied cxx objects
in dispose helper functions. __block variables
TBD next.
Douglas Gregor [Sat, 13 Nov 2010 19:36:57 +0000 (19:36 +0000)]
When we're type-checking the result of calling a conversion function
(while computing user conversion sequences), make sure that a result
of class type is a complete class type. Had we gone through
ActOnCallExpr, this would have happened when we built the CallExpr.
John McCall [Sat, 13 Nov 2010 05:51:15 +0000 (05:51 +0000)]
Pre-compute all possible usual-arithmetic-conversions results for the
promoted arithmetic types for which builtin operator candidates are
emitted. A few of these need further analysis.
Removes all the uses of UsualArithmeticConversionsType except the
core function in SemaExpr.cpp.
Ted Kremenek [Sat, 13 Nov 2010 05:04:52 +0000 (05:04 +0000)]
Teach IdempotentOperations::PathWasCompletelyAnalyzed to also consider items remaining in the
worklist that could have impacted the evaluation of a block.
Ted Kremenek [Sat, 13 Nov 2010 05:04:49 +0000 (05:04 +0000)]
Add GRWorkList::VisitItemsInWorkList() to allow a client to introspect the contents of a worklist.
This API required changing the BFS worklist to use a deque instead of a queue, but that is better
for performance reasons anyway.
Bob Wilson [Fri, 12 Nov 2010 17:24:52 +0000 (17:24 +0000)]
Increase VectorTypeBitfields::VecKind field from 2 to 3 bits.
With the addition of 2 enum values for Neon vectors, this field must now
hold 6 different values and so requires 3 bits. Make the NumElements field
one bit smaller to compensate.
John McCall [Fri, 12 Nov 2010 08:19:04 +0000 (08:19 +0000)]
Replace one hack with a different hack: strip out the ObjectType
parameters to the Transform*Type functions and instead call out
the specific cases where an object type and the unqualified lookup
results are important. Fixes an assert and failed compile on
a testcase from PR7248.
Douglas Gregor [Fri, 12 Nov 2010 07:15:47 +0000 (07:15 +0000)]
Make sure to always check the result of
SourceManager::getPresumedLoc(), so that we don't try to make use of
an invalid presumed location. Doing so can cause crashes.
Ted Kremenek [Fri, 12 Nov 2010 04:25:07 +0000 (04:25 +0000)]
Fix use of an uninitialized SourceLocation because DeclarationNameLoc failed to completely zero-initialize itself.
Now we explicitly memset all of its values.
This bug was uncovered by the 'Index/recursive-cxx-member-calls.cpp', which exhibited an assertion
on an i386 darwin build of clang. Adding this test case back since the assertion is now resolved.