]> granicus.if.org Git - clang/log
clang
6 years ago[CodeGen] add remquo to list of recognized library calls
Sanjay Patel [Sat, 4 Nov 2017 15:03:11 +0000 (15:03 +0000)]
[CodeGen] add remquo to list of recognized library calls

This is just an oversight because we already do recognize __builtin_remquo()
with the same signature.

http://en.cppreference.com/w/c/numeric/math/remquo
http://pubs.opengroup.org/onlinepubs/9699919799/functions/remquo.html

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

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

6 years agoCodeGenCXX: no default dllimport storage for mingw
Martell Malone [Sat, 4 Nov 2017 02:15:49 +0000 (02:15 +0000)]
CodeGenCXX: no default dllimport storage for mingw

GNU frontends don't have options like /MT, /MD
This fixes a few link error regressions with libc++ and libc++abi

Reviewers: rnk, mstorsjo, compnerd

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

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

6 years ago[Driver] MinGW: Remove custom linker detection
Martell Malone [Sat, 4 Nov 2017 02:07:59 +0000 (02:07 +0000)]
[Driver] MinGW: Remove custom linker detection

This is a re-apply of rL313082 which was reverted in rL313088

In rL289668 the ability to specify the default linker at compile time
was added but because the MinGW driver used custom detection we could
not take advantage of this new CMAKE flag CLANG_DEFAULT_LINKER.

rL289668 added no test cases and the mingw driver was either overlooked
or purposefully skipped because it has some custom linker tests
Removing them here because they are covered by the generic case.

Reviewers: rnk

Differntial Revision: https://reviews.llvm.org/D37727

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

6 years agoUpdate ODR hashing tests
Richard Trieu [Sat, 4 Nov 2017 01:20:50 +0000 (01:20 +0000)]
Update ODR hashing tests

Add a mix of postive and negative tests to check that wrong Decls won't be
flagged in the diagnostic.  Split the check everything test and moved the
pieces closer to where the related tests are.

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

6 years ago[Basic] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Fri, 3 Nov 2017 22:35:27 +0000 (22:35 +0000)]
[Basic] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

6 years agoAdd -fcxx-exceptions for ExtractionSemicolonPolicy.cpp to appease PS4 bots
Alex Lorenz [Fri, 3 Nov 2017 21:31:10 +0000 (21:31 +0000)]
Add -fcxx-exceptions for ExtractionSemicolonPolicy.cpp to appease PS4 bots

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

6 years agoReplace a use of std::for_each() with llvm::for_each(); NFC.
Aaron Ballman [Fri, 3 Nov 2017 20:09:17 +0000 (20:09 +0000)]
Replace a use of std::for_each() with llvm::for_each(); NFC.

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

6 years agoMove Extract.cpp that wasn't moved in r317343
Alex Lorenz [Fri, 3 Nov 2017 18:21:06 +0000 (18:21 +0000)]
Move Extract.cpp that wasn't moved in r317343

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

6 years ago[refactor][extract] insert semicolons into extracted/inserted code
Alex Lorenz [Fri, 3 Nov 2017 18:11:22 +0000 (18:11 +0000)]
[refactor][extract] insert semicolons into extracted/inserted code
when needed

This commit implements the semicolon insertion logic into the extract
refactoring. The following rules are used:

- extracting expression: add terminating ';' to the extracted function.
- extracting statements that don't require terminating ';' (e.g. switch): add
  terminating ';' to the callee.
- extracting statements with ';':  move (if possible) the original ';' from the
  callee and add terminating ';'.
- otherwise, add ';' to both places.

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

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

6 years ago[Driver] Add Scudo as a possible -fsanitize= option
Kostya Kortchinsky [Fri, 3 Nov 2017 17:04:13 +0000 (17:04 +0000)]
[Driver] Add Scudo as a possible -fsanitize= option

Summary:
This change adds Scudo as a possible Sanitizer option via -fsanitize=.
This allows for easier static & shared linking of the Scudo library, it allows
us to enforce PIE (otherwise the security of the allocator is moot), and check
for incompatible Sanitizers combo.

In its current form, Scudo is not compatible with any other Sanitizer, but the
plan is to make it work in conjunction with UBsan (-fsanitize=scudo,undefined),
which will require additional work outside of the scope of this change.

