Commit Graph

57736 Commits

Author SHA1 Message Date
Fariborz Jahanian 890803f5f4 [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

llvm-svn: 235023
2015-04-15 17:26:21 +00:00
Hans Wennborg 5615f6bcd5 clang-cl: support -fsyntax-only (PR23197)
This might help running Clang tooling (which appends this option)
with clang-cl command-lines.

llvm-svn: 234990
2015-04-15 10:02:21 +00:00
Alexey Bataev bcb4a8fe1b Changed test to not brake ARM buildbots, NFC.
llvm-svn: 234988
2015-04-15 09:52:50 +00:00
Renato Golin c640ff63e2 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.

llvm-svn: 234983
2015-04-15 08:44:40 +00:00
Daniel Jasper 2b1865c251 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.

llvm-svn: 234980
2015-04-15 07:26:18 +00:00
Alexey Bataev 69c62a9bdb [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

llvm-svn: 234978
2015-04-15 04:52:20 +00:00
Richard Trieu 20abd6bc04 Use concrete type instead of auto in for-loop. No functionality change.
llvm-svn: 234976
2015-04-15 03:48:48 +00:00
Duncan P. N. Exon Smith fda02091e6 uselistorder: Remove dead include
Forgot to remove the include in r234970

llvm-svn: 234972
2015-04-15 03:04:45 +00:00
Duncan P. N. Exon Smith bb9cadf4eb 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).

llvm-svn: 234970
2015-04-15 02:45:28 +00:00
Richard Trieu b58413323d Change range-based for-loops to be -Wrange-loop-analysis clean.
No functionality change.

llvm-svn: 234964
2015-04-15 01:21:42 +00:00
Duncan P. N. Exon Smith bb61825cd5 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`).

llvm-svn: 234962
2015-04-15 01:16:18 +00:00
Reid Kleckner e07140eb3f 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.

llvm-svn: 234961
2015-04-15 01:08:06 +00:00
Duncan P. N. Exon Smith 58927f1aa2 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.

llvm-svn: 234960
2015-04-15 00:36:14 +00:00
Reid Kleckner ebaf28d13d 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.

llvm-svn: 234942
2015-04-14 20:59:00 +00:00
Duncan P. N. Exon Smith d863f6f250 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.

llvm-svn: 234920
2015-04-14 18:30:13 +00:00
Fariborz Jahanian dcf06f4232 [SemaCXX patch] Patch to fix a crash when a 'delete' constructor
is being accessed. Reviewed by Richard Smith.
rdar://20281011

llvm-svn: 234912
2015-04-14 17:21:58 +00:00
Rafael Espindola 2f16bc1095 Use raw_pwrite_stream in clang.
This is a small improvement to -emit-pth and allows llvm to start requiring it.

llvm-svn: 234897
2015-04-14 15:15:49 +00:00
Tom Stellard 7b1059bb2d R600: Add GCC reg names
llvm-svn: 234892
2015-04-14 14:36:56 +00:00
Anton Yartsev b50f4ba461 [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. 
llvm-svn: 234889
2015-04-14 14:18:04 +00:00
Petar Jovanovic 1dbc317736 [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

llvm-svn: 234882
2015-04-14 12:49:08 +00:00
Nikola Smiljanic 879d1be643 Remove useless statement.
llvm-svn: 234881
2015-04-14 12:33:33 +00:00
Alexey Bataev 420d45b2dd [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

llvm-svn: 234856
2015-04-14 05:11:24 +00:00
Alexey Bataev 68adb7da1a [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

llvm-svn: 234849
2015-04-14 03:29:22 +00:00
Duncan P. N. Exon Smith 87afdeb8f5 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->()`.

llvm-svn: 234848
2015-04-14 03:24:14 +00:00
Richard Trieu 3e1d483e0e 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

llvm-svn: 234804
2015-04-13 22:08:55 +00:00
Nico Weber ad108337cf Revert r234613 (and follow-ups 234614, 234616, 234618), it caused PR23216.
llvm-svn: 234789
2015-04-13 20:04:22 +00:00
Nico Weber f2a39a7b4e Revert r234786, it contained a bunch of stuff I did not mean to commit.
llvm-svn: 234787
2015-04-13 20:03:03 +00:00
Nico Weber b31abb05fb Revert r234613 (and follow-ups 234614, 234616, 234618), it caused PR23216.
llvm-svn: 234786
2015-04-13 20:01:20 +00:00
Argyrios Kyrtzidis 6f1fadf989 [CodeGen] Fix crash with duplicated mangled name.
Patch by Yunzhong Gao!

llvm-svn: 234767
2015-04-13 17:40:46 +00:00
Argyrios Kyrtzidis 2bff5161c4 [libclang] Add functions to get information about fields.
Patch by Loïc Jaquemet!

llvm-svn: 234762
2015-04-13 16:55:04 +00:00
Daniel Jasper d9309774a6 clang-format: [JS] Support index signature types.
Patch by Martin Probst.

llvm-svn: 234754
2015-04-13 15:03:30 +00:00
Daniel Jasper a74f5072e1 clang-format: [JS] support optionality markers in JS types.
Patch by Martin Probst. Thank you.

llvm-svn: 234753
2015-04-13 15:01:40 +00:00
Daniel Jasper 6a5d38d2ee clang-format: [JS] Allow periods and commata in class declarations.
Patch by Martin Probst. Thank you.

llvm-svn: 234752
2015-04-13 14:56:54 +00:00
Justin Bogner 1c21c28b9e InstrProf: Simplify getStmtCount by using an Optional
llvm-svn: 234750
2015-04-13 12:23:19 +00:00
Rafael Espindola 463d4dd6c6 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.

llvm-svn: 234738
2015-04-13 11:14:39 +00:00
NAKAMURA Takumi 5594d7926d Reformat.
llvm-svn: 234731
2015-04-13 08:43:40 +00:00
NAKAMURA Takumi 90a4877e31 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."

llvm-svn: 234730
2015-04-13 08:43:31 +00:00
Alexey Bataev 671605e85b [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

llvm-svn: 234722
2015-04-13 05:28:11 +00:00
NAKAMURA Takumi 73d0280db6 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.

llvm-svn: 234718
2015-04-13 00:30:23 +00:00
Hans Wennborg 7aeeb92a98 clang-cl: Expose -f[no-]diagnostics-color
If we have -f[no-]color-diagnostics, we might as well have these
too.

llvm-svn: 234702
2015-04-12 07:12:19 +00:00
Nico Weber 1c565c31b1 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.

llvm-svn: 234700
2015-04-11 23:51:38 +00:00
Duncan P. N. Exon Smith 497d4d465b 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.

llvm-svn: 234696
2015-04-11 19:05:04 +00:00
Benjamin Kramer 8017237277 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.

llvm-svn: 234689
2015-04-11 15:58:30 +00:00
NAKAMURA Takumi 7b24b0573d clang/test/CodeGenCXX/static-data-member-single-emission.cpp: Tweak for MS mangler.
llvm-svn: 234687
2015-04-11 14:57:11 +00:00
Hans Wennborg bec52353bc clang-cl: support -fno-color-diagnostics (PR23109)
Patch by Bernard Solomon, tests by me.

llvm-svn: 234685
2015-04-11 12:27:56 +00:00
Hans Wennborg c296b045c0 clang-cl: support -fmacro-backtrace-limit
Also fix the test for "core options" to actually fail
in case an option isn't supported.

llvm-svn: 234684
2015-04-11 11:44:44 +00:00
Nemanja Ivanovic 35458c2fe9 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.

llvm-svn: 234683
2015-04-11 10:43:36 +00:00
Alexander Kornienko 34eb20725d 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

llvm-svn: 234678
2015-04-11 02:00:23 +00:00
Richard Trieu af7d76c720 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

llvm-svn: 234677
2015-04-11 01:53:13 +00:00
Reid Kleckner 620d0ce55c Only notify consumers about static data members of class templates once
llvm-svn: 234675
2015-04-11 01:25:36 +00:00