]> granicus.if.org Git - clang/log
clang
9 years agoclang-format a line containing nothing but a "{". No behavior change.
Nico Weber [Wed, 15 Apr 2015 21:53:00 +0000 (21:53 +0000)]
clang-format a line containing nothing but a "{". No behavior change.

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

9 years agoMake __declspec(selectany) turn variable declartions into definitions.
Nico Weber [Wed, 15 Apr 2015 21:50:06 +0000 (21:50 +0000)]
Make __declspec(selectany) turn variable declartions into definitions.

Fixes PR23242.

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

9 years agoDebugInfo: Pass DebugLocs when creating intrinsics
Duncan P. N. Exon Smith [Wed, 15 Apr 2015 21:18:30 +0000 (21:18 +0000)]
DebugInfo: Pass DebugLocs when creating intrinsics

Update for LLVM API change r235041 that makes `DIBuilder` require a
`DebugLoc` to create a debug info intrinsic.

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

9 years agoFix docs typo in FunctionTemplateSpecializationInfo
Jonathan Roelofs [Wed, 15 Apr 2015 20:47:22 +0000 (20:47 +0000)]
Fix docs typo in FunctionTemplateSpecializationInfo

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

9 years ago[Objective-C Sema]This patch fixes the warning when clang issues
Fariborz Jahanian [Wed, 15 Apr 2015 17:26:21 +0000 (17:26 +0000)]
[Objective-C Sema]This patch fixes the warning when clang issues
"multiple methods named '<selector>' found" warning by noting
the method that is actualy used. It also cleans up and refactors
code in this area and selects a method that matches actual arguments
in case of receiver being a forward class object.
rdar://19265430

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

9 years agoclang-cl: support -fsyntax-only (PR23197)
Hans Wennborg [Wed, 15 Apr 2015 10:02:21 +0000 (10:02 +0000)]
clang-cl: support -fsyntax-only (PR23197)

This might help running Clang tooling (which appends this option)
with clang-cl command-lines.

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

9 years agoChanged test to not brake ARM buildbots, NFC.
Alexey Bataev [Wed, 15 Apr 2015 09:52:50 +0000 (09:52 +0000)]
Changed test to not brake ARM buildbots, NFC.

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

9 years agoRevert "[CodeGen] Fix crash with duplicated mangled name."
Renato Golin [Wed, 15 Apr 2015 08:44:40 +0000 (08:44 +0000)]
Revert "[CodeGen] Fix crash with duplicated mangled name."

This reverts commit r234767, as it was breaking all ARM buildbots for two days and the
assert is not in the code, making it difficult to spot the error, which would keep the
bots red for a few more days. New errors were silently introduced because of this bug,
and we don't want this to escalate.

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

9 years agoclang-format: Determine "in" as a keyword in ObjC for loops more precisely
Daniel Jasper [Wed, 15 Apr 2015 07:26:18 +0000 (07:26 +0000)]
clang-format: Determine "in" as a keyword in ObjC for loops more precisely

Before:
  for (int i = 0; i < in [a]; ++i) ..

After:
  for (int i = 0; i < in[a]; ++i) ..

Also do some related cleanups.

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

9 years ago[OPENMP] Codegen for 'firstprivate' clause in 'for' directive.
Alexey Bataev [Wed, 15 Apr 2015 04:52:20 +0000 (04:52 +0000)]
[OPENMP] Codegen for 'firstprivate' clause in 'for' directive.

Adds proper codegen for 'firstprivate' clause in for directive. Initially codegen for 'firstprivate' clause was implemented for 'parallel' directive only.
Also this patch emits sync point only after initialization of firstprivate variables, not all private variables. This sync point is not required for privates, lastprivates etc., only for initialization of firstprivate variables.
Differential Revision: http://reviews.llvm.org/D8660

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

9 years agoUse concrete type instead of auto in for-loop. No functionality change.
Richard Trieu [Wed, 15 Apr 2015 03:48:48 +0000 (03:48 +0000)]
Use concrete type instead of auto in for-loop.  No functionality change.

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

9 years agouselistorder: Remove dead include
Duncan P. N. Exon Smith [Wed, 15 Apr 2015 03:04:45 +0000 (03:04 +0000)]
uselistorder: Remove dead include

Forgot to remove the include in r234970

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

9 years agouselistorder: -mllvm -preserve-ll-use-list-order => -emit-llvm-uselists
Duncan P. N. Exon Smith [Wed, 15 Apr 2015 02:45:28 +0000 (02:45 +0000)]
uselistorder: -mllvm -preserve-ll-use-list-order => -emit-llvm-uselists

