Commit Graph

71095 Commits

Author SHA1 Message Date
Erik Verbruggen 4d1eb2d5cb [preamble] Also record the "skipping" state of the preprocessor
When a preamble ends in a conditional preprocessor block that is being
skipped, the preprocessor needs to continue skipping that block when
the preamble is used.

This fixes PR34570.

llvm-svn: 317308
2017-11-03 09:40:07 +00:00
Justin Lebar 648f4cad52 [CUDA] Mark CUDA as a no-errno platform.
Summary:
CUDA doesn't support errno at all, so this is the right thing -- or at
least, in the right direction.

But also, this unbreaks the CUDA test-suite math tests [0] after D39481.
__cuda_cmath.h forwards nexttoward() to __builtin_nexttoward, which,
after that patch, was lowering to a libcall that doesn't exist in NVPTX.

[0] http://lab.llvm.org:8011/builders/clang-cuda-build/builds/14999

Reviewers: tra

Subscribers: sanjoy, cfe-commits

Differential Revision: https://reviews.llvm.org/D39586

llvm-svn: 317297
2017-11-03 02:30:00 +00:00
Richard Smith e124612eda [c++17] Visit class template explicit specializations just like all other class definitions in codegen.
If an explicit specialization has a static data member, it may be a definition and we may need to register it for emission.

llvm-svn: 317296
2017-11-03 01:26:01 +00:00
George Karpenkov 85a34aa21e [analyzer] [NFC] very minor ExprEngineC refactoring
Differential Revision: https://reviews.llvm.org/D39577

llvm-svn: 317294
2017-11-03 00:41:29 +00:00
George Karpenkov 0354483013 [analyzer] do not crash on libcxx03 call_once implementation
Addresses https://bugs.llvm.org/show_bug.cgi?id=35075, rdar://35230961

Differential Revision: https://reviews.llvm.org/D39518

llvm-svn: 317293
2017-11-03 00:36:03 +00:00
David Blaikie 1524e67feb Modular Codegen: Don't home always_inline functions
Since they'll likely (not always - if the address is taken, etc) be
inlined away, even at -O0, separately provided weak definitions are
likely to be unused so skip all of that.

llvm-svn: 317279
2017-11-02 22:28:50 +00:00
David Blaikie 0826729793 Modular Codegen: Don't home/modularize static functions in headers
Consistent with various workarounds in the backwards compatible modules
that allow static functions in headers to exist, be deduplicated to some
degree, and not generally fail right out of the gate... do the same with
modular codegen as there are enough cases (including in libstdc++ and in
LLVM itself - though I cleaned up the easy ones) that it's worth
supporting as a migration/backcompat step.

Simply create a separate, internal linkage function in each object that
needs it. If an available_externally/modularized function references a
static function, but the modularized function is eventually dropped and
not inlined, the static function will be dropped as unreferenced.

llvm-svn: 317274
2017-11-02 21:55:40 +00:00
Eugene Zelenko 4b3289e84f [Serialization] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 317273
2017-11-02 21:45:30 +00:00
Erich Keane a957ffbce3 Add default calling convention support for regcall.
Added support for regcall as default calling convention. Also added code to
exclude main when applying default calling conventions.

Patch-By: eandrews

Differential Revision: https://reviews.llvm.org/D39210

llvm-svn: 317268
2017-11-02 21:08:00 +00:00
Sanjay Patel c5c8207eae [CodeGen] fix const-ness of builtin equivalents of <math.h> and <complex.h> functions that might set errno
This just makes const-ness of the builtins match const-ness of their lib function siblings. 
We're deferring fixing some of these that are obviously wrong to follow-up patches. 
Hopefully, the bugs are visible in the new test file (added at rL317220).

As the description in Builtins.def says: "e = const, but only when -fmath-errno=0".

This is step 2 of N to fix builtins and math calls as discussed in D39204.

Differential Revision: https://reviews.llvm.org/D39481

llvm-svn: 317265
2017-11-02 20:39:26 +00:00
Alex Lorenz d44fdc2b66 revert r317228: remove unused function from ObjCRuntime.h, NFC
This function is actually used in LLDB

