Dmitri Gribenko [Wed, 27 Jun 2012 16:53:58 +0000 (16:53 +0000)]
Remove unsigned and a pointer from a comment token (so that each token can have only one semantic string value attached to it), at a cost of adding an additional token.
Dmitri Gribenko [Wed, 27 Jun 2012 16:30:35 +0000 (16:30 +0000)]
Comment lexer: counting backwards from token end is thought to be confusing. We already have a pointer to the beginning of the token, so use it to extract the text instead.
Chandler Carruth [Wed, 27 Jun 2012 10:06:26 +0000 (10:06 +0000)]
Remove a completely unused and remarkably inaccurate list of test
directories from the cmake file. Dunno what the history is here, but
we're not using it.
Axel Naumann [Wed, 27 Jun 2012 09:17:42 +0000 (09:17 +0000)]
From Vassil Vassilev:
add interface for removing a FileEntry from the cache.
Forces a re-read the contents from disk, e.g. because a tool (like cling) wants to pick up a modified file.
Add a few (currently failing) tests for the PR13207 (template mangling in the presence of back references).
I've added an extra FileCheck pass for that with an extra "CURRENT" prefix.
I've carefully chosed the CURRENT/CORRECT prefixes so they
a) are self-descriptive
b) have the same length so the mangling between the current and the correct version is obvious
Feel free to ask me to change the prefixes if you know a better alternative.
preprocessing: gcc supports #line 0. So, treat this
as a gcc supported extension with usual treatment
with -pedantic (warn) and -pedantic-errors (error).
// rdar://11550996
Manman Ren [Tue, 26 Jun 2012 19:55:09 +0000 (19:55 +0000)]
X86: add GATHER intrinsics (AVX2) in Clang
Support the following intrinsics:
_mm_mask_i32gather_pd, _mm256_mask_i32gather_pd, _mm_mask_i64gather_pd
_mm256_mask_i64gather_pd, _mm_mask_i32gather_ps, _mm256_mask_i32gather_ps
_mm_mask_i64gather_ps, _mm256_mask_i64gather_ps
Rafael Espindola [Tue, 26 Jun 2012 19:18:25 +0000 (19:18 +0000)]
Fix a bug in my previous patch: If we are not doing a virtual call because
the member expression is qualified, call the method specified in the code,
not the most derived one we can find.
Richard Trieu [Tue, 26 Jun 2012 18:18:47 +0000 (18:18 +0000)]
Add template type diffing to Clang. This feature will provide a better
comparison between two templated types when they both appear in a diagnostic.
Type elision will remove indentical template arguments, which can be disabled
with -fno-elide-type. Cyan highlighting is applied to the differing types.
For more formatting, -fdiagnostic-show-template-tree will output the template
type as an indented text tree, with differences appearing inline. Template
tree works with or without type elision.
Rafael Espindola [Tue, 26 Jun 2012 17:45:31 +0000 (17:45 +0000)]
During codegen of a virtual call we would extract any casts in the expression
to see if we had an underlying final class or method, but we would then
use the cast type to do the call, resulting in a direct call to the wrong
method.
block literal irgen: several improvements on naming block
literal helper functions. All helper functions (global
and locals) use block_invoke as their prefix. Local literal
helper names are prefixed by their enclosing mangled function
names. Blocks in non-local initializers (e.g. a global variable
or a C++11 field) are prefixed by their mangled variable name.
The descriminator number added to end of the name starts off
with blank (for first block) and _<N> (for the N+2-th block).
Richard Smith [Tue, 26 Jun 2012 08:12:11 +0000 (08:12 +0000)]
Fix lifetime issue for backing APValue of OpaqueValueExpr in recursive
constexpr function evaluation, and corresponding ASan / valgrind issue in
tests, by storing the corresponding value with the relevant stack frame. This
also prevents re-evaluation of the source of the underlying OpaqueValueExpr,
which makes a major performance difference for certain contrived code (see
testcase update).
David Blaikie [Mon, 25 Jun 2012 21:55:30 +0000 (21:55 +0000)]
PR12937: Explicitly deleting an explicit template specialization.
This works around a quirk in the way that explicit template specializations are
handled in Clang. We generate an implicit declaration from the original
template which the explicit specialization is considered to redeclare. This
trips up the explicit delete logic.
This change only works around that strange representation. At some point it'd
be nice to remove those extra declarations to make the AST more accurately
reflect the C++ semantics.
Jordan Rose [Mon, 25 Jun 2012 20:48:28 +0000 (20:48 +0000)]
[analyzer] Be careful about implicitly-declared operator new/delete. (PR13090)
The implicit global allocation functions do not have valid source locations,
but we still want to treat them as being "system header" functions for the
purposes of how they affect program state.
Richard Smith [Mon, 25 Jun 2012 20:30:08 +0000 (20:30 +0000)]
Unrevert r158887, reverted in r158949, along with a fix for the bug which
resulted in it being reverted. A test for that bug was added in r158950.
Original comment:
If an object (such as a std::string) with an appropriate c_str() member function
is passed to a variadic function in a position where a format string indicates
that c_str()'s return type is desired, provide a note suggesting that the user
may have intended to call the c_str() member.
Factor the non-POD-vararg checking out of DefaultVariadicArgumentPromotion and
move it to SemaChecking in order to facilitate this. Factor the call checking
out of function call checking and block call checking, and extend it to cover
constructor calls too.
Richard Smith [Sun, 24 Jun 2012 23:56:26 +0000 (23:56 +0000)]
Add testing for CommentHandler, and fix a bug where trailing comments in #else
and #endif in non-skipped blocks were not passed to the CommentHandler. Patch
by Andy Gibbs!
Hans Wennborg [Sat, 23 Jun 2012 11:51:46 +0000 (11:51 +0000)]
Support the tls_model attribute (PR9788)
This adds support for the tls_model attribute. This allows the user to
choose a TLS model that is better than what LLVM would select by
default. For example, a variable might be declared as:
__thread int x __attribute__((tls_model("initial-exec")));
if it will not be used in a shared library that is dlopen'ed.
Sean Hunt [Sat, 23 Jun 2012 05:07:58 +0000 (05:07 +0000)]
Clean up a large number of C++11 attribute parse issues, including parsing
attributes in more places where we didn't and catching a lot more issues.
This implements nearly every aspect of C++11 attribute parsing, except for:
- Attributes are permitted on explicit instantiations inside the declarator
(but not preceding the decl-spec)
- Attributes are permitted on friend declarations of functions.
- Multiple instances of the same attribute in an attribute-list (e.g.
[[noreturn, noreturn]], not [[noreturn]] [[noreturn]] which is conforming)
are allowed.
The first two are marked as expected-FIXME in the test file and the latter
is probably a defect and is currently untested.
Thanks to Richard Smith for providing the lion's share of the testcases.
Jordan Rose [Fri, 22 Jun 2012 17:15:58 +0000 (17:15 +0000)]
[analyzer] Check for +raise:format: on subclasses of NSException as well.
We don't handle exceptions yet, so we treat them as sinks. ExprEngine
hardcodes messages that are known to raise Objective-C exceptions like -raise,
but it was only checking for +raise:format: and +raise:format:arguments: on
NSException itself, not subclasses.
Thread safety analysis: fixes a bug in which locksets are not handled
properly if there is a join point in the control flow graph that involves
a trylock. Also changes the source locations of some warnings to be
more consistent.
James Dennett [Fri, 22 Jun 2012 08:10:18 +0000 (08:10 +0000)]
Documentation cleanup:
* Primarily fixed \param commands with names not matching any actual
parameters of the documented functions. In many cases this consists
just of fixing up the parameter name in the \param to match the code,
in some it means deleting obsolete documentation and occasionally it
means documenting the parameter that has replaced the older one that
was documented, which sometimes means some simple reverse-engineering
of the docs from the implementation;
* Fixed \param ParamName [out] to the correct format with [out] before
the parameter name;
* Fixed some \brief summaries.
James Dennett [Fri, 22 Jun 2012 05:59:27 +0000 (05:59 +0000)]
Documentation cleanup:
* Added \file documentation for PPCallbacks.h;
* Added/formated \brief summaries;
* Deleted documentation for parameters that no longer exist;
* Used \param more systematically for documentation of parameters;
* Escaped # characters in Doxygen comments.
James Dennett [Fri, 22 Jun 2012 05:54:32 +0000 (05:54 +0000)]
Documentation cleanup:
* Add \file documentation;
* Add \verbatim...\endverbatim markup as needed;
* Add \brief summaries;
* Escaped "::" in Doxygen comments when preceded by space, to avoid a
Doxygen warning where Doxygen takes this as an explicit link request;
* Add \code...\endcode markup to code examples;
* Fix a grammatical glitch in "is this declarator is a".
James Dennett [Fri, 22 Jun 2012 05:37:13 +0000 (05:37 +0000)]
Documentation cleanup:
* Use \p param for a parameter reference, not the (erroneous) form \arg param;
* Escape # characters in Doxygen comments as needed.
James Dennett [Fri, 22 Jun 2012 05:32:40 +0000 (05:32 +0000)]
Documentation cleanup: Fixed the format of the file header (that I broke in
a recent commit), and eliminated a Doxygen error by changing a comment inside
a function to not be a Doxygen comment.
James Dennett [Fri, 22 Jun 2012 05:20:59 +0000 (05:20 +0000)]
Documentation cleanup:
* Escaped # and < characters in Doxygen comments as needed;
* Fixed up some \brief summaries;
* Marked up some parameter references with \p;
* Added \code...\endcode around code examples;
* Used \returns a little more.
James Dennett [Fri, 22 Jun 2012 05:06:35 +0000 (05:06 +0000)]
Documentation cleanup:
* Made \brief documentation be brief, mostly by adding a blank line to make
the rest of the text be part of the detailed description only;
* Removed "FunctionOrClassName - " and other redundant text from the start
of Doxygen comments.