Reviewers: eugenis, kcc, alekseyshl

Reviewed By: eugenis, alekseyshl

Subscribers: llvm-commits, srhines

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

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

6 years ago[CodeGen] add libcall attr tests to show errno-related diffs; NFC
Sanjay Patel [Fri, 3 Nov 2017 16:27:27 +0000 (16:27 +0000)]
[CodeGen] add libcall attr tests to show errno-related diffs; NFC

See rL317220 for the builtin siblings.

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

6 years ago[Tooling] Fix linking of StandaloneToolExecutorPlugin.
Eric Liu [Fri, 3 Nov 2017 15:57:27 +0000 (15:57 +0000)]
[Tooling] Fix linking of StandaloneToolExecutorPlugin.

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

6 years ago[Tooling] Put createExecutorFromCommandLineArgs implementation in a wrapper. NFC
Eric Liu [Fri, 3 Nov 2017 15:20:57 +0000 (15:20 +0000)]
[Tooling] Put createExecutorFromCommandLineArgs implementation in a wrapper. NFC

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

6 years ago[clang-format] Sort using-declarations case sensitively with a special case for '_'
Krasimir Georgiev [Fri, 3 Nov 2017 14:38:07 +0000 (14:38 +0000)]
[clang-format] Sort using-declarations case sensitively with a special case for '_'

Summary:
This makes clang-format sort using declarations case-sensitive with the
exception that '_' comes just before 'A'. This is better than the current case
insensitive version, because it groups uppercase names in the same namespace
together.

Reviewers: bkramer

Reviewed By: bkramer

Subscribers: cfe-commits, klimek

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

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