llvm-svn: 317231
2017-11-02 19:42:40 +00:00
Alex Lorenz a15c4deb7b remove unused function from ObjCRuntime.h, NFC
llvm-svn: 317228
2017-11-02 19:01:34 +00:00
Alexey Bataev 5d2c9a46fc [OPENMP] Fix PR35152: Do not use getInvokeDest() function for EH checks.
The compiler may crash under some conditions if the getInvokeDest() is
used, but later it is not used. Fixed this problem in OpenMP.

llvm-svn: 317227
2017-11-02 18:55:05 +00:00
Alex Lorenz 547e5ad0af [refactor][selection] canonicalize selected string literal to objc
string literal when possible

llvm-svn: 317224
2017-11-02 18:05:48 +00:00
Sanjay Patel 241b8f8fb0 [CodeGen] add builtin attr tests to show errno-related diffs; NFC
llvm-svn: 317220
2017-11-02 17:06:05 +00:00
Jan Korous c217b1b124 Fix comment typo
llvm-svn: 317216
2017-11-02 16:37:00 +00:00
Alexey Bataev 0e1b45897e [OPENMP] Fix PR35156: Get correct thread id with windows exceptions.
If the thread id is requested in windows mode within funclets, we may
generate incorrect function call that could lead to broken codegen.

llvm-svn: 317208
2017-11-02 14:25:34 +00:00
Jonas Hahnfeld 96087f3825 [OpenMP] Extend "Avoid VLAs for reduction" optimization to VLAs as base
We can generate constant sized arrays whenever the array section has constant
length, even if the base expression itself is a VLA.

Differential Revision: https://reviews.llvm.org/D39504

llvm-svn: 317207
2017-11-02 13:30:42 +00:00
Eric Liu 35cbbdd9f4 Fix clang-format CLion integration bug.
CLion's Sax parser threw this error:

Failed to parse clang-format XML replacements. Input: <?xml version='1.0'?>
<replacements xml:space='preserve' incomplete_format='true' line=89>
[...]
[org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 66; Open quote is expected for attribute "line" associated with an  element type  "replacements".]

Patch by Justine Tunney (jart@google.com)!

llvm-svn: 317205
2017-11-02 12:48:48 +00:00
Jan Korous 205bcd0d54 Fix typo in class annotation
llvm-svn: 317200
2017-11-02 12:15:51 +00:00
Shoaib Meenai c37c747b2c [libclang] Add dummy libclang-headers target
`LLVM_DISTRIBUTION_COMPONENTS` assumes that each component has both
`component` and `install-component` targets. Add a dummy no-op target
for `libclang-headers` to placate this check.

Differential Revision: https://reviews.llvm.org/D39524

llvm-svn: 317188
2017-11-02 05:04:00 +00:00
Shoaib Meenai 30e182d454 [clang-rename] Use add_clang_tool
`add_clang_tool` includes a call to `add_clang_executable`, but it also
sets up the install rule, and adds an `install-*` target. The latter is
required for using `LLVM_DISTRIBUTION_COMPONENTS`.

Differential Revision: https://reviews.llvm.org/D39522

llvm-svn: 317150
2017-11-02 01:11:40 +00:00
Richard Smith f501759a85 PR33746: Store the 'inline'ness of a static data member with the update record
for instantiating its definition.

We model the 'inline'ness as being instantiated with the static data member in
order to track whether the declaration has become a definition yet.

llvm-svn: 317147
2017-11-02 01:06:00 +00:00
Saleem Abdulrasool 8f6d944721 CodeGen: simplify EH personality selection (NFC)
Fix a typo in the comment, reorder to ensure that the ordering matches
across the ObjC/ObjC++ cases.  NFCI.

llvm-svn: 317146
2017-11-02 00:25:40 +00:00
Richard Smith 4d629b8023 Fix missing -Wregister warning when 'register' is applied to a function parameter.
llvm-svn: 317140
2017-11-01 23:38:37 +00:00
Eugene Zelenko 06becf8f99 [ASTMatchers] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 317137
2017-11-01 23:09:49 +00:00
Krasimir Georgiev 87b42549ee [clang-format] Make parseUnaryOperator non-recursive, NFCI
Summary:
This patch makes the implementation of parseUnaryOperator non-recursive. We had
a problem with a file starting with tens of thousands of +'es and -'es which
caused clang-format to stack overflow.