Follow up to r234962, start respecting `-emit-llvm-uselists even for
LLVM assembly.  Note that the driver never passes this flag; this is
just a interface convenience/consistency for those using `-cc1`
directly.  This required LLVM r234969 (and predecessors).

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

9 years agoChange range-based for-loops to be -Wrange-loop-analysis clean.
Richard Trieu [Wed, 15 Apr 2015 01:21:42 +0000 (01:21 +0000)]
Change range-based for-loops to be -Wrange-loop-analysis clean.
No functionality change.

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

9 years agouselistorder: -mllvm -preserve-bc-use-list-order => -emit-llvm-uselists
Duncan P. N. Exon Smith [Wed, 15 Apr 2015 01:16:18 +0000 (01:16 +0000)]
uselistorder: -mllvm -preserve-bc-use-list-order => -emit-llvm-uselists

Stop relying on `cl::opt` to pass along the driver's decision to
preserve use-lists.  Create a new `-cc1` option called
`-emit-llvm-uselists` that does the right thing (when -emit-llvm-bc).
Note that despite its generic name, it *doesn't* do the right thing when
-emit-llvm (LLVM assembly) yet.  I'll hook that up soon.

This doesn't really change the behaviour of the driver.  The default is
still to preserve use-lists for `clang -emit-llvm` and `clang
-save-temps`, and nothing else.  But it stops relying on global state
(and also is a nicer interface for hackers using `clang -cc1`).

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

9 years agoMove the logic to avoid double global emission from Sema to CodeGen
Reid Kleckner [Wed, 15 Apr 2015 01:08:06 +0000 (01:08 +0000)]
Move the logic to avoid double global emission from Sema to CodeGen

Reverts the code changes from r234675 but keeps the test case.

We were already maintaining a DenseMap of globals with dynamic
initializers anyway.

Fixes the test case from PR23234.

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

9 years agouselistorder: Update for LLVM API change in r234959
Duncan P. N. Exon Smith [Wed, 15 Apr 2015 00:36:14 +0000 (00:36 +0000)]
uselistorder: Update for LLVM API change in r234959

Now that `addBitcodeWriterPass()` requires an explicit bit to preserve
use-list order, send it in from `clang`.  It looks like I'll be able to
push this up to the `-cc1` options.

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

9 years agoReland r234613 (and follow-ups 234614, 234616, 234618)
Reid Kleckner [Tue, 14 Apr 2015 20:59:00 +0000 (20:59 +0000)]
Reland r234613 (and follow-ups 234614, 234616, 234618)

The frameescape intrinsic cannot be inlined, so I fixed the inliner in
r234937. This should address PR23216.

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

9 years agoIR: Change clang to set -preserve-bc-uselistorder
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 18:30:13 +0000 (18:30 +0000)]
IR: Change clang to set -preserve-bc-uselistorder

Change `clang` to set `-preserve-bc-uselistorder` for the driver options
`-emit-llvm` and `-save-temps`.  The former is useful for reproducing
results from `clang` in `opt` or `llc`, while the latter prevents
`-save-temps` from affecting the output.  This is part of PR5680.

`-preserve-bc-uselistorder=true` is currently on by default, but a
follow-up commit in LLVM will reverse it.

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

9 years ago[SemaCXX patch] Patch to fix a crash when a 'delete' constructor
Fariborz Jahanian [Tue, 14 Apr 2015 17:21:58 +0000 (17:21 +0000)]
[SemaCXX patch] Patch to fix a crash when a 'delete' constructor
is being accessed. Reviewed by Richard Smith.
rdar://20281011

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

9 years agoUse raw_pwrite_stream in clang.
Rafael Espindola [Tue, 14 Apr 2015 15:15:49 +0000 (15:15 +0000)]
Use raw_pwrite_stream in clang.

This is a small improvement to -emit-pth and allows llvm to start requiring it.

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

9 years agoR600: Add GCC reg names
Tom Stellard [Tue, 14 Apr 2015 14:36:56 +0000 (14:36 +0000)]
R600: Add GCC reg names

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

9 years ago[analyzer] This implements potential undefbehavior.ZeroAllocDereference checker.
Anton Yartsev [Tue, 14 Apr 2015 14:18:04 +0000 (14:18 +0000)]
[analyzer] This implements potential undefbehavior.ZeroAllocDereference checker.

TODO: support realloc(). Currently it is not possible due to the present realloc() handling. Currently RegionState is not being attached to realloc() in case of a zero Size argument.

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

9 years ago[Mips] Generate warning for invalid '-mnan' and '-march' combinations
Petar Jovanovic [Tue, 14 Apr 2015 12:49:08 +0000 (12:49 +0000)]
[Mips] Generate warning for invalid '-mnan' and '-march' combinations

This patch generates a warning for invalid combination of '-mnan' and
'-march' options, it properly sets NaN encoding for a given '-march',
and it passes a proper NaN encoding to the assembler.

Patch by Vladimir Radosavljevic.

Differential Revision: http://reviews.llvm.org/D8170

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

9 years agoRemove useless statement.
Nikola Smiljanic [Tue, 14 Apr 2015 12:33:33 +0000 (12:33 +0000)]
Remove useless statement.

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

9 years ago[OPENMP] Fixed codegen for arrays in 'copyprivate' clause.
Alexey Bataev [Tue, 14 Apr 2015 05:11:24 +0000 (05:11 +0000)]
[OPENMP] Fixed codegen for arrays in 'copyprivate' clause.

Fixed a bug with codegen of variables with array types specified in 'copyprivate' clause of 'single' directive.
Differential Revision: http://reviews.llvm.org/D8914

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

9 years ago[OPENMP] Initial codegen for 'parallel sections' directive.
Alexey Bataev [Tue, 14 Apr 2015 03:29:22 +0000 (03:29 +0000)]
[OPENMP] Initial codegen for 'parallel sections' directive.

Emits code for outlined 'parallel' directive with the implicitly inlined 'sections' directive:

...
call __kmpc_fork_call(..., outlined_function, ...);
...

define internal void outlined_function(...) {
    <code for implicit sections directive>;
}
Differential Revision: http://reviews.llvm.org/D8997

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

9 years agoDebugInfo: Prepare for DISubprogram/DILexicalBlock* to be gutted
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 03:24:14 +0000 (03:24 +0000)]
DebugInfo: Prepare for DISubprogram/DILexicalBlock* to be gutted

An upcoming LLVM commit will remove this API, so stop using it.  Just
access the raw pointers using `operator->()`.

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

9 years agoAdd new warning -Wrange-loop-analysis to warn on copies during loops.
Richard Trieu [Mon, 13 Apr 2015 22:08:55 +0000 (22:08 +0000)]
Add new warning -Wrange-loop-analysis to warn on copies during loops.

-Wrange-loop-analysis is a subgroup of -Wloop-analysis and will warn when
a range-based for-loop makes copies of the elements in the range.  If possible,
suggest the proper type to prevent copies, or the non-reference to help
distinguish copy versus non-copy forms.  Existing warnings in -Wloop-analysis
are moved to -Wfor-loop-analysis, also a subgroup of -Wloop-analysis.

Differential Revision: http://reviews.llvm.org/D4169

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

9 years agoRevert r234613 (and follow-ups 234614, 234616, 234618), it caused PR23216.
Nico Weber [Mon, 13 Apr 2015 20:04:22 +0000 (20:04 +0000)]
Revert r234613 (and follow-ups 234614, 234616, 234618), it caused PR23216.

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

9 years agoRevert r234786, it contained a bunch of stuff I did not mean to commit.
Nico Weber [Mon, 13 Apr 2015 20:03:03 +0000 (20:03 +0000)]
Revert r234786, it contained a bunch of stuff I did not mean to commit.

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

9 years agoRevert r234613 (and follow-ups 234614, 234616, 234618), it caused PR23216.
Nico Weber [Mon, 13 Apr 2015 20:01:20 +0000 (20:01 +0000)]
Revert r234613 (and follow-ups 234614, 234616, 234618), it caused PR23216.

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

9 years ago[CodeGen] Fix crash with duplicated mangled name.
Argyrios Kyrtzidis [Mon, 13 Apr 2015 17:40:46 +0000 (17:40 +0000)]
[CodeGen] Fix crash with duplicated mangled name.

Patch by Yunzhong Gao!

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

9 years ago[libclang] Add functions to get information about fields.
Argyrios Kyrtzidis [Mon, 13 Apr 2015 16:55:04 +0000 (16:55 +0000)]
[libclang] Add functions to get information about fields.

Patch by Loïc Jaquemet!

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

9 years agoclang-format: [JS] Support index signature types.
Daniel Jasper [Mon, 13 Apr 2015 15:03:30 +0000 (15:03 +0000)]
clang-format: [JS] Support index signature types.

Patch by Martin Probst.

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

9 years agoclang-format: [JS] support optionality markers in JS types.
Daniel Jasper [Mon, 13 Apr 2015 15:01:40 +0000 (15:01 +0000)]
clang-format: [JS] support optionality markers in JS types.

Patch by Martin Probst. Thank you.

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

9 years agoclang-format: [JS] Allow periods and commata in class declarations.
Daniel Jasper [Mon, 13 Apr 2015 14:56:54 +0000 (14:56 +0000)]
clang-format: [JS] Allow periods and commata in class declarations.

Patch by Martin Probst. Thank you.

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

9 years agoInstrProf: Simplify getStmtCount by using an Optional
Justin Bogner [Mon, 13 Apr 2015 12:23:19 +0000 (12:23 +0000)]
InstrProf: Simplify getStmtCount by using an Optional

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

9 years agoBring r234620 back now that llvm is fixed.
Rafael Espindola [Mon, 13 Apr 2015 11:14:39 +0000 (11:14 +0000)]
Bring r234620 back now that llvm is fixed.

LLVM can now detect if a fd is seekable on windows.

Original commit message:

Actually check if lseek works instead of using a filename based heuristic.

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

9 years agoReformat.
NAKAMURA Takumi [Mon, 13 Apr 2015 08:43:40 +0000 (08:43 +0000)]
Reformat.

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

9 years agoRevert r234620 and others, "Actually check if lseek works instead of using a filename...
NAKAMURA Takumi [Mon, 13 Apr 2015 08:43:31 +0000 (08:43 +0000)]
Revert r234620 and others, "Actually check if lseek works instead of using a filename based heuristic." It was affected by r234615, which was reverted in r234721.

  r234620, "Actually check if lseek works instead of using a filename based heuristic."
  r234621, "Testcase for the previous commit."
  r234718, "Suppress clang/test/PCH/emit-pth.c on win32, for now while investigating."

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

9 years ago[OPENMP] Initial codegen for 'parallel for' directive.
Alexey Bataev [Mon, 13 Apr 2015 05:28:11 +0000 (05:28 +0000)]
[OPENMP] Initial codegen for 'parallel for' directive.

Allows generation of combined 'parallel for' directive that represents 'parallel' region with internal implicit 'for' worksharing region.
Differential Revision: http://reviews.llvm.org/D8631

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

9 years agoSuppress clang/test/PCH/emit-pth.c on win32, for now while investigating.
NAKAMURA Takumi [Mon, 13 Apr 2015 00:30:23 +0000 (00:30 +0000)]
Suppress clang/test/PCH/emit-pth.c on win32, for now while investigating.

MSVCRT's _lseek(SEEK_CUR) doesn't return -1 for raw_ostream::SupportSeeking.

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

9 years agoclang-cl: Expose -f[no-]diagnostics-color
Hans Wennborg [Sun, 12 Apr 2015 07:12:19 +0000 (07:12 +0000)]
clang-cl: Expose -f[no-]diagnostics-color

If we have -f[no-]color-diagnostics, we might as well have these
too.

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

9 years agoRevert r234581, it might have caused a few miscompiles in Chromium.
Nico Weber [Sat, 11 Apr 2015 23:51:38 +0000 (23:51 +0000)]
Revert r234581, it might have caused a few miscompiles in Chromium.

If the revert helps, I'll get a repro this Monday.  Else I'll put the change
back in.

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

9 years agoDebugInfo: Switch from replaceAllUsesWith() to replaceTemporary()
Duncan P. N. Exon Smith [Sat, 11 Apr 2015 19:05:04 +0000 (19:05 +0000)]
DebugInfo: Switch from replaceAllUsesWith() to replaceTemporary()

Stop using `DIDescriptor`'s wrapper around
`MDNode::replaceAllUsesWith()` (which is going away).  The new home for
this logic is `DIBuilder::replaceTemporary()`, added in LLVM r234695.

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

9 years agoRemove empty non-virtual destructors or mark them =default when non-public
Benjamin Kramer [Sat, 11 Apr 2015 15:58:30 +0000 (15:58 +0000)]
Remove empty non-virtual destructors or mark them =default when non-public

These add no value but can make a class non-trivially copyable. NFC.

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

9 years agoclang/test/CodeGenCXX/static-data-member-single-emission.cpp: Tweak for MS mangler.
NAKAMURA Takumi [Sat, 11 Apr 2015 14:57:11 +0000 (14:57 +0000)]
clang/test/CodeGenCXX/static-data-member-single-emission.cpp: Tweak for MS mangler.

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

9 years agoclang-cl: support -fno-color-diagnostics (PR23109)
Hans Wennborg [Sat, 11 Apr 2015 12:27:56 +0000 (12:27 +0000)]
clang-cl: support -fno-color-diagnostics (PR23109)

Patch by Bernard Solomon, tests by me.

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

9 years agoclang-cl: support -fmacro-backtrace-limit
Hans Wennborg [Sat, 11 Apr 2015 11:44:44 +0000 (11:44 +0000)]
clang-cl: support -fmacro-backtrace-limit

Also fix the test for "core options" to actually fail
in case an option isn't supported.

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

9 years agoAdd Clang support for -mdirect-move on PPC
Nemanja Ivanovic [Sat, 11 Apr 2015 10:43:36 +0000 (10:43 +0000)]
Add Clang support for -mdirect-move on PPC

This patch corresponds to review:
http://reviews.llvm.org/D8930

This just adds a front end option to let the back end know the target has PPC
direct move instructions.

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

9 years agoUse 'override/final' instead of 'virtual' for overridden methods
Alexander Kornienko [Sat, 11 Apr 2015 02:00:23 +0000 (02:00 +0000)]
Use 'override/final' instead of 'virtual' for overridden methods

Summary:
The patch is generated using clang-tidy misc-use-override check.

This command was used:

  tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \
    -checks='-*,misc-use-override' -header-filter='llvm|clang' -j=32 -fix

Reviewers: dblaikie

Reviewed By: dblaikie

Subscribers: klimek, cfe-commits

Differential Revision: http://reviews.llvm.org/D8926

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

9 years agoImprove the error message for assigning to read-only variables.
Richard Trieu [Sat, 11 Apr 2015 01:53:13 +0000 (01:53 +0000)]
Improve the error message for assigning to read-only variables.

Previously, many error messages would simply be "read-only variable is not
assignable"  This change provides more information about why the variable is
not assignable, as well as note to where the const is located.

Differential Revision: http://reviews.llvm.org/D4479

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

9 years agoOnly notify consumers about static data members of class templates once
Reid Kleckner [Sat, 11 Apr 2015 01:25:36 +0000 (01:25 +0000)]
Only notify consumers about static data members of class templates once

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

9 years ago[Driver] Properly support -mglobal-merge using explicit options.
Ahmed Bougacha [Sat, 11 Apr 2015 00:10:44 +0000 (00:10 +0000)]
[Driver] Properly support -mglobal-merge using explicit options.

Follow-up to r234666.  With this, the -m[no-]global-merge options
have the expected behavior. Previously, -mglobal-merge was ignored,
and there was no way of enabling the optimization.

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

9 years agoNaCl ARM: fix assembler float abi flags
Derek Schuff [Fri, 10 Apr 2015 23:07:19 +0000 (23:07 +0000)]
NaCl ARM: fix assembler float abi flags

Summary:
tools::arm::getARMFloatABI() was falling back to guessing soft-float because
it wasn't seeing the GNUEABIHF environment from ComputeEffectivClangTriple
when it was called from gnutools::Assemble::ConstructJob.

Fix by using the effective clang triple in gnutools::Assemble, which now
matches the -triple flag used by cc1 and ClangAs jobs.

Reviewers: jvoung

Subscribers: rengolin, jfb, aemerson, cfe-commits

Differential Revision: http://reviews.llvm.org/D8902

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

9 years agoWorkaround a performance issue with modules + PCH
Ben Langmuir [Fri, 10 Apr 2015 22:25:42 +0000 (22:25 +0000)]
Workaround a performance issue with modules + PCH

More fallout from r228234; when looking up an identifier in a PCH that
imports the Cocoa module on Darwin, it was taking 2 to 5 seconds
because we were hammering the MapVector::erase() function, which is
O(n).  For now, just clear() the contained SmallVector to get back to
0.25 - 0.5 seconds.  This is probably not the long-term fix, because
without modules or without PCH the performance is more like 0.02
seconds.

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

9 years ago[Objective-C Sema] Fixes a typo which did not allow
Fariborz Jahanian [Fri, 10 Apr 2015 22:07:47 +0000 (22:07 +0000)]
[Objective-C Sema] Fixes a typo which did not allow
bridge casting to super class of object's bridge type.
rdar://18311183

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

9 years ago[tblgen] Use StringRef::trim
Benjamin Kramer [Fri, 10 Apr 2015 21:37:21 +0000 (21:37 +0000)]
[tblgen] Use StringRef::trim

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

9 years agoCreate the correct profiling symbol on NetBSD.
Joerg Sonnenberger [Fri, 10 Apr 2015 21:02:53 +0000 (21:02 +0000)]
Create the correct profiling symbol on NetBSD.

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

9 years agoCreate correct platform-specific target for NetBSD PPC64LE.
Joerg Sonnenberger [Fri, 10 Apr 2015 20:53:48 +0000 (20:53 +0000)]
Create correct platform-specific target for NetBSD PPC64LE.

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

9 years agoDon't eagerly typo-correct to a keyword if the next token is a right paren.
Kaelyn Takata [Fri, 10 Apr 2015 19:16:46 +0000 (19:16 +0000)]
Don't eagerly typo-correct to a keyword if the next token is a right paren.

Take advantage of the delayed typo no longer being eagerly corrected to
a keyword to filter out keyword corrections (and other things like
unresolved & overloaded expressions, which have placeholder types) when
correcting typos inside of a decltype().

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

9 years agoTestcase for the previous commit.
Rafael Espindola [Fri, 10 Apr 2015 18:18:17 +0000 (18:18 +0000)]
Testcase for the previous commit.

Sorry, fogot to "git add" the previous time.

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

9 years agoActually check if lseek works instead of using a filename based heuristic.
Rafael Espindola [Fri, 10 Apr 2015 18:16:30 +0000 (18:16 +0000)]
Actually check if lseek works instead of using a filename based heuristic.

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

9 years ago[SEH] Add test for inline functions using SEH helpers
Reid Kleckner [Fri, 10 Apr 2015 18:07:38 +0000 (18:07 +0000)]
[SEH] Add test for inline functions using SEH helpers

Such helpers should always be comdat with the parent function and have
internal linkage.

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

9 years agoReally fix exceptions-seh-finally.c
Reid Kleckner [Fri, 10 Apr 2015 17:53:39 +0000 (17:53 +0000)]
Really fix exceptions-seh-finally.c

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

9 years agoTry to fix exceptions-seh-finally.c
Reid Kleckner [Fri, 10 Apr 2015 17:45:23 +0000 (17:45 +0000)]
Try to fix exceptions-seh-finally.c

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

9 years ago[SEH] Re-land r234532, but use internal linkage for all SEH helpers
Reid Kleckner [Fri, 10 Apr 2015 17:34:52 +0000 (17:34 +0000)]
[SEH] Re-land r234532, but use internal linkage for all SEH helpers

Even though these symbols are in a comdat group, the Microsoft linker
really wants them to have internal linkage.

I'm planning to tweak the mangling in a follow-up change. This is a
straight revert with a 1-line fix.

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

9 years ago[Frontend] Close open file handles before renaming output files
Reid Kleckner [Fri, 10 Apr 2015 17:27:58 +0000 (17:27 +0000)]
[Frontend] Close open file handles before renaming output files

The placement of the 'delete' call that was removed in the unique_ptr
migration in r234597 was not an accident. The raw_ostream has to be
destroyed before you do the rename on Windows, otherwise you get
ERROR_ACCESS_DENIED. We can still use unique_ptr, we just need to do a
manual reset().

Also, range-for-loop-ify this code.

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

9 years agoDon't rely on implicit CallSite construction.
Benjamin Kramer [Fri, 10 Apr 2015 14:49:31 +0000 (14:49 +0000)]
Don't rely on implicit CallSite construction.

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

9 years agoTry to make MSVC happy.
Rafael Espindola [Fri, 10 Apr 2015 14:37:39 +0000 (14:37 +0000)]
Try to make MSVC happy.

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

9 years agoReturn std::unique_ptr to avoid a release and recreate.
Rafael Espindola [Fri, 10 Apr 2015 14:30:43 +0000 (14:30 +0000)]
Return std::unique_ptr to avoid a release and recreate.

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

9 years agoUse a std::unique_ptr to make it easier to see who owns the stream.
Rafael Espindola [Fri, 10 Apr 2015 14:11:52 +0000 (14:11 +0000)]
Use a std::unique_ptr to make it easier to see who owns the stream.

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

9 years agoReturn a pointer instead of having a pointer outparam and a bool return.
Rafael Espindola [Fri, 10 Apr 2015 13:14:31 +0000 (13:14 +0000)]
Return a pointer instead of having a pointer outparam and a bool return.

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

9 years agoInitializing an uninitialized data member; should be NFC.
Aaron Ballman [Fri, 10 Apr 2015 13:05:04 +0000 (13:05 +0000)]
Initializing an uninitialized data member; should be NFC.

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

9 years agoReturn a pointer instead of having a pointer outparam and a bool return.
Rafael Espindola [Fri, 10 Apr 2015 12:54:53 +0000 (12:54 +0000)]
Return a pointer instead of having a pointer outparam and a bool return.

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

9 years agoReduce dyn_cast<> to isa<> or cast<> where possible. Clang edition.
Benjamin Kramer [Fri, 10 Apr 2015 11:37:55 +0000 (11:37 +0000)]
Reduce dyn_cast<> to isa<> or cast<> where possible. Clang edition.

No functional change intended.

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

9 years ago[OPENMP] Codegen for 'reduction' clause in 'parallel' directive.
Alexey Bataev [Fri, 10 Apr 2015 10:43:45 +0000 (10:43 +0000)]
[OPENMP] Codegen for 'reduction' clause in 'parallel' directive.

Emit a code for reduction clause. Next code should be emitted for reductions:

static kmp_critical_name lock = { 0 };

void reduce_func(void *lhs[<n>], void *rhs[<n>]) {
  ...
  *(Type<i> *)lhs[i] = RedOp<i>(*(Type<i> *)lhs[i], *(Type<i> *)rhs[i]);
  ...
}

... void *RedList[<n>] = {&<RHSExprs>[0], ..., &<RHSExprs>[<n> - 1]};
switch (__kmpc_reduce{_nowait}(<loc>, <gtid>, <n>, sizeof(RedList), RedList, reduce_func, &<lock>)) {
case 1:
  ...
  <LHSExprs>[i] = RedOp<i>(*<LHSExprs>[i], *<RHSExprs>[i]);
  ...
  __kmpc_end_reduce{_nowait}(<loc>, <gtid>, &<lock>);
  break;
case 2:
  ...
  Atomic(<LHSExprs>[i] = RedOp<i>(*<LHSExprs>[i], *<RHSExprs>[i]));
  ...
  break;
default:
  ;
}
Reduction variables are a kind of a private variables, they have private copies, but initial values are chosen in accordance with the reduction operation.

Differential Revision: http://reviews.llvm.org/D8915

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

9 years agoRemove threshold for inserting lifetime markers for named temporaries
Arnaud A. de Grandmaison [Fri, 10 Apr 2015 10:13:52 +0000 (10:13 +0000)]
Remove threshold for inserting lifetime markers for named temporaries

Now that TailRecursionElimination has been fixed with r222354, the
threshold on size for lifetime marker insertion can be removed. This
only affects named temporary though, as the patch for unnamed temporaries
is still in progress.

My previous commit (r222993) was not handling debuginfo correctly, but
this could only be seen with some asan tests. Basically, lifetime markers
are just instrumentation for the compiler's usage and should not affect
debug information; however, the cleanup infrastructure was assuming it
contained only destructors, i.e. actual code to be executed, and was
setting the breakpoint for the end of the function to the closing '}', and
not the return statement, in order to show some destructors have been
called when leaving the function. This is wrong when the cleanups are only
lifetime markers, and this is now fixed.

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

9 years agoReverting test commit.
Szabolcs Sipos [Fri, 10 Apr 2015 08:43:58 +0000 (08:43 +0000)]
Reverting test commit.

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

9 years agoTest commit.
Szabolcs Sipos [Fri, 10 Apr 2015 08:42:08 +0000 (08:42 +0000)]
Test commit.

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

9 years ago[OPENMP] Fixed cleanup of OpenMP code.
Alexey Bataev [Fri, 10 Apr 2015 07:48:12 +0000 (07:48 +0000)]
[OPENMP] Fixed cleanup of OpenMP code.

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

9 years agoFix typo in test. There is no %clangcxx, but there is %clangxx.
Nick Lewycky [Fri, 10 Apr 2015 07:43:19 +0000 (07:43 +0000)]
Fix typo in test. There is no %clangcxx, but there is %clangxx.

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

9 years ago[OPENMP] Fixing troubles with lambdas in cleanups.
Alexey Bataev [Fri, 10 Apr 2015 06:33:45 +0000 (06:33 +0000)]
[OPENMP] Fixing troubles with lambdas in cleanups.

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

9 years ago[OPENMP] Fixed incompatibility with MSVC, NFC.
Alexey Bataev [Fri, 10 Apr 2015 05:32:31 +0000 (05:32 +0000)]
[OPENMP] Fixed incompatibility with MSVC, NFC.

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

9 years ago[Sema] Don't assume that an initializer list has an initializer
David Majnemer [Fri, 10 Apr 2015 04:52:06 +0000 (04:52 +0000)]
[Sema] Don't assume that an initializer list has an initializer

Given something like 'int({}, 1)', we would try to emit a diagnostic
regarding the excess element in the scalar initializer.  However, we
assumed that the initializer list had an element in it.

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

9 years ago[OPENMP] Refactoring of codegen for OpenMP directives.
Alexey Bataev [Fri, 10 Apr 2015 04:50:10 +0000 (04:50 +0000)]
[OPENMP] Refactoring of codegen for OpenMP directives.

Refactored API of OpenMPRuntime for compatibility with combined directives.
Differential Revision: http://reviews.llvm.org/D8859

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

9 years agoRevert r234532 for a bit, it very likely caused http://crbug.com/475768
Nico Weber [Fri, 10 Apr 2015 04:33:03 +0000 (04:33 +0000)]
Revert r234532 for a bit, it very likely caused http://crbug.com/475768

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

9 years ago_mm256_blend_epi16 is being cast to __m256d instead of __m256i. Fixing this.
Ekaterina Romanova [Fri, 10 Apr 2015 02:39:45 +0000 (02:39 +0000)]
_mm256_blend_epi16 is being cast to __m256d instead of __m256i. Fixing this.

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

9 years ago[modules] Remove unused MACRO_TABLE record.
Richard Smith [Fri, 10 Apr 2015 02:02:24 +0000 (02:02 +0000)]
[modules] Remove unused MACRO_TABLE record.

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

9 years agoAdd Clang support for remaining integer divide and permute instructions from ISA...
Nemanja Ivanovic [Thu, 9 Apr 2015 23:58:16 +0000 (23:58 +0000)]
Add Clang support for remaining integer divide and permute instructions from ISA 2.06

This patch corresponds to review:
http://reviews.llvm.org/D8398

It adds some builtin functions to access the extended divide and bit permute instructions.

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

9 years ago[Objective-C Sema] It is permissable to bridge cast to 'id'
Fariborz Jahanian [Thu, 9 Apr 2015 23:39:53 +0000 (23:39 +0000)]
[Objective-C Sema] It is permissable to bridge cast to 'id'
of a CFType bridged to some unknown Objective-C type.
rdar://20113785

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

9 years agoUpdate test case for r234543.
Benjamin Kramer [Thu, 9 Apr 2015 22:54:53 +0000 (22:54 +0000)]
Update test case for r234543.

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

9 years ago[CodeGen] Do a more principled fix for PR231653, always use the inner type.
Benjamin Kramer [Thu, 9 Apr 2015 22:50:07 +0000 (22:50 +0000)]
[CodeGen] Do a more principled fix for PR231653, always use the inner type.

We were still using the MaterializeTemporaryExpr's type to check if the
transform is legal. Always use the inner Expr type.

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

9 years agoPropagate usage of std:unique_ptr a bit. NFC.
Rafael Espindola [Thu, 9 Apr 2015 21:50:11 +0000 (21:50 +0000)]
Propagate usage of std:unique_ptr a bit. NFC.

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

9 years agoUpdate for LLVM api changes.
Rafael Espindola [Thu, 9 Apr 2015 21:06:11 +0000 (21:06 +0000)]
Update for LLVM api changes.

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

9 years agoUse Linux sysroot in Driver test case from r234521
Reid Kleckner [Thu, 9 Apr 2015 20:37:38 +0000 (20:37 +0000)]
Use Linux sysroot in Driver test case from r234521

We don't actually need a real Mac sysroot to make the test pass, just a
linker.  This makes the test pass in environments where no ld is on
PATH.

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

9 years ago[SEH] Outline finally blocks using the new variable capture support
Reid Kleckner [Thu, 9 Apr 2015 20:37:24 +0000 (20:37 +0000)]
[SEH] Outline finally blocks using the new variable capture support

WinEHPrepare was going to have to pattern match the control flow merge
and split that the old lowering used, and that wasn't really feasible.

Now we can teach WinEHPrepare to pattern match this, which is much
simpler:
  %fp = call i8* @llvm.frameaddress(i32 0)
  call void @func(iN [01], i8* %fp)

This prototype happens to match the prototype used by the Win64 SEH
personality function, so this is really simple.

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

9 years ago[Sema] Diagnose references to unbound arrays in function definitions
David Majnemer [Thu, 9 Apr 2015 19:53:25 +0000 (19:53 +0000)]
[Sema] Diagnose references to unbound arrays in function definitions

A [*] is only allowed in a declaration for a function, not in its
definition.  We didn't correctly recurse on reference types while
looking for it, causing us to crash in CodeGen instead of rejecting it.

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

9 years agoProperly implement warn_unused_result checking for classes/structs.
Kaelyn Takata [Thu, 9 Apr 2015 19:43:04 +0000 (19:43 +0000)]
Properly implement warn_unused_result checking for classes/structs.

The previous implementation would copy the attribute from the class to
functions that have the class as their return type when the functions
are first declared. This proved to have two flaws:
  1) if the class is forward-declared without the attribute and a
     function or method with the class as a its return type is declared,
     and afterward the class is defined with warn_unused_result, the
     function or method would never inherit the attribute, and
  2) the check simply failed for functions and methods that are part of
     a template instantiation, regardless of whether the class with
     warn_unused_result is part of a specific instantiation or part of
     the template itself (presumably because those function/method
     declaration does not hit the same code path as a non-template one
     and so never inherits the attribute).

The new approach is to instead modify the two places where a function or
method call is checked for the warn_unused_result attribute on the decl
by extending the checks to also look for the attribute on the decl's
return type.

Additionally, the check for return types that have the warn_unused_result
now excludes pointers and references to such types, as such return types do
not necessarily imply a transfer of ownership for the underlying object
being referred to by the return value. This does not change the behavior
of functions that are directly given the warn_unused_result attribute.

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