6 years ago[preamble] Also record the "skipping" state of the preprocessor
Erik Verbruggen [Fri, 3 Nov 2017 09:40:07 +0000 (09:40 +0000)]
[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.

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

6 years ago[CUDA] Mark CUDA as a no-errno platform.
Justin Lebar [Fri, 3 Nov 2017 02:30:00 +0000 (02:30 +0000)]
[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

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

6 years ago[c++17] Visit class template explicit specializations just like all other class defin...
Richard Smith [Fri, 3 Nov 2017 01:26:01 +0000 (01:26 +0000)]
[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.

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

6 years ago[analyzer] [NFC] very minor ExprEngineC refactoring
George Karpenkov [Fri, 3 Nov 2017 00:41:29 +0000 (00:41 +0000)]
[analyzer] [NFC] very minor ExprEngineC refactoring

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

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

6 years ago[analyzer] do not crash on libcxx03 call_once implementation
George Karpenkov [Fri, 3 Nov 2017 00:36:03 +0000 (00:36 +0000)]
[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

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

7 years agoModular Codegen: Don't home always_inline functions
David Blaikie [Thu, 2 Nov 2017 22:28:50 +0000 (22:28 +0000)]
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.

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

7 years agoModular Codegen: Don't home/modularize static functions in headers
David Blaikie [Thu, 2 Nov 2017 21:55:40 +0000 (21:55 +0000)]
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.

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

7 years ago[Serialization] Fix some Clang-tidy modernize and Include What You Use warnings;...
Eugene Zelenko [Thu, 2 Nov 2017 21:45:30 +0000 (21:45 +0000)]
[Serialization] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

7 years agoAdd default calling convention support for regcall.
Erich Keane [Thu, 2 Nov 2017 21:08:00 +0000 (21:08 +0000)]
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

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

7 years ago[CodeGen] fix const-ness of builtin equivalents of <math.h> and <complex.h> functions...
Sanjay Patel [Thu, 2 Nov 2017 20:39:26 +0000 (20:39 +0000)]
[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

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

7 years agorevert r317228: remove unused function from ObjCRuntime.h, NFC
Alex Lorenz [Thu, 2 Nov 2017 19:42:40 +0000 (19:42 +0000)]
revert r317228: remove unused function from ObjCRuntime.h, NFC

This function is actually used in LLDB

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

7 years agoremove unused function from ObjCRuntime.h, NFC
Alex Lorenz [Thu, 2 Nov 2017 19:01:34 +0000 (19:01 +0000)]
remove unused function from ObjCRuntime.h, NFC

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

7 years ago[OPENMP] Fix PR35152: Do not use getInvokeDest() function for EH checks.
Alexey Bataev [Thu, 2 Nov 2017 18:55:05 +0000 (18:55 +0000)]
[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.

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

7 years ago[refactor][selection] canonicalize selected string literal to objc
Alex Lorenz [Thu, 2 Nov 2017 18:05:48 +0000 (18:05 +0000)]
[refactor][selection] canonicalize selected string literal to objc
string literal when possible

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

7 years ago[CodeGen] add builtin attr tests to show errno-related diffs; NFC
Sanjay Patel [Thu, 2 Nov 2017 17:06:05 +0000 (17:06 +0000)]
[CodeGen] add builtin attr tests to show errno-related diffs; NFC

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

7 years agoFix comment typo
Jan Korous [Thu, 2 Nov 2017 16:37:00 +0000 (16:37 +0000)]
Fix comment typo

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

7 years ago[OPENMP] Fix PR35156: Get correct thread id with windows exceptions.
Alexey Bataev [Thu, 2 Nov 2017 14:25:34 +0000 (14:25 +0000)]
[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.

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

7 years ago[OpenMP] Extend "Avoid VLAs for reduction" optimization to VLAs as base
Jonas Hahnfeld [Thu, 2 Nov 2017 13:30:42 +0000 (13:30 +0000)]
[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

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

7 years agoFix clang-format CLion integration bug.
Eric Liu [Thu, 2 Nov 2017 12:48:48 +0000 (12:48 +0000)]
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)!

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

7 years agoFix typo in class annotation
Jan Korous [Thu, 2 Nov 2017 12:15:51 +0000 (12:15 +0000)]
Fix typo in class annotation

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

7 years ago[libclang] Add dummy libclang-headers target
Shoaib Meenai [Thu, 2 Nov 2017 05:04:00 +0000 (05:04 +0000)]
[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

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

7 years ago[clang-rename] Use add_clang_tool
Shoaib Meenai [Thu, 2 Nov 2017 01:11:40 +0000 (01:11 +0000)]
[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

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

7 years agoPR33746: Store the 'inline'ness of a static data member with the update record
Richard Smith [Thu, 2 Nov 2017 01:06:00 +0000 (01:06 +0000)]
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.

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

7 years agoCodeGen: simplify EH personality selection (NFC)
Saleem Abdulrasool [Thu, 2 Nov 2017 00:25:40 +0000 (00:25 +0000)]
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.

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

7 years agoFix missing -Wregister warning when 'register' is applied to a function parameter.
Richard Smith [Wed, 1 Nov 2017 23:38:37 +0000 (23:38 +0000)]
Fix missing -Wregister warning when 'register' is applied to a function parameter.

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

7 years ago[ASTMatchers] Fix some Clang-tidy modernize and Include What You Use warnings; other...
Eugene Zelenko [Wed, 1 Nov 2017 23:09:49 +0000 (23:09 +0000)]
[ASTMatchers] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

7 years ago[clang-format] Make parseUnaryOperator non-recursive, NFCI
Krasimir Georgiev [Wed, 1 Nov 2017 18:20:41 +0000 (18:20 +0000)]
[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

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

7 years agoFix warnings discovered by rL317076. [-Wunused-private-field]
NAKAMURA Takumi [Wed, 1 Nov 2017 13:47:55 +0000 (13:47 +0000)]
Fix warnings discovered by rL317076. [-Wunused-private-field]

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

7 years agoReformat.
NAKAMURA Takumi [Wed, 1 Nov 2017 13:47:48 +0000 (13:47 +0000)]
Reformat.

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

7 years agoFix -Wunused-private-field to fire regardless of which implicit special members have...
Richard Smith [Wed, 1 Nov 2017 04:52:12 +0000 (04:52 +0000)]
Fix -Wunused-private-field to fire regardless of which implicit special members have been implicitly declared.

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

7 years agoclang/lib/Format/Format.cpp: Fix warnings introduced in rL316903. [-Wpedantic]
NAKAMURA Takumi [Wed, 1 Nov 2017 04:43:22 +0000 (04:43 +0000)]
clang/lib/Format/Format.cpp: Fix warnings introduced in rL316903. [-Wpedantic]

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

7 years agoChange assertion to quick exit from checking function.
Richard Trieu [Wed, 1 Nov 2017 03:57:27 +0000 (03:57 +0000)]
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.

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

7 years ago[analyzer] Removing unused stored field.
George Karpenkov [Wed, 1 Nov 2017 02:29:04 +0000 (02:29 +0000)]
[analyzer] Removing unused stored field.

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

7 years ago[X86] Define i586 and pentium preprocessor defines for -march=lakemont to match GCC
Craig Topper [Wed, 1 Nov 2017 02:18:49 +0000 (02:18 +0000)]
[X86] Define i586 and pentium preprocessor defines for -march=lakemont to match GCC

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

7 years ago[c++17] Refine resolution of constructor / conversion function disambiguation.
Richard Smith [Wed, 1 Nov 2017 01:37:11 +0000 (01:37 +0000)]
[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.

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

7 years ago[Analyzer] Use value storage for BodyFarm
George Karpenkov [Wed, 1 Nov 2017 01:36:01 +0000 (01:36 +0000)]
[Analyzer] Use value storage for BodyFarm

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

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

7 years ago[refactor][extract] code extracted from inline method should be placed
Alex Lorenz [Wed, 1 Nov 2017 01:12:56 +0000 (01:12 +0000)]
[refactor][extract] code extracted from inline method should be placed
in a function defined before the outer class

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

7 years ago[refactor][extract] prohibit extraction of ObjC property setters
Alex Lorenz [Wed, 1 Nov 2017 00:20:55 +0000 (00:20 +0000)]
[refactor][extract] prohibit extraction of ObjC property setters

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

7 years ago[refactor][selection] code ranges can be selected in objc methods
Alex Lorenz [Wed, 1 Nov 2017 00:07:12 +0000 (00:07 +0000)]
[refactor][selection] code ranges can be selected in objc methods

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

7 years agoMaking a couple of tests a bit more flexible wrt thunk mangling. Fixes checkin for...
Wolfgang Pieb [Wed, 1 Nov 2017 00:01:20 +0000 (00:01 +0000)]
Making a couple of tests a bit more flexible wrt thunk mangling. Fixes checkin for r317047.

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

7 years agoMake helper function static. NFC.
Benjamin Kramer [Tue, 31 Oct 2017 23:23:36 +0000 (23:23 +0000)]
Make helper function static. NFC.

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

7 years agoFix for PR33930. Short-circuit metadata mapping when cloning a varargs thunk.
Wolfgang Pieb [Tue, 31 Oct 2017 22:49:48 +0000 (22:49 +0000)]
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

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

7 years ago[CFI] Add CFI-icall pointer type generalization
Vlad Tsyrklevich [Tue, 31 Oct 2017 22:39:44 +0000 (22:39 +0000)]
[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

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

7 years ago[clang-fuzzer] Fix incremental builds of the fuzzer
Vitaly Buka [Tue, 31 Oct 2017 20:49:57 +0000 (20:49 +0000)]
[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

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

7 years agoFix usage of right shift operator in fold expressions
Richard Smith [Tue, 31 Oct 2017 20:29:22 +0000 (20:29 +0000)]
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")!

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

7 years ago[CodeGen] map sqrt libcalls to llvm.sqrt when errno is not set
Sanjay Patel [Tue, 31 Oct 2017 20:19:39 +0000 (20:19 +0000)]
[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

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

7 years ago[CodeGen] Propagate may-alias'ness of lvalues with TBAA info
Ivan A. Kosarev [Tue, 31 Oct 2017 11:05:34 +0000 (11:05 +0000)]
[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

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

7 years ago[refactor] select the entire DeclStmt if one ifs decls is selected
Alex Lorenz [Tue, 31 Oct 2017 01:28:17 +0000 (01:28 +0000)]
[refactor] select the entire DeclStmt if one ifs decls is selected

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

7 years agoTypo correct the condition of 'do-while' before exiting its scope
Alex Lorenz [Mon, 30 Oct 2017 22:55:11 +0000 (22:55 +0000)]
Typo correct the condition of 'do-while' before exiting its scope

rdar://35172419

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

7 years ago[modules] Retain multiple using-directives in the same scope even if they name the...
Richard Smith [Mon, 30 Oct 2017 22:38:20 +0000 (22:38 +0000)]
[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.

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

7 years ago[analyzer] Use the same filename for the header and the implementation of BugReporter...
George Karpenkov [Mon, 30 Oct 2017 22:31:57 +0000 (22:31 +0000)]
[analyzer] Use the same filename for the header and the implementation of BugReporterVisitor

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

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

7 years ago[analyzer] [tests] Remove empty folders in reference results, do not store diffs.txt
George Karpenkov [Mon, 30 Oct 2017 19:40:33 +0000 (19:40 +0000)]
[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.

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

7 years agoUndo accidental language mode change in this test.
Richard Smith [Mon, 30 Oct 2017 18:06:18 +0000 (18:06 +0000)]
Undo accidental language mode change in this test.

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

7 years agoAdd a test to make sure that -Wdeprecated doesn't warn on use of 'throw()' in system...
Richard Smith [Mon, 30 Oct 2017 18:05:10 +0000 (18:05 +0000)]
Add a test to make sure that -Wdeprecated doesn't warn on use of 'throw()' in system headers (deprecated in C++17).

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

7 years ago[analyzer] Left shifting a negative value is undefined
Gabor Horvath [Mon, 30 Oct 2017 17:06:42 +0000 (17:06 +0000)]
[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

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

7 years ago[clang-format] Handle CRLF correctly when formatting escaped newlines
Krasimir Georgiev [Mon, 30 Oct 2017 14:41:34 +0000 (14:41 +0000)]
[clang-format] Handle CRLF correctly when formatting escaped newlines

Subscribers: klimek

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

Contributed by @peterbudai!

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

7 years agoCodeGen: Fix insertion position of addrspace cast for alloca
Yaxun Liu [Mon, 30 Oct 2017 14:38:30 +0000 (14:38 +0000)]
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

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

7 years agoKeep MSVC2015 happy after r316903
Krasimir Georgiev [Mon, 30 Oct 2017 14:30:14 +0000 (14:30 +0000)]
Keep MSVC2015 happy after r316903

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

7 years ago[clang-format] Format raw string literals
Krasimir Georgiev [Mon, 30 Oct 2017 14:01:50 +0000 (14:01 +0000)]
[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

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

7 years ago[analyzer] Use the signature of the primary template for issue hash calculation
Gabor Horvath [Mon, 30 Oct 2017 12:16:07 +0000 (12:16 +0000)]
[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

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

7 years ago[analyzer] Make issue hash related tests more concise
Gabor Horvath [Mon, 30 Oct 2017 12:02:23 +0000 (12:02 +0000)]
[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

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

7 years ago[CodeGen] Generate TBAA info for reference loads
Ivan A. Kosarev [Mon, 30 Oct 2017 11:49:31 +0000 (11:49 +0000)]
[CodeGen] Generate TBAA info for reference loads

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

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

7 years ago[refactor] Fix a clang-tidy warning.
Haojian Wu [Mon, 30 Oct 2017 11:17:09 +0000 (11:17 +0000)]
[refactor] Fix a clang-tidy warning.

NFC

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

7 years ago[analyzer] lock_guard and unique_lock extension for BlockInCriticalSection checker
Gabor Horvath [Mon, 30 Oct 2017 10:09:55 +0000 (10:09 +0000)]
[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

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

7 years agoAdd missing expected-no-diagnostics comment to test.
Gabor Horvath [Mon, 30 Oct 2017 09:01:48 +0000 (09:01 +0000)]
Add missing expected-no-diagnostics comment to test.

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

7 years ago[analyzer] Handle ObjC messages conservatively in CallDescription
Gabor Horvath [Mon, 30 Oct 2017 08:47:13 +0000 (08:47 +0000)]
[analyzer] Handle ObjC messages conservatively in CallDescription

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

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

7 years agoDriver: default to `unsigned int` `wchar_t` for ARM
Saleem Abdulrasool [Sun, 29 Oct 2017 06:01:14 +0000 (06:01 +0000)]
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.

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

7 years ago[analyzer] MisusedMovedObjectChecker: More precise warning message
Peter Szecsi [Sat, 28 Oct 2017 23:24:00 +0000 (23:24 +0000)]
[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

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

7 years ago[analyzer] MisusedMovedObjectChecker: Fix false positive on state-resetting, handling...
Peter Szecsi [Sat, 28 Oct 2017 23:09:37 +0000 (23:09 +0000)]
[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

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

7 years agoPR35039: Materialize temporary objects before wrapping them in an
Richard Smith [Sat, 28 Oct 2017 18:59:51 +0000 (18:59 +0000)]
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.

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

7 years ago[analyzer] LoopUnrolling: check the bitwidth of the used numbers (pr34943)
Peter Szecsi [Sat, 28 Oct 2017 12:19:08 +0000 (12:19 +0000)]
[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

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

7 years agoBasic: improve coverage for Darwin targets and fix ABI
Saleem Abdulrasool [Sat, 28 Oct 2017 06:00:43 +0000 (06:00 +0000)]
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.

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

7 years agoNever try to instantiate a deduction guide's "definition". Fixes bogus warning when...
Richard Smith [Sat, 28 Oct 2017 01:15:00 +0000 (01:15 +0000)]
Never try to instantiate a deduction guide's "definition". Fixes bogus warning when there inevitably isn't one.

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

7 years agoARM: centralise SizeType, PtrDiffType, and IntPtrType
Saleem Abdulrasool [Fri, 27 Oct 2017 23:04:27 +0000 (23:04 +0000)]
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.

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

7 years ago[Analyzer] [Tests] Fixing typo from the previous commit.
George Karpenkov [Fri, 27 Oct 2017 22:52:36 +0000 (22:52 +0000)]
[Analyzer] [Tests] Fixing typo from the previous commit.

Can not open a non-existent file with r+.

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

7 years ago[MS] Allow access to ambiguous, inaccessible direct bases
Reid Kleckner [Fri, 27 Oct 2017 22:48:41 +0000 (22:48 +0000)]
[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

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

7 years ago[Analyzer] [Tests] Dump the output of scan-build to stdout on failure.
George Karpenkov [Fri, 27 Oct 2017 22:39:54 +0000 (22:39 +0000)]
[Analyzer] [Tests] Dump the output of scan-build to stdout on failure.

Eliminates extra lookup step during debugging.

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

7 years agoStaticAnalyzer: Modularize/fix ODR violations making functions inline but non-static...
David Blaikie [Fri, 27 Oct 2017 20:40:46 +0000 (20:40 +0000)]
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.

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

7 years agoSanitizers.h: Modularize/Fix ODR violations by making inline functions non-static
David Blaikie [Fri, 27 Oct 2017 20:40:45 +0000 (20:40 +0000)]
Sanitizers.h: Modularize/Fix ODR violations by making inline functions non-static

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

7 years agoCharInfo.h: Modularize/fix ODR violations by making inline functions in header not...
David Blaikie [Fri, 27 Oct 2017 20:40:45 +0000 (20:40 +0000)]
CharInfo.h: Modularize/fix ODR violations by making inline functions in header not static

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

7 years agoASTContext.h: Modularize/fix ODR violations by removing 'static' from inline function...
David Blaikie [Fri, 27 Oct 2017 20:40:44 +0000 (20:40 +0000)]
ASTContext.h: Modularize/fix ODR violations by removing 'static' from inline functions in headers

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

7 years agoReplace a few usages of llvm::join with range-version[NFC]
Erich Keane [Fri, 27 Oct 2017 18:45:06 +0000 (18:45 +0000)]
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.

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

7 years agoFilter out invalid 'target' items from being passed to LLVM
Erich Keane [Fri, 27 Oct 2017 18:32:23 +0000 (18:32 +0000)]
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

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

7 years agoRemove x86,x86_32/64 from isValidFeatureName
Erich Keane [Fri, 27 Oct 2017 18:29:02 +0000 (18:29 +0000)]
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

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

7 years ago[refactor] Describe refactorings in the operation classes
Alex Lorenz [Fri, 27 Oct 2017 18:19:11 +0000 (18:19 +0000)]
[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

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

7 years ago[Sema] Fix an assert-on-invalid by avoiding function template specialisation
Alex Lorenz [Fri, 27 Oct 2017 18:13:31 +0000 (18:13 +0000)]
[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

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