Reviewers: bkramer

Reviewed By: bkramer

Subscribers: cfe-commits, klimek

Differential Revision: https://reviews.llvm.org/D39498

llvm-svn: 317113
2017-11-01 18:20:41 +00:00
NAKAMURA Takumi 1657f2ad99 Fix warnings discovered by rL317076. [-Wunused-private-field]
llvm-svn: 317091
2017-11-01 13:47:55 +00:00
NAKAMURA Takumi c206e449cc Reformat.
llvm-svn: 317089
2017-11-01 13:47:48 +00:00
Richard Smith a31174efe0 Fix -Wunused-private-field to fire regardless of which implicit special members have been implicitly declared.
llvm-svn: 317076
2017-11-01 04:52:12 +00:00
NAKAMURA Takumi 057a942d9e clang/lib/Format/Format.cpp: Fix warnings introduced in rL316903. [-Wpedantic]
llvm-svn: 317075
2017-11-01 04:43:22 +00:00
Richard Trieu 7f932dd063 Change assertion to quick exit from checking function.
Remove the assertion that could be triggered by invalid code.  Replace it with
an early exit from the checking function.

llvm-svn: 317073
2017-11-01 03:57:27 +00:00
George Karpenkov 050b53b311 [analyzer] Removing unused stored field.
llvm-svn: 317070
2017-11-01 02:29:04 +00:00
Craig Topper a2b907a469 [X86] Define i586 and pentium preprocessor defines for -march=lakemont to match GCC
llvm-svn: 317069
2017-11-01 02:18:49 +00:00
Richard Smith 5173136a96 [c++17] Refine resolution of constructor / conversion function disambiguation.
Given a choice between a constructor call and a conversion function in C++17,
we prefer the constructor for direct-initialization and the conversion function
for copy-initialization, matching the behavior in C++14 and before. The
guaranteed copy elision rules were not intended to change the meaning of such
code (other than by removing unnecessary copy constructor calls).

This tweak will be raised with CWG.

llvm-svn: 317066
2017-11-01 01:37:11 +00:00
George Karpenkov ed017b634c [Analyzer] Use value storage for BodyFarm
Differential Revision: https://reviews.llvm.org/D39428

llvm-svn: 317065
2017-11-01 01:36:01 +00:00
Alex Lorenz 61f2c3f58c [refactor][extract] code extracted from inline method should be placed
in a function defined before the outer class

llvm-svn: 317062
2017-11-01 01:12:56 +00:00
Alex Lorenz 1e416fe23d [refactor][extract] prohibit extraction of ObjC property setters
llvm-svn: 317056
2017-11-01 00:20:55 +00:00
Alex Lorenz 7cd48cd8a9 [refactor][selection] code ranges can be selected in objc methods
llvm-svn: 317054
2017-11-01 00:07:12 +00:00
Wolfgang Pieb 173b47ca05 Making a couple of tests a bit more flexible wrt thunk mangling. Fixes checkin for r317047.
llvm-svn: 317053
2017-11-01 00:01:20 +00:00
Benjamin Kramer 0e71fd1957 Make helper function static. NFC.
llvm-svn: 317052
2017-10-31 23:23:36 +00:00
Wolfgang Pieb a347c47f5d Fix for PR33930. Short-circuit metadata mapping when cloning a varargs thunk.
The cloning happens before all metadata nodes are resolved. Prevent the value
mapper from running into unresolved or temporary MD nodes.

Differential Revision: https://reviews.llvm.org/D39396

llvm-svn: 317047
2017-10-31 22:49:48 +00:00
Vlad Tsyrklevich 634c601fe3 [CFI] Add CFI-icall pointer type generalization
Summary:
This change allows generalizing pointers in type signatures used for
cfi-icall by enabling the -fsanitize-cfi-icall-generalize-pointers flag.
This works by 1) emitting an additional generalized type signature
metadata node for functions and 2) llvm.type.test()ing for the
generalized type for translation units with the flag specified.

