Commit Graph

62348 Commits

Author SHA1 Message Date
Ed Schouten 51bfbe7f2c Enable SafeStack for CloudABI.
Summary:
I've got a patchset in my home directory to integrate support for
SafeStack into CloudABI's C library. All of the CloudABI unit tests
still seem to pass. Pretty sweet!

This change adds the necessary changes to Clang to make
-fsanitize=safe-stack work on CloudABI. Without it, passing this command
line flag throws an error.

Reviewers: eugenis, samsonov

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

llvm-svn: 261135
2016-02-17 18:56:20 +00:00
David Majnemer 2eb74e278d Correct more typos in conditional expressions
We didn't correctly handle some edge cases, causing us to bail out
before correcting all the typos.

llvm-svn: 261109
2016-02-17 17:19:00 +00:00
Alexey Bataev a462b4502f [OPENMP] Fix tests incompatibility with ARM buildbots.
llvm-svn: 261098
2016-02-17 15:36:39 +00:00
Alexey Bataev 417089fc7e [OPENMP 4.5] Codegen support for data members in 'firstprivate' clause.
Added codegen for captured data members in non-static member functions.

llvm-svn: 261089
2016-02-17 13:19:37 +00:00
Anastasia Stulova 5c1a2c5d3e [OpenCL] Added half type literal with suffix h.
OpenCL Extension v1.2 s9.5 allows half precision floating point
type literals with suffices h or H when cl_khr_fp16 is enabled.

Example:  half x = 1.0h;

Patch by Liu Yaxun (Sam)!

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

llvm-svn: 261084
2016-02-17 11:34:37 +00:00
Alexey Bataev 11481f502c [OPENMP] Fix handling loop-based directives with arrays.
Patch fixes possible problems with correct handling arrays as
expressions in initialization, conditions etc in loop-based constructs.

llvm-svn: 261080
2016-02-17 10:29:05 +00:00
Chandler Carruth ce55f56fbc [cmake] Revert r260742 (and r260744) to improve order file support.
This appears to be passing '-Wl,-order_file' to Linux link commands,
which then causes the linker to silently, behind the scenes, write the
output to 'rder_file' instead of somewhere else. Will work with Chris to
figure out the proper support for this, but so far there are numerous
people who can't get Clang to update when they build because of this.

llvm-svn: 261054
2016-02-17 02:13:35 +00:00
Sean Silva 4be470b71b [AttrDocs.td] Fix up some reST syntax.
llvm-svn: 261053
2016-02-17 02:08:19 +00:00
Xinliang David Li 13cf09dc38 Test simplification
llvm-svn: 261047
2016-02-17 00:59:01 +00:00
Xinliang David Li 534ace01ad Restrengthen tests relaxed in r259955
llvm-svn: 261046
2016-02-17 00:58:13 +00:00
Mehdi Amini a7c0940d72 Teach clang to use the ThinLTO pipeline
Summary: Use the new pipeline implemented in D17115

Reviewers: tejohnson

Subscribers: joker.eph, cfe-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 261045
2016-02-17 00:42:20 +00:00
Richard Smith c28aee6a51 Improve diagnostics for ill-formed literal operator declarations.
Patch by Erik Pilkington!

llvm-svn: 261034
2016-02-17 00:04:04 +00:00
Artem Belevich 0a0e54c194 [CUDA] pass debug options to ptxas.
ptxas optimizations are disabled if we need to generate debug info
as ptxas does not accept '-g' otherwise.

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

llvm-svn: 261018
2016-02-16 22:03:20 +00:00
Aaron Ballman cc928c80b4 Missing semicolons are kind of important. Who knew?
llvm-svn: 261009
2016-02-16 21:06:10 +00:00
Aaron Ballman 232e63d00b Add a nullPointerConstant() AST matcher to handle variations of null pointer constants in one matcher.
llvm-svn: 261008
2016-02-16 21:02:23 +00:00
Reid Kleckner 94f127e84a Stop using "template" when printing qualtype names
Summary:
The keyword "template" isn't necessary when
printing a fully-qualified qualtype name, and, in fact,
results in a syntax error if one tries to use it. So stop
printing it.

Reviewers: rsmith, rnk

Subscribers: rnk, klimek, cfe-commits

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

llvm-svn: 261005
2016-02-16 20:34:27 +00:00
Reid Kleckner b75dd0c9a9 Exclude PCH/missing-file.cpp on Windows, it does not pass reliably
Tag the test with "REQUIRES: can-remove-opened-file", which is what we
use for the similar test Modules/explicit-build-missing-file.cpp.

llvm-svn: 260994
2016-02-16 19:16:28 +00:00
Reid Kleckner 4ce625c814 [typo-correction] Apply name specifier corrections when forming a NNS
Previously we would leave behind the old name specifier prefix, which
creates an invalid AST.  Other callers of CorrectTypo update their
CXXScopeSpec objects with the correction specifier if one is present.

