]> granicus.if.org Git - clang/log
clang
12 years agoFix for r159256 on Windows.
Axel Naumann [Wed, 27 Jun 2012 11:42:56 +0000 (11:42 +0000)]
Fix for r159256 on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159262 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove a completely unused and remarkably inaccurate list of test
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.

More refactorings to come here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159261 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUpdate the Clang CMake build to reflect the name change in LLVM r159258.
Chandler Carruth [Wed, 27 Jun 2012 09:49:07 +0000 (09:49 +0000)]
Update the Clang CMake build to reflect the name change in LLVM r159258.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159260 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFrom Vassil Vassilev:
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159256 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoInitialize RawComment::BriefTextValid in other constructor, too.
Dmitri Gribenko [Wed, 27 Jun 2012 05:48:36 +0000 (05:48 +0000)]
Initialize RawComment::BriefTextValid in other constructor, too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159253 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIntroduce __has_feature(attribute_unused_on_fields) to determine whether
Daniel Jasper [Wed, 27 Jun 2012 05:12:34 +0000 (05:12 +0000)]
Introduce __has_feature(attribute_unused_on_fields) to determine whether
the current version of clang understands __attribute__((unused)) on
fields.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159252 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd missing words to manual.
Richard Trieu [Wed, 27 Jun 2012 02:36:34 +0000 (02:36 +0000)]
Add missing words to manual.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159251 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd a few (currently failing) tests for the PR13207 (template mangling in the presenc...
Timur Iskhodzhanov [Wed, 27 Jun 2012 02:11:40 +0000 (02:11 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159250 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUpdate documentation with regards to template type diffing.
Richard Trieu [Wed, 27 Jun 2012 02:00:20 +0000 (02:00 +0000)]
Update documentation with regards to template type diffing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159249 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd a few more test cases for the -cxx-abi microsoft mangler. Some of them were broke...
Timur Iskhodzhanov [Wed, 27 Jun 2012 01:38:25 +0000 (01:38 +0000)]
Add a few more test cases for the -cxx-abi microsoft mangler. Some of them were broken recently

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159248 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSimplify logic in BriefParser::Parse(), per Jordan's comment.
Dmitri Gribenko [Wed, 27 Jun 2012 01:17:34 +0000 (01:17 +0000)]
Simplify logic in BriefParser::Parse(), per Jordan's comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159247 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoInitialize RawCommentList::BriefTextValid when deserializing AST.
Dmitri Gribenko [Wed, 27 Jun 2012 00:57:00 +0000 (00:57 +0000)]
Initialize RawCommentList::BriefTextValid when deserializing AST.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159246 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] RetainCountChecker: remove unused SelfOwn ArgEffect kind.
Jordan Rose [Wed, 27 Jun 2012 00:51:18 +0000 (00:51 +0000)]
[analyzer] RetainCountChecker: remove unused SelfOwn ArgEffect kind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159245 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Remove unneeded helper function (it's in ASTContext.h)
Jordan Rose [Wed, 27 Jun 2012 00:51:16 +0000 (00:51 +0000)]
[analyzer] Remove unneeded helper function (it's in ASTContext.h)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159244 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoWhitespace.
Chad Rosier [Tue, 26 Jun 2012 22:30:43 +0000 (22:30 +0000)]
Whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159235 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[Windows] Improve mangling of templates when back references are present
Timur Iskhodzhanov [Tue, 26 Jun 2012 22:29:50 +0000 (22:29 +0000)]
[Windows] Improve mangling of templates when back references are present

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159234 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoEnable -mcpu=native and -march=native for arm targets.
Benjamin Kramer [Tue, 26 Jun 2012 22:20:06 +0000 (22:20 +0000)]
Enable -mcpu=native and -march=native for arm targets.

This is only implemented on linux at the moment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159232 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAlways use getDerived().shouldVisitImplicitCode() so it can be altered
Daniel Jasper [Tue, 26 Jun 2012 22:15:38 +0000 (22:15 +0000)]
Always use getDerived().shouldVisitImplicitCode() so it can be altered
in subclasses.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159231 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoWhitespace.
Chad Rosier [Tue, 26 Jun 2012 21:41:40 +0000 (21:41 +0000)]
Whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159229 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agopreprocessing: gcc supports #line 0. So, treat this
Fariborz Jahanian [Tue, 26 Jun 2012 21:19:20 +0000 (21:19 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159226 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agounit test tweak
Andrew Trick [Tue, 26 Jun 2012 21:15:49 +0000 (21:15 +0000)]
unit test tweak

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159225 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove typedef which is unused after r159189.
Richard Smith [Tue, 26 Jun 2012 20:54:26 +0000 (20:54 +0000)]
Remove typedef which is unused after r159189.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159224 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoImplement a lexer for structured comments.
Dmitri Gribenko [Tue, 26 Jun 2012 20:39:18 +0000 (20:39 +0000)]
Implement a lexer for structured comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159223 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoX86: add GATHER intrinsics (AVX2) in Clang
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159222 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix a bug in my previous patch: If we are not doing a virtual call because
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159219 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove spurious semicolons committed in r159216.
David Blaikie [Tue, 26 Jun 2012 18:52:09 +0000 (18:52 +0000)]
Remove spurious semicolons committed in r159216.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159218 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd template type diffing to Clang. This feature will provide a better
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159216 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMachineBlockPlacement would prefer that clang lay out blocks in source order.
Andrew Trick [Tue, 26 Jun 2012 18:13:12 +0000 (18:13 +0000)]
MachineBlockPlacement would prefer that clang lay out blocks in source order.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159215 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix comment: refer to documentation comments in general, not just Doxygen comments.
Dmitri Gribenko [Tue, 26 Jun 2012 17:54:58 +0000 (17:54 +0000)]
Fix comment: refer to documentation comments in general, not just Doxygen comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159214 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoobjc: adds diagnostic group to several old objc warnings.
Fariborz Jahanian [Tue, 26 Jun 2012 17:47:42 +0000 (17:47 +0000)]
objc: adds diagnostic group to several old objc warnings.
// rdar://11741435 pr13184

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159213 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDuring codegen of a virtual call we would extract any casts in the expression
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159212 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[driver] Make -serialize-diagnostics (one dash) and alias for
Chad Rosier [Tue, 26 Jun 2012 16:57:41 +0000 (16:57 +0000)]
[driver] Make -serialize-diagnostics (one dash) and alias for
--serialize-diagnostics.
rdar://11734800

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159208 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoblock literal irgen: several improvements on naming block
Fariborz Jahanian [Tue, 26 Jun 2012 16:06:38 +0000 (16:06 +0000)]
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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159206 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[asan] add missing asan instrumentation in generated global init functions
Kostya Serebryany [Tue, 26 Jun 2012 08:56:33 +0000 (08:56 +0000)]
[asan] add missing asan instrumentation in generated global init functions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159191 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix lifetime issue for backing APValue of OpaqueValueExpr in recursive
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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159189 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agobuild/compiler-rt: Companion commit to r159172.
Daniel Dunbar [Mon, 25 Jun 2012 23:02:25 +0000 (23:02 +0000)]
build/compiler-rt: Companion commit to r159172.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159174 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoGive L__FUNCTION__ the right type in templates. PR13206.
Nico Weber [Mon, 25 Jun 2012 22:34:48 +0000 (22:34 +0000)]
Give L__FUNCTION__ the right type in templates. PR13206.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159171 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd tests that I wrote for r159060 but forgot to `svn add`.
Nico Weber [Mon, 25 Jun 2012 22:30:41 +0000 (22:30 +0000)]
Add tests that I wrote for r159060 but forgot to `svn add`.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159170 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoARM: enable struct byval for APCS.
Manman Ren [Mon, 25 Jun 2012 22:04:00 +0000 (22:04 +0000)]
ARM: enable struct byval for APCS.

Revert r136662 which disables ARM byval.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159168 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPR12937: Explicitly deleting an explicit template specialization.
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.

Review by Doug Gregor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159167 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoExtend the "expected ';' after struct" logic to also apply to enums, and to
Richard Smith [Mon, 25 Jun 2012 21:37:02 +0000 (21:37 +0000)]
Extend the "expected ';' after struct" logic to also apply to enums, and to
struct and enum forward-declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159164 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUse std::map instead of llvm::DenseMap because we rely on the stability of references...
Eli Friedman [Mon, 25 Jun 2012 21:21:08 +0000 (21:21 +0000)]
Use std::map instead of llvm::DenseMap because we rely on the stability of references to values in these maps. PR13197.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159161 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Be careful about implicitly-declared operator new/delete. (PR13090)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159160 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUnrevert r158887, reverted in r158949, along with a fix for the bug which
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.

Patch by Sam Panzer!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159159 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoThread safety analysis: implement lock_returned attribute.
DeLesley Hutchins [Mon, 25 Jun 2012 18:33:18 +0000 (18:33 +0000)]
Thread safety analysis:  implement lock_returned attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159152 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAppease -Wnon-virtual-dtor and fix a typo in a comment
Matt Beaumont-Gay [Mon, 25 Jun 2012 18:27:11 +0000 (18:27 +0000)]
Appease -Wnon-virtual-dtor and fix a typo in a comment

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159151 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMake explicit specializations at class scope work
Nico Weber [Mon, 25 Jun 2012 17:21:05 +0000 (17:21 +0000)]
Make explicit specializations at class scope work
for non-type template parameters in microsoft mode.
PR12709.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159147 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd test for -Wused-but-marked-unused on private fields.
Daniel Jasper [Mon, 25 Jun 2012 09:19:47 +0000 (09:19 +0000)]
Add test for -Wused-but-marked-unused on private fields.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159130 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd testing for CommentHandler, and fix a bug where trailing comments in #else
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!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159119 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[diagtool] Appease buildbots by explicitly using makeArrayRef.
Jordan Rose [Sun, 24 Jun 2012 00:27:36 +0000 (00:27 +0000)]
[diagtool] Appease buildbots by explicitly using makeArrayRef.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159095 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[diagtool] Add a new "tree" command to shows warnings activated by a flag.
Jordan Rose [Sun, 24 Jun 2012 00:07:45 +0000 (00:07 +0000)]
[diagtool] Add a new "tree" command to shows warnings activated by a flag.

% diagtool tree -Wunused-value
-Wunused-value
  -Wunused-comparison
    warn_unused_comparison
  -Wunused-result
    warn_unused_result
  warn_unused_call
  warn_unused_container_subscript_expr
  warn_unused_expr
  warn_unused_property_expr
  warn_unused_voidptr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159093 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIRGen: Factor v-table generation into the CGCXXABI object.
Charles Davis [Sat, 23 Jun 2012 23:44:00 +0000 (23:44 +0000)]
IRGen: Factor v-table generation into the CGCXXABI object.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159091 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRecognize GNU attributes after 'enum class'. Fixes the libc++ build.
John McCall [Sat, 23 Jun 2012 22:30:04 +0000 (22:30 +0000)]
Recognize GNU attributes after 'enum class'.  Fixes the libc++ build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159089 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoobjective-c: issue deprecation/unavailability warnings for methods called on
Fariborz Jahanian [Sat, 23 Jun 2012 18:39:57 +0000 (18:39 +0000)]
objective-c: issue deprecation/unavailability warnings for methods called on
id <Protocol>. // rdar://11618852

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159084 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd triple to test/Sema/attr-tls_model.c
Hans Wennborg [Sat, 23 Jun 2012 13:16:37 +0000 (13:16 +0000)]
Add triple to test/Sema/attr-tls_model.c

Not all targets support __thread variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159080 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSupport the tls_model attribute (PR9788)
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.

This depends on LLVM r159077.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159078 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoClean up a large number of C++11 attribute parse issues, including parsing
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159072 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSupport L__FUNCTION__ in microsoft mode, PR11789
Nico Weber [Sat, 23 Jun 2012 02:07:59 +0000 (02:07 +0000)]
Support L__FUNCTION__ in microsoft mode, PR11789

Heavily based on a patch from
Aaron Wishnick <aaron.s.wishnick@gmail.com>.

I'll clean up the duplicated function in CodeGen as
a follow-up, later today or tomorrow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159060 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[Windows] Fix mangling of repeated types in the presence of bool and function pointer...
Timur Iskhodzhanov [Sat, 23 Jun 2012 00:54:17 +0000 (00:54 +0000)]
[Windows] Fix mangling of repeated types in the presence of bool and function pointers PR13176,PR13177

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159059 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMicrosoftMangle: Fix mangling of integral constant non-type template arguments in...
Charles Davis [Sat, 23 Jun 2012 00:27:49 +0000 (00:27 +0000)]
MicrosoftMangle: Fix mangling of integral constant non-type template arguments in a class specialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159056 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMinor improvements to some C99 variadic-macro-related diagnostics.
Richard Smith [Fri, 22 Jun 2012 23:59:08 +0000 (23:59 +0000)]
Minor improvements to some C99 variadic-macro-related diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159054 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoImplement initial static analysis inlining support for C++ methods.
Ted Kremenek [Fri, 22 Jun 2012 23:55:50 +0000 (23:55 +0000)]
Implement initial static analysis inlining support for C++ methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159047 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPerform typo correction for base class specifiers.
Kaelyn Uhrain [Fri, 22 Jun 2012 23:37:05 +0000 (23:37 +0000)]
Perform typo correction for base class specifiers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159046 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Teach malloc checker that initWith[Bytes|Characters}NoCopy
Anna Zaks [Fri, 22 Jun 2012 22:42:30 +0000 (22:42 +0000)]
[analyzer] Teach malloc checker that initWith[Bytes|Characters}NoCopy
relinquish memory.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159043 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Remove a statistic - it's too expensive.
Anna Zaks [Fri, 22 Jun 2012 22:24:45 +0000 (22:24 +0000)]
[analyzer] Remove a statistic - it's too expensive.

(Committed in r159038 by mistake.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159040 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer]scan-build: report the total number of steps analyzer performs
Anna Zaks [Fri, 22 Jun 2012 22:08:12 +0000 (22:08 +0000)]
[analyzer]scan-build: report the total number of steps analyzer performs

This would be useful to investigate performance issues.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159038 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Fixup to r158958.
Anna Zaks [Fri, 22 Jun 2012 22:08:09 +0000 (22:08 +0000)]
[analyzer] Fixup to r158958.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159037 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Report the cumulative number of steps the analyzer performs.
Anna Zaks [Fri, 22 Jun 2012 22:08:06 +0000 (22:08 +0000)]
[analyzer] Report the cumulative number of steps the analyzer performs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159036 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMark Doxygen warnings DefaultIgnore.
Dmitri Gribenko [Fri, 22 Jun 2012 20:19:59 +0000 (20:19 +0000)]
Mark Doxygen warnings DefaultIgnore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159026 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agorevert CodeGen support for the alloc_size attribute until we finish the design of...
Nuno Lopes [Fri, 22 Jun 2012 18:01:38 +0000 (18:01 +0000)]
revert CodeGen support for the alloc_size attribute until we finish the design of a more generic metadata node

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159016 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDisable llvm optimizations in a clang test.
Rafael Espindola [Fri, 22 Jun 2012 17:28:01 +0000 (17:28 +0000)]
Disable llvm optimizations in a clang test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159012 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Check for +raise:format: on subclasses of NSException as well.
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.

<rdar://problem/11724201>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159010 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoThread safety analysis: fixes a bug in which locksets are not handled
DeLesley Hutchins [Fri, 22 Jun 2012 17:07:28 +0000 (17:07 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159008 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoCorrect include guard to reflect new directory name
Dmitri Gribenko [Fri, 22 Jun 2012 16:52:11 +0000 (16:52 +0000)]
Correct include guard to reflect new directory name

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159007 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoShow fixit for unqualified calls to methods of dependent bases
Nico Weber [Fri, 22 Jun 2012 16:39:39 +0000 (16:39 +0000)]
Show fixit for unqualified calls to methods of dependent bases
when the calling site is a member function template.

Effectively reverts r111675.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159004 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd a warning about almost-Doxygen trailing comments: //< and /*< ... */
Dmitri Gribenko [Fri, 22 Jun 2012 16:02:55 +0000 (16:02 +0000)]
Add a warning about almost-Doxygen trailing comments: //< and /*< ... */

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159001 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoobjective-c: improve diagnostic when collection expression is
Fariborz Jahanian [Fri, 22 Jun 2012 15:37:00 +0000 (15:37 +0000)]
objective-c: improve diagnostic when collection expression is
not a pointer to a fast-enumerable object. // rdar://11488666

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158998 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd release note about -gline-tables-only flag
Alexey Samsonov [Fri, 22 Jun 2012 11:18:10 +0000 (11:18 +0000)]
Add release note about -gline-tables-only flag

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158989 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDocumentation cleanup: making \param and \returns docs match the code.
James Dennett [Fri, 22 Jun 2012 10:32:46 +0000 (10:32 +0000)]
Documentation cleanup: making \param and \returns docs match the code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158985 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDocumentation cleanup: making \param docs match the code.
James Dennett [Fri, 22 Jun 2012 10:16:05 +0000 (10:16 +0000)]
Documentation cleanup: making \param docs match the code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158982 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDiagnostics cleanup: Fixing \params to match the code.
James Dennett [Fri, 22 Jun 2012 08:52:37 +0000 (08:52 +0000)]
Diagnostics cleanup: Fixing \params to match the code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158981 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDocumentation cleanup:
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158980 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDocumentation cleanup:
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158978 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDocumentation cleanup:
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".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158977 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDocumentation cleanup:
James Dennett [Fri, 22 Jun 2012 05:46:07 +0000 (05:46 +0000)]
Documentation cleanup:
* Add \brief summaries;
* Escape # characters in Doxygen comments;
* Add \code...\endcode markup for code examples;
* Add \verbatim...\endverbatim markup for grammar productions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158976 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDocumentation cleanup:
James Dennett [Fri, 22 Jun 2012 05:43:45 +0000 (05:43 +0000)]
Documentation cleanup:
* Add \brief summaries;
* Escaped # characters in Doxygen comments;
* Added some \see cross-references.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158975 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDocumentation cleanup: Escape @objc* in Doxygen comments.
James Dennett [Fri, 22 Jun 2012 05:41:30 +0000 (05:41 +0000)]
Documentation cleanup: Escape @objc* in Doxygen comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158974 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDocumentation cleanup: rephrase, and so avoid a Doxygen warning.
James Dennett [Fri, 22 Jun 2012 05:40:23 +0000 (05:40 +0000)]
Documentation cleanup: rephrase, and so avoid a Doxygen warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158973 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDocumentation cleanup: escape # characters in Doxygen comments as needed.
James Dennett [Fri, 22 Jun 2012 05:39:17 +0000 (05:39 +0000)]
Documentation cleanup: escape # characters in Doxygen comments as needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158972 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDocumentation cleanup:
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158971 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDocumentation cleanup: escape # characters in Doxygen comments as needed.
James Dennett [Fri, 22 Jun 2012 05:36:05 +0000 (05:36 +0000)]
Documentation cleanup: escape # characters in Doxygen comments as needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158970 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDocumentation cleanup: escape # characters in Doxygen comments as needed.
James Dennett [Fri, 22 Jun 2012 05:35:25 +0000 (05:35 +0000)]
Documentation cleanup: escape # characters in Doxygen comments as needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158969 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDocumentation cleanup: escape \ characters in Doxygen comments as needed.
James Dennett [Fri, 22 Jun 2012 05:33:23 +0000 (05:33 +0000)]
Documentation cleanup: escape \ characters in Doxygen comments as needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158968 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDocumentation cleanup: Fixed the format of the file header (that I broke in
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158967 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDocumentation cleanup:
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158966 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDocumentation cleanup: turn "//" into "///" for a Doxygen comment.
James Dennett [Fri, 22 Jun 2012 05:14:59 +0000 (05:14 +0000)]
Documentation cleanup: turn "//" into "///" for a Doxygen comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158965 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDocumentation cleanup:
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158964 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Malloc: Warn about use-after-free when memory ownership was
Anna Zaks [Fri, 22 Jun 2012 02:04:31 +0000 (02:04 +0000)]
[analyzer] Malloc: Warn about use-after-free when memory ownership was
transfered with dataWithBytesNoCopy.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158958 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[diagtool] Write to llvm::outs() by default instead of llvm::errs()
Jordan Rose [Fri, 22 Jun 2012 00:33:20 +0000 (00:33 +0000)]
[diagtool] Write to llvm::outs() by default instead of llvm::errs()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158954 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd the testcase from pr13168.
Rafael Espindola [Thu, 21 Jun 2012 23:49:18 +0000 (23:49 +0000)]
Add the testcase from pr13168.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158950 91177308-0d34-0410-b5e6-96231b3b80d8