This flag is incompatible with -fsanitize-cfi-cross-dso because it would
require emitting twice as many type hashes which would increase artifact
size.

Reviewers: pcc, eugenis

Reviewed By: pcc

Subscribers: kcc

Differential Revision: https://reviews.llvm.org/D39358

llvm-svn: 317044
2017-10-31 22:39:44 +00:00
Vitaly Buka 1efe7740ce [clang-fuzzer] Fix incremental builds of the fuzzer
Summary:
Don't use BUILD_IN_SOURCE keep git checkout clean
Don't forward CMAKE_GENERATOR as ExternalProject_Add should do it already
Reset UPDATE_COMMAND to avoid git checkout updates on each build

Reviewers: kcc, morehouse

Subscribers: cfe-commits, mgorny

Differential Revision: https://reviews.llvm.org/D39445

llvm-svn: 317035
2017-10-31 20:49:57 +00:00
Richard Smith fd62945d36 Fix usage of right shift operator in fold expressions
The right shift operator was not seen as a valid operator in a fold expression, which is PR32563.

Patch by Nicolas Lesser ("Blitz Rakete")!

llvm-svn: 317032
2017-10-31 20:29:22 +00:00
Sanjay Patel 7cb25a888c [CodeGen] map sqrt libcalls to llvm.sqrt when errno is not set
The LLVM sqrt intrinsic definition changed with:
D28797
...so we don't have to use any relaxed FP settings other than errno handling.

This patch sidesteps a question raised in PR27435:
https://bugs.llvm.org/show_bug.cgi?id=27435

Is a programmer using __builtin_sqrt() invoking the compiler's intrinsic definition of sqrt or the mathlib definition of sqrt?

But we have an answer now: the builtin should match the behavior of the libm function including errno handling.

Differential Revision: https://reviews.llvm.org/D39204

llvm-svn: 317031
2017-10-31 20:19:39 +00:00
Ivan A. Kosarev b9c59f36fc [CodeGen] Propagate may-alias'ness of lvalues with TBAA info
This patch fixes various places in clang to propagate may-alias
TBAA access descriptors during construction of lvalues, thus
eliminating the need for the LValueBaseInfo::MayAlias flag.

This is part of D38126 reworked to be a separate patch to
simplify review.

Differential Revision: https://reviews.llvm.org/D39008

llvm-svn: 316988
2017-10-31 11:05:34 +00:00
Alex Lorenz b87b6bf73a [refactor] select the entire DeclStmt if one ifs decls is selected
llvm-svn: 316971
2017-10-31 01:28:17 +00:00
Alex Lorenz c38ba6697f Typo correct the condition of 'do-while' before exiting its scope
rdar://35172419

llvm-svn: 316966
2017-10-30 22:55:11 +00:00
Richard Smith a544c51e94 [modules] Retain multiple using-directives in the same scope even if they name the same namespace.
They might have different visibility, and thus discarding all but one of them
can result in rejecting valid code. Also fix name lookup to cope with multiple
using-directives being found that denote the same namespace, where some are not
visible -- don't cache an "already visited" state for a using-directive that we
didn't visit because it was hidden.

llvm-svn: 316965
2017-10-30 22:38:20 +00:00
George Karpenkov 0c3a7c2015 [analyzer] Use the same filename for the header and the implementation of BugReporterVisitor
Differential Revision: https://reviews.llvm.org/D37935

llvm-svn: 316963
2017-10-30 22:31:57 +00:00
George Karpenkov 3c128cb1e6 [analyzer] [tests] Remove empty folders in reference results, do not store diffs.txt
Storing diffs.txt is now redundant, as we simply dump the CmpRuns output
to stdout (it is saved in CI and tends to be small).
Not generating those files enables us to remove empty folders, which
confuse git, as it would not add them with reference results.