llvm-svn: 260993
2016-02-16 19:16:20 +00:00
Nico Weber 8714c125e8 clang-cl: Expose -isystem.
Like cl.exe, clang-cl allows adding system include directories via the
INCLUDE env var.  Having a driver flag for this functionality is useful,
so add this too.

(In the future, we probably also want to have a flag alternative to
VCINSTALLDIR as used in MSVCToolChain::getVisualStudioBinaries(), and
a way to override the registry accesses in MSVCToolChain::getWindowsSDKDir()
-- maybe -ivcroot= and -iwinsdkroot=?).

llvm-svn: 260990
2016-02-16 19:05:50 +00:00
Alexey Bataev c0214e0e87 [OPENMP] Allow to use compound assignment operators.
Loop-based directives allow to use iterators as loop counters. Iterators are allowed to define their own operators. This patch allows to use compound assignment operators for iterators.

llvm-svn: 260957
2016-02-16 12:13:49 +00:00
Alexey Bataev 3392d76081 [OPENMP] Improved handling of pseudo-captured expressions in OpenMP.
Expressions inside 'schedule'|'dist_schedule' clause must be captured in
combined directives to avoid possible crash during codegen. Patch
improves handling of such constructs

llvm-svn: 260954
2016-02-16 11:18:12 +00:00
Argyrios Kyrtzidis e89a179598 [Frontend] Make sure WrapperFrontendAction updates CurrentInput after calling BeginSourceFileAction.
I don't have a test case to add unfortunately.

llvm-svn: 260937
2016-02-16 05:39:33 +00:00
NAKAMURA Takumi 75a18c20b1 clang/test/Driver/ps4-linker-win.c: Tweak substitutions if %PATH% ends with '\\', or lit complains with "parser error".
llvm-svn: 260929
2016-02-16 03:17:13 +00:00
Vedant Kumar 409506ea07 Simplify users of StringRef::{l,r}trim (clang) (NFC)
r260925 introduced a version of the *trim methods which is preferable
when trimming a single kind of character. Update all users in clang.

llvm-svn: 260927
2016-02-16 02:14:44 +00:00
Akira Hatanaka 23c89f359a Remove unnecessary regex in the test cases I fixed in r260496.
llvm-svn: 260921
2016-02-16 00:46:03 +00:00
Tim Northover 3a098c1b9f Darwin: fix stdlib handling when CLANG_DEFAULT_STDLIB is set
I'd accidentally skipped the CMake check in a premature optimisation. I'd also
put the original test in completely the wrong place.

Thanks Jonas Hahnfeld!

llvm-svn: 260898
2016-02-15 16:38:10 +00:00
Andrey Bokhanko c4feaf0272 PR26449: Tests for builtin_classify_type fix
In my previous commit (rL260881) I forget to svn add tests. This commit adds
them.

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

llvm-svn: 260882
2016-02-15 10:44:27 +00:00
Andrey Bokhanko 5f6588ec2d PR26449: Fixes for bugs in __builtin_classify_type implementation
This patch fixes the following bugs in __builtin_classify_type implementation:
1) Support for member functions and fields
2) Same behavior as GCC in C mode (specifically, return integer_type_class for
   enums and pointer_type_class for function pointers and arrays). Behavior in
   C++ mode didn't changed.

Also, it refactors the whole implementation, by replacing a sequence of
if-else-if with a couple of switches.

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

llvm-svn: 260881
2016-02-15 10:39:04 +00:00
Alexey Bataev cd8b6a2cf1 [OPENMP] Remove extra sync barriers for 'firstprivate' clause.
Sync barrier will be emitted after generation of firstprivate variables
only if one of the firstprivate vars is used in lastprivate clause.

llvm-svn: 260877
2016-02-15 08:07:17 +00:00
NAKAMURA Takumi 404d08f470 clangIndex requires LLVMIR as Core, since r260858 uses llvm/IR.
llvm-svn: 260874
2016-02-15 04:29:36 +00:00
Felix Berger cc9df3b9cc Add isAnyPointer() matchers. Register missing matchers.
Summary:
The isAnyPointer() matcher is useful for http://reviews.llvm.org/D15623.

Reviewers: alexfh, klimek

Subscribers: cfe-commits

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

llvm-svn: 260872
2016-02-15 04:00:39 +00:00
Saleem Abdulrasool cfd4553a7c Sema: prevent assertion on stack return checking
In the case that the array indexing itself is within a type dependent context,
bail out of the evaluation.  We would previously try to symbolically evaluate
the expression which would then try to evaluate a non-address expression as an
address, triggering an assertion in Asserts builds.

We only need to consider the array subscript expression itself as in the case
that the base itself being type dependent is handled appropriately in EvalAddr.

Resolves PR26599.

llvm-svn: 260867
2016-02-15 01:51:24 +00:00
Argyrios Kyrtzidis d571908445 [AST/index] Introduce an option 'SuppressTemplateArgsInCXXConstructors' in printing policy.
Enable it for USRs and names when indexing.
Forward references can have different template argument names; including them
makes USRs and names unstable, since the name depends on whether we saw a forward reference or not.