llvm-svn: 316948
2017-10-30 19:40:33 +00:00
Richard Smith 849e7da8b7 Undo accidental language mode change in this test.
llvm-svn: 316936
2017-10-30 18:06:18 +00:00
Richard Smith 70a81b1e8b Add a test to make sure that -Wdeprecated doesn't warn on use of 'throw()' in system headers (deprecated in C++17).
llvm-svn: 316935
2017-10-30 18:05:10 +00:00
Gabor Horvath 4581f7497b [analyzer] Left shifting a negative value is undefined
The analyzer did not return an UndefVal in case a negative value was left
shifted. I also altered the UndefResultChecker to emit a clear warning in this
case.

Differential Revision: https://reviews.llvm.org/D39423

llvm-svn: 316924
2017-10-30 17:06:42 +00:00
Krasimir Georgiev 7f64fa8022 [clang-format] Handle CRLF correctly when formatting escaped newlines
Subscribers: klimek

Differential Revision: https://reviews.llvm.org/D39420

Contributed by @peterbudai!

llvm-svn: 316910
2017-10-30 14:41:34 +00:00
Yaxun Liu 561ac06ff2 CodeGen: Fix insertion position of addrspace cast for alloca
For non-zero alloca addr space, alloca is usually casted to default addr
space immediately.

For non-vla, alloca is inserted at AllocaInsertPt, therefore the addr
space cast should also be insterted at AllocaInsertPt. However,
for vla, alloca is inserted at the current insertion point of IRBuilder,
therefore the addr space cast should also inserted at the current
insertion point of IRBuilder.

Currently clang always insert addr space cast at AllocaInsertPt, which
causes invalid IR.

This patch fixes that.

Differential Revision: https://reviews.llvm.org/D39374

llvm-svn: 316909
2017-10-30 14:38:30 +00:00
Krasimir Georgiev e56e9a4fef Keep MSVC2015 happy after r316903
llvm-svn: 316906
2017-10-30 14:30:14 +00:00
Krasimir Georgiev 9ad83fe7f6 [clang-format] Format raw string literals
Summary:
This patch adds raw string literal formatting.

Reviewers: djasper, klimek

Reviewed By: klimek

Subscribers: klimek, mgorny

Differential Revision: https://reviews.llvm.org/D35943

llvm-svn: 316903
2017-10-30 14:01:50 +00:00
Gabor Horvath 404fcd3069 [analyzer] Use the signature of the primary template for issue hash calculation
Now when a template is instantiated more times and there is a bug found in the
instantiations the issue hash will be different for each instantiation even if
every other property of the bug (path, message, location) is the same.

This patch aims to resolve this issue. Note that explicit specializations still
generate different hashes but that is intended.

Differential Revision: https://reviews.llvm.org/D38728

llvm-svn: 316900
2017-10-30 12:16:07 +00:00
Gabor Horvath 3bd24f9440 [analyzer] Make issue hash related tests more concise
Extend ExprInspection checker to make it possible to dump the issue hash of
arbitrary expressions. This change makes it possible to make issue hash related
tests more concise and also makes debugging issue hash related problems easier.

Differential Revision: https://reviews.llvm.org/D38844

llvm-svn: 316899
2017-10-30 12:02:23 +00:00
Ivan A. Kosarev 9f9d157517 [CodeGen] Generate TBAA info for reference loads
Differential Revision: https://reviews.llvm.org/D39177

llvm-svn: 316896
2017-10-30 11:49:31 +00:00
Haojian Wu f5142bf97f [refactor] Fix a clang-tidy warning.
NFC

llvm-svn: 316895
2017-10-30 11:17:09 +00:00
Gabor Horvath 9a8c8bf60d [analyzer] lock_guard and unique_lock extension for BlockInCriticalSection checker
A patch by zdtorok (Zoltán Dániel Török)!

Differential Revision: https://reviews.llvm.org/D33729

llvm-svn: 316892
2017-10-30 10:09:55 +00:00
Gabor Horvath bde3be43d7 Add missing expected-no-diagnostics comment to test.
llvm-svn: 316886
2017-10-30 09:01:48 +00:00
Gabor Horvath bb81bfb69c [analyzer] Handle ObjC messages conservatively in CallDescription
Differential Revision: https://reviews.llvm.org/D37470

llvm-svn: 316885
2017-10-30 08:47:13 +00:00
Saleem Abdulrasool 8ba8b02879 Driver: default to `unsigned int` `wchar_t` for ARM
AAPCS and AAPCS64 mandate that `wchar_t` with `-fno-short-wchar` is an
`unsigned int` rather than a `signed int`.  Ensure that the driver does
not flip the signedness of `wchar_t` for those targets.

Add additional tests to ensure that this does not regress.

llvm-svn: 316858
2017-10-29 06:01:14 +00:00
Peter Szecsi 07964fbdcb [analyzer] MisusedMovedObjectChecker: More precise warning message
Added new enum in order to differentiate the warning messages on "misusing" into
3 categories: function calls, moving an object, copying an object. (At the
moment the checker gives the same message in case of copying and moving.)

Additional test cases added as well.

Differential Revision: https://reviews.llvm.org/D38674

llvm-svn: 316852
2017-10-28 23:24:00 +00:00
Peter Szecsi 65f8f83a74 [analyzer] MisusedMovedObjectChecker: Fix false positive on state-resetting, handling method calls on base-class sub-objects
An earlier solution from Artem r315301 solves the reset problem, however, the
reports should be handled the same way in case of method calls. We should not
just report the base class of the object where the method was defined but the
whole object.

Fixed false positive which came from not removing the subobjects in case of a
state-resetting function. (Just replaced the State->remove(...) call to
removeFromState(..) which was defined exactly for that purpose.)

Some minor typos fixed in this patch as well which did not worth a whole new
patch in my opinion, so included them here.

Differential Revision: https://reviews.llvm.org/D31538

llvm-svn: 316850
2017-10-28 23:09:37 +00:00
Richard Smith 72db888389 PR35039: Materialize temporary objects before wrapping them in an
OpaqueValueExpr in a GNU binary conditional expression.

It's not meaningful for a non-materialized temporary object to be used as a
common subexpression of multiple expressions.

llvm-svn: 316836
2017-10-28 18:59:51 +00:00
Peter Szecsi 1496d188a0 [analyzer] LoopUnrolling: check the bitwidth of the used numbers (pr34943)
The loop unrolling feature aims to track the maximum possible steps a loop can
make. In order to implement this, it investigates the initial value of the 
counter variable and the bound number. (It has to be known.)
These numbers are used as llvm::APInts, however, it was not checked if their
bitwidths are the same which lead to some crashes.
This revision solves this problem by extending the "shorter" one (to the length
of the "longer" one).
For the detailed bug report, see: https://bugs.llvm.org/show_bug.cgi?id=34943

Differential Revision: https://reviews.llvm.org/D38922

llvm-svn: 316830
2017-10-28 12:19:08 +00:00
Saleem Abdulrasool 1924b24aca Basic: improve coverage for Darwin targets and fix ABI
The existing coverage for the Darwin targets wasn't enough to catch all
the variations.  Improve the coverage a bit further and fix a few cases
for Darwin targets.

llvm-svn: 316826
2017-10-28 06:00:43 +00:00
Richard Smith cb18957da0 Never try to instantiate a deduction guide's "definition". Fixes bogus warning when there inevitably isn't one.
llvm-svn: 316820
2017-10-28 01:15:00 +00:00
Saleem Abdulrasool 418a816cdc ARM: centralise SizeType, PtrDiffType, and IntPtrType
Centralise the definitions of these compiler vended types to aid
inspection to ensure that they are defined similarly.  The one case that
stands out is the Darwin case where the types do not match up.  This
fixes the API conformance for APCS-GNU as well.

llvm-svn: 316810
2017-10-27 23:04:27 +00:00
George Karpenkov 0a6dba792f [Analyzer] [Tests] Fixing typo from the previous commit.
Can not open a non-existent file with r+.

llvm-svn: 316808
2017-10-27 22:52:36 +00:00
Reid Kleckner 2e87a21c7c [MS] Allow access to ambiguous, inaccessible direct bases
Summary:
Clang typically warns that in the following class hierarchy, 'A' is
inaccessible because there is no series of casts that the user can
write to access it unambiguously:
  struct A { };
  struct B : A { };
  struct C : A, B { };

MSVC allows the user to convert from C* to A*, though, and we've
encountered this issue in the latest Windows SDK headers.