llvm-svn: 260866
2016-02-15 01:32:36 +00:00
Saleem Abdulrasool 9b0ac33457 silence -Wreturn-type warnings
These codepaths would generate warnings with GCC on linux even though the switch
was covered.  Add llvm_unreachable markers to indicate that the switch should be
covered.  NFC.

llvm-svn: 260865
2016-02-15 00:36:52 +00:00
Saleem Abdulrasool 768eb4aa42 Sema: constify EvalAddr, EvalVal
Propagate const throughout these methods as they are non-mutating analyzers of
state.  NFC.

llvm-svn: 260864
2016-02-15 00:36:49 +00:00
Argyrios Kyrtzidis 8756107f93 [test/Index] Set a specific target for the test.
llvm-svn: 260861
2016-02-14 22:38:38 +00:00
Argyrios Kyrtzidis ca741cef3e [index] Factor libclang's functionality to determing the mangled name of symbols into the clangIndex library.
llvm-svn: 260858
2016-02-14 22:30:14 +00:00
Sylvestre Ledru be8f396bde Fix some typos in the clang doc
llvm-svn: 260856
2016-02-14 20:20:58 +00:00
Dimitry Andric 6090739f8d As reported in https://llvm.org/bugs/show_bug.cgi?id=25496, on FreeBSD,
C++ programs compiled for profiling (using `-pg`) should be linked with
`-lc++_p` (or `-lstdc++_p`, depending on the `-stdlib=` setting), not
with the regular C++ libraries.

Add a `FreeBSD::AddCXXStdlibLibArgs()` override to handle this, and add
a test case for it.  While here, extend the test case for the proper
passing of -lm and -lm_p.

Reviewers: compnerd, davide, dws, emaste
Reviewed By: compnerd
Differential Revision: http://reviews.llvm.org/D16264

llvm-svn: 260851
2016-02-14 16:08:20 +00:00
Benjamin Kramer 24c2a9a4e4 Don't leak the ASTUnit when done with testing.
Found by lsan.

llvm-svn: 260850
2016-02-14 13:18:06 +00:00
NAKAMURA Takumi 15c4ce4c50 c-index-test: Fix libdeps corresponding to r260841.
llvm-svn: 260847
2016-02-14 09:19:04 +00:00
Argyrios Kyrtzidis 8513ab6080 [c-index-test] Fix a gcc build error.
llvm-svn: 260844
2016-02-14 07:08:31 +00:00
Argyrios Kyrtzidis 3b72d0f333 [index] Fix gcc builds.
llvm-svn: 260843
2016-02-14 06:53:20 +00:00
Argyrios Kyrtzidis 6fdcb9c590 [index] Enhance c-index-test tool and have it link and test the clangIndex library directly.
llvm-svn: 260842
2016-02-14 06:39:11 +00:00
Argyrios Kyrtzidis 469c1367f1 [index] Allow calling createIndexingAction() without passing another action to wrap over.
llvm-svn: 260841
2016-02-14 06:39:03 +00:00
Samuel Antao 2de62b0c89 [OpenMP] Rename the offload entry points.
Summary:
Unlike other outlined regions in OpenMP, offloading entry points have to have be visible (external linkage) for the device side. Using dots in the names of the entries can be therefore problematic for some toolchains, e.g. NVPTX.

Also the patch drops the column information in the unique name of the entry points. The parsing of directives ignore unknown tokens, preventing several target  regions to be implemented in the same line. Therefore, the line information is sufficient for the name to be unique. Also, the preprocessor printer does not preserve the column information, causing offloading-entry detection issues if the host uses an integrated preprocessor and the target doesn't (or vice versa).

Reviewers: hfinkel, arpith-jacob, carlo.bertolli, kkwli0, ABataev

Subscribers: cfe-commits, fraggamuffin, caomhin

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

llvm-svn: 260837
2016-02-13 23:35:10 +00:00
Argyrios Kyrtzidis e91793c3a3 [AST] Add a print() method in DeclarationName that accepts a PrintingPolicy.
llvm-svn: 260833
2016-02-13 21:46:50 +00:00
Benjamin Kramer 1b5820133f Fix a leak in the generated code for attributes with strings.
Storing std::strings in attributes simply doesn't work, we never call
the destructor. Use an array of StringRefs instead of std::strings and
copy the data into memory taken from the ASTContext.

llvm-svn: 260831
2016-02-13 18:11:49 +00:00
Benjamin Kramer 0bb97746a8 RValue refs do not work that way.
llvm-svn: 260823
2016-02-13 16:00:13 +00:00
Benjamin Kramer 536ffdf51d Don't copy a DenseMap just to do lookup in it.
Also remove the now unused isPodLike specialization. DenseMap only uses
it for copies.

llvm-svn: 260822
2016-02-13 15:49:17 +00:00