This patch allows this conversion when -fms-compatibility is set and
adds a warning for it under -Wmicrosoft-inaccessible-base.

Reviewers: rsmith

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D39389

llvm-svn: 316807
2017-10-27 22:48:41 +00:00
George Karpenkov e58044d432 [Analyzer] [Tests] Dump the output of scan-build to stdout on failure.
Eliminates extra lookup step during debugging.

llvm-svn: 316806
2017-10-27 22:39:54 +00:00
David Blaikie a0183b30c5 StaticAnalyzer: Modularize/fix ODR violations making functions inline but non-static in headers
Also move these out of the llvm namespace & rely on ADL as is
appropriate for these op<< overloads.

llvm-svn: 316794
2017-10-27 20:40:46 +00:00
David Blaikie 708908f842 Sanitizers.h: Modularize/Fix ODR violations by making inline functions non-static
llvm-svn: 316793
2017-10-27 20:40:45 +00:00
David Blaikie 6661ab8f96 CharInfo.h: Modularize/fix ODR violations by making inline functions in header not static
llvm-svn: 316792
2017-10-27 20:40:45 +00:00
David Blaikie fb0c97e1f8 ASTContext.h: Modularize/fix ODR violations by removing 'static' from inline functions in headers
llvm-svn: 316791
2017-10-27 20:40:44 +00:00
Erich Keane 857ac594b7 Replace a few usages of llvm::join with range-version[NFC]
I noticed a few usages of llvm::join that were using
begin/end rather than just the range version.  This patch
just replaces those.

llvm-svn: 316784
2017-10-27 18:45:06 +00:00
Erich Keane cf8807c931 Filter out invalid 'target' items from being passed to LLVM
Craig noticed that CodeGen wasn't properly ignoring the
values sent to the target attribute. This patch ignores
them.

This patch also sets the 'default' for this checking to
'supported', since only X86 has implemented the support
for checking valid CPU names and Feature Names.

One test was changed to i686, since it uses a lakemont,
which would otherwise be prohibited in x86_64.

Differential Revision: https://reviews.llvm.org/D39357

llvm-svn: 316783
2017-10-27 18:32:23 +00:00
Erich Keane 3231918f4f Remove x86,x86_32/64 from isValidFeatureName
These are not valid values for this, and are pretty
non-sensical, since LLVM doesn't understand them.

Differential Revision: https://reviews.llvm.org/D39378

llvm-svn: 316781
2017-10-27 18:29:02 +00:00
Alex Lorenz 0beca4d1ec [refactor] Describe refactorings in the operation classes
This commit changes the way that the refactoring operation classes are
structured:
- Users have to call `initiate` instead of constructing an instance of the
  class. The `initiate` is now supposed to have custom initiation logic, and
  you don't need to subclass the builtin requirements.
- A new `describe` function returns a structure with the id, title and the
  description of the refactoring operation.

The refactoring action classes are now placed into one common place in
RefactoringActions.cpp instead of being separate.

Differential Revision: https://reviews.llvm.org/D38985

llvm-svn: 316780
2017-10-27 18:19:11 +00:00
Alex Lorenz ddd279b90d [Sema] Fix an assert-on-invalid by avoiding function template specialisation
deduction for invalid functions

The fabricated template parameters cause an assertion because their depth
is invalid.

rdar://34109988

Differential Revision: https://reviews.llvm.org/D37341

llvm-svn: 316778
2017-10-27 18:13:31 +00:00
Sam Clegg 471d7afdf0 [WebAssembly] Add crt1.o with calling lld
Also, for OS unknown targets like wasm, don't include
'unknown' in the library path. This is a fix for rL316719.

Differential Revision: https://reviews.llvm.org/D39354

llvm-svn: 316777
2017-10-27 18:10:19 +00:00
Don Hinton fc2ffbe1be New lldb python module for managing diagnostic breakpoints
Summary:
Can be used to set breakpoints for either the diagnostics actually
emitted for the current compilation, a particular DiagID, or all
DiagIDs for a particular warning.

Differential Revision: https://reviews.llvm.org/D36347

llvm-svn: 316773
2017-10-27 17:02:33 +00:00
Gabor Horvath 724beacadc [CrossTU] Fix handling of Cross Translation Unit directory path
Differential Revision: https://reviews.llvm.org/D38842

llvm-svn: 316764
2017-10-27 12:53:37 +00:00
Ivan Donchevskii 13d9054d2c Test commit
llvm-svn: 316758
2017-10-27 11:05:40 +00:00
Sam Clegg 6853d94e2f Fix test/Driver/wasm-toolchain.c on windows
llvm-svn: 316725
2017-10-27 01:20:16 +00:00
Volodymyr Sapsai 636ed47428 [CodeGen] Add support for IncompleteArrayType in Obj-C ivars.
Fixes an assertion failure when ivar is a struct containing incomplete
array. Also completes support for direct flexible array members.

rdar://problem/21054495

Reviewers: rjmccall, theraven

Reviewed By: rjmccall

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D38774

llvm-svn: 316723
2017-10-27 00:56:23 +00:00
Sam Clegg a08631ec6c [WebAssembly] Include libclang_rt.builtins in the standard way
Differential Revision: https://reviews.llvm.org/D39218

llvm-svn: 316719
2017-10-27 00:26:07 +00:00
Craig Topper 13cb23b8b3 [X86] Add 'sse4' to X86TargetInfo::isValidFeatureName
sse4 is valid for target attribute and functions as an alias of sse4.2.

llvm-svn: 316718
2017-10-27 00:18:16 +00:00
Nico Weber 0763ab4d6a Use -fuse-init-array if no gcc installation is found.
clang currently uses .init_array instead of .ctors on Linux if it detects gcc
4.7+. Make it so that it also uses .init_array if no gcc installation is found
at all – if there's no old gcc, there's nothing we need to be compatible with.

icecc for example runs clang in a very small chroot, so before this change
clang would use .ctors if run under icecc. And lld currently silently mislinks
inputs with .ctors sections, so before this clang + icecc + lld would produce
broken binaries. (But this seems like a good change independent of that lld
bug.)

https://reviews.llvm.org/D39317

llvm-svn: 316713
2017-10-26 23:26:29 +00:00
Craig Topper a6021e3bc1 [X86] Make -march=i686 an alias of -march=pentiumpro
I think the only reason they are different is because we don't set tune_i686 for -march=i686 to match GCC. But GCC 4.9.0 seems to have changed this behavior and they do set it now. So I think they can aliases now.

Differential Revision: https://reviews.llvm.org/D39349

llvm-svn: 316712
2017-10-26 23:06:19 +00:00
Craig Topper 6ed95dd0b0 [X86][Driver] Move all of the X86 feature flags to one spot in the Options.td file and pair them up with their negations.
It looks like at one time Options.td was in alphabetical order, but that looks to have long been broken. The result is that it all the no- x86 options got separated from their other friends for no good reason.

This patch puts them all together in one place with the no- paired with its none negated version.

I've kept all the SSE and AVX/AVX512 bits together since they represent a somewhat linear progression of features. The rest I just put in alphabetical order after.

Differential Revision: https://reviews.llvm.org/D39341

llvm-svn: 316705
2017-10-26 21:28:33 +00:00
Vedant Kumar 9c6b6826ce [CGBlocks] Improve line info in backtraces containing *_helper_block
Instead of only setting a non-zero debug location on the return
instruction in *_helper_block functions, set a proper location on all
instructions within these functions. Pick the start location of the
block literal expr for maximum clarity.

The debugger does not step into *_helper_block functions during normal
single-stepping because we mark their parameters as artificial. This is
what we want (the functions are implicitly generated and uninteresting
to most users). The stepping behavior is unchanged by this patch.

rdar://32907581

Differential Revision: https://reviews.llvm.org/D39310

llvm-svn: 316704
2017-10-26 21:27:24 +00:00
Richard Smith 6631036893 [www] Regenerate diagnostics reference.
llvm-svn: 316701
2017-10-26 21:06:52 +00:00
Adrian Prantl e8dd2bd834 Fix C++ testcase I forgot to add to r316689.
llvm-svn: 316695
2017-10-26 20:16:03 +00:00