]> granicus.if.org Git - clang/log
clang
6 years agoPort getLocStart -> getBeginLoc
Stephen Kelly [Thu, 9 Aug 2018 21:08:08 +0000 (21:08 +0000)]
Port getLocStart -> getBeginLoc

Reviewers: teemperor!

Subscribers: jholewinski, whisperity, jfb, cfe-commits

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

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

6 years agoPort getStartLoc -> getBeginLoc
Stephen Kelly [Thu, 9 Aug 2018 21:05:56 +0000 (21:05 +0000)]
Port getStartLoc -> getBeginLoc

Reviewers: teemperor!

Subscribers: cfe-commits

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

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

6 years ago[NFC] Complete the rule-of-5 for ParsedAttr
Erich Keane [Thu, 9 Aug 2018 21:04:34 +0000 (21:04 +0000)]
[NFC] Complete the rule-of-5 for ParsedAttr

Add move assign/construct as 'deleted' to ParsedAttr
to complete the rule-of-5.

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

6 years ago[NFC] Simplify 'friend' declaration in ParsedAttr
Erich Keane [Thu, 9 Aug 2018 21:03:39 +0000 (21:03 +0000)]
[NFC] Simplify 'friend' declaration in ParsedAttr

As suggested in the post-commit review for D50531,
change from the templatized TrailingObjects friend declaration
to a version referring to the base.

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

6 years ago[NFC] Convert ParsedAttr to use llvm::TrailingObjects
Erich Keane [Thu, 9 Aug 2018 20:25:12 +0000 (20:25 +0000)]
[NFC] Convert ParsedAttr to use llvm::TrailingObjects

ParsedAttr is using a hand-rolled trailing-objects
implementation that gets cleaned up quite a bit by
just using llvm::TrailingObjects. This is a large
TrailingObjects list, but most things are length '0'.

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

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

6 years agoFix build
Stephen Kelly [Thu, 9 Aug 2018 20:21:09 +0000 (20:21 +0000)]
Fix build

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

6 years ago[Sema] P0961R1: Relaxing the structured bindings customization point finding rules
Erik Pilkington [Thu, 9 Aug 2018 20:11:13 +0000 (20:11 +0000)]
[Sema] P0961R1: Relaxing the structured bindings customization point finding rules

Differential revision: https://reviews.llvm.org/D50418

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

6 years agoAdd getEndLoc API to replace getLocEnd
Stephen Kelly [Thu, 9 Aug 2018 20:05:47 +0000 (20:05 +0000)]
Add getEndLoc API to replace getLocEnd

Subscribers: cfe-commits

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

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

6 years agoAdd getBeginLoc API to replace getStartLoc
Stephen Kelly [Thu, 9 Aug 2018 20:05:18 +0000 (20:05 +0000)]
Add getBeginLoc API to replace getStartLoc

Reviewers: teemperor!

Subscribers: cfe-commits

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

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

6 years agoAdd getBeginLoc API to replace getLocStart
Stephen Kelly [Thu, 9 Aug 2018 20:05:03 +0000 (20:05 +0000)]
Add getBeginLoc API to replace getLocStart

Subscribers: cfe-commits

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

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

6 years ago[analyzer] Fix the bug in UninitializedObjectChecker caused by not handling block...
George Karpenkov [Thu, 9 Aug 2018 19:03:12 +0000 (19:03 +0000)]
[analyzer] Fix the bug in UninitializedObjectChecker caused by not handling block pointers

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

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

6 years ago[AArch64][NFC] better matching of AArch64 target in aarch64-cpus.c tests
Sjoerd Meijer [Thu, 9 Aug 2018 14:07:27 +0000 (14:07 +0000)]
[AArch64][NFC] better matching of AArch64 target in aarch64-cpus.c tests

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

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

6 years agoImplement diagnostic stream operator for ParsedAttr.
Erich Keane [Thu, 9 Aug 2018 13:21:32 +0000 (13:21 +0000)]
Implement diagnostic stream operator for ParsedAttr.

As a part of attempting to clean up the way attributes are
printed, this patch adds an operator << to the diagnostics/
partialdiagnostics so that ParsedAttr can be sent directly.

This patch also rewrites a large amount* of the times when
ParsedAttr was printed using its IdentifierInfo object instead
of being printed itself.
*"a large amount" == "All I could find".

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

6 years agoFix structural inequivalency of forward EnumDecl
Gabor Marton [Thu, 9 Aug 2018 12:36:25 +0000 (12:36 +0000)]
Fix structural inequivalency of forward EnumDecl

Summary:
Currently we consider one forward declared RecordDecl and another with a
definition equal. We have to do the same in case of enums.

Reviewers: a_sidorin, r.stahl, xazax.hun

Subscribers: rnkovacs, dkrupp, cfe-commits

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

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

6 years agoAdd support for importing imaginary literals
Gabor Marton [Thu, 9 Aug 2018 12:18:07 +0000 (12:18 +0000)]
Add support for importing imaginary literals

Reviewers: a_sidorin, r.stahl, xazax.hun

Subscribers: rnkovacs, dkrupp, cfe-commits

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

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

6 years agoCorrectly initialise global blocks on Windows.
David Chisnall [Thu, 9 Aug 2018 08:02:42 +0000 (08:02 +0000)]
Correctly initialise global blocks on Windows.

Summary:
Windows does not allow globals to be initialised to point to globals in
another DLL.  Exported globals may be referenced only from code.  Work
around this by creating an initialiser that runs in early library
initialisation and sets the isa pointer.

Reviewers: rjmccall

Reviewed By: rjmccall

Subscribers: cfe-commits

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

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

6 years ago[CMake] Use normalized Windows target triples
Petr Hosek [Thu, 9 Aug 2018 02:16:18 +0000 (02:16 +0000)]
[CMake] Use normalized Windows target triples

Changes the default Windows target triple returned by
GetHostTriple.cmake from the old environment names (which we wanted to
move away from) to newer, normalized ones. This also requires updating
all tests to use the new systems names in constraints.

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

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

6 years agoRefactor attribute printing to be a bit more obviously-correct.
Richard Smith [Thu, 9 Aug 2018 01:21:06 +0000 (01:21 +0000)]
Refactor attribute printing to be a bit more obviously-correct.

No functionality change intended.

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

6 years agoAdded another optimization pass to make vectorizing possible
Emmett Neyman [Thu, 9 Aug 2018 00:58:23 +0000 (00:58 +0000)]
Added another optimization pass to make vectorizing possible

Summary: I noticed that my code wasn't going deep into the loop vectorizer code so added another pass that makes it go further.

Reviewers: morehouse, kcc

Reviewed By: morehouse

Subscribers: cfe-commits, llvm-commits

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

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

6 years agoDelete some unreachable AST printing code.
Richard Smith [Thu, 9 Aug 2018 00:44:49 +0000 (00:44 +0000)]
Delete some unreachable AST printing code.

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

6 years ago[VFS] Remove superfluous semicolon from unittest.
Craig Topper [Wed, 8 Aug 2018 22:31:14 +0000 (22:31 +0000)]
[VFS] Remove superfluous semicolon from unittest.

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

6 years ago[Builtins] Add __builtin_clrsb support to IntExprEvaluator::VisitBuiltinCallExpr
Craig Topper [Wed, 8 Aug 2018 22:31:12 +0000 (22:31 +0000)]
[Builtins] Add __builtin_clrsb support to IntExprEvaluator::VisitBuiltinCallExpr

This addresses a FIXME that has existed since before clang supported the builtin.

This time with only reviewed changes.

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

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

6 years ago[ADT] Normalize empty triple components
Petr Hosek [Wed, 8 Aug 2018 22:23:57 +0000 (22:23 +0000)]
[ADT] Normalize empty triple components

LLVM triple normalization is handling "unknown" and empty components
differently; for example given "x86_64-unknown-linux-gnu" and
"x86_64-linux-gnu" which should be equivalent, triple normalization
returns "x86_64-unknown-linux-gnu" and "x86_64--linux-gnu". autoconf's
config.sub returns "x86_64-unknown-linux-gnu" for both
"x86_64-linux-gnu" and "x86_64-unknown-linux-gnu". This changes the
triple normalization to behave the same way, replacing empty triple
components with "unknown".

This addresses PR37129.

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

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

6 years agoRevert r339287 "[Builtins] Add __builtin_clrsb support to IntExprEvaluator::VisitBuil...
Craig Topper [Wed, 8 Aug 2018 21:21:21 +0000 (21:21 +0000)]
Revert r339287 "[Builtins] Add __builtin_clrsb support to IntExprEvaluator::VisitBuiltinCallExpr"

This add an additional unintended change in it.

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

6 years ago[Builtins] Add __builtin_clrsb support to IntExprEvaluator::VisitBuiltinCallExpr
Craig Topper [Wed, 8 Aug 2018 20:59:40 +0000 (20:59 +0000)]
[Builtins] Add __builtin_clrsb support to IntExprEvaluator::VisitBuiltinCallExpr

This addresses a FIXME that has existed since before clang supported the builtin.

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

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

6 years ago[Headers] Define *_HAS_SUBNORM for FLT, DBL, LDBL
Pirama Arumuga Nainar [Wed, 8 Aug 2018 20:38:38 +0000 (20:38 +0000)]
[Headers] Define *_HAS_SUBNORM for FLT, DBL, LDBL

Summary:
These macros are defined in the C11 standard and can be defined based on
the __*_HAS_DENORM__ default macros.

Reviewers: bruno, rsmith, doug.gregor

Subscribers: llvm-commits, enh, srhines

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

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

6 years ago[Builtins] Implement __builtin_clrsb to be compatible with gcc
Craig Topper [Wed, 8 Aug 2018 19:55:52 +0000 (19:55 +0000)]
[Builtins] Implement __builtin_clrsb to be compatible with gcc

gcc defines an intrinsic called __builtin_clrsb which counts the number of extra sign bits on a number. This is equivalent to counting the number of leading zeros on a positive number or the number of leading ones on a negative number and subtracting one from the result. Since we can't count leading ones we need to invert negative numbers to count zeros.

This patch will cause the builtin to be expanded inline while gcc uses a call to a function like clrsbdi2 that is implemented in libgcc. But this is similar to what we already do for popcnt. And I don't think compiler-rt supports clrsbdi2.

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

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

6 years ago[CodeGen][Timers] Enable llvm::TimePassesIsEnabled when -ftime-report is specified
Craig Topper [Wed, 8 Aug 2018 19:14:23 +0000 (19:14 +0000)]
[CodeGen][Timers] Enable llvm::TimePassesIsEnabled when -ftime-report is specified

r330571 added a new FrontendTimesIsEnabled variable and replaced many usages of llvm::TimePassesIsEnabled. Including the place that set llvm::TimePassesIsEnabled for -ftime-report. The effect of this is that -ftime-report now only contains the timers specifically referenced in CodeGenAction.cpp and none of the timers in the backend.

This commit adds back the assignment, but otherwise leaves everything else unchanged.

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

6 years agoAMDGPU: Fix enabling denormals by default on pre-VI targets
Matt Arsenault [Wed, 8 Aug 2018 17:48:37 +0000 (17:48 +0000)]
AMDGPU: Fix enabling denormals by default on pre-VI targets

Fast FMAF is not a sufficient condition to enable denormals.
Before VI, enabling denormals caused F32 instructions to
run at F64 speeds.

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

6 years agoCDDecl More automatic variable tail padding test
JF Bastien [Wed, 8 Aug 2018 17:05:17 +0000 (17:05 +0000)]
CDDecl More automatic variable tail padding test

Test tail padded automatic variable at different width, because they encounter different codegen.

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

6 years ago[DebugInfo][OpenCL] Address post-commit review for r338299
Scott Linder [Wed, 8 Aug 2018 15:56:12 +0000 (15:56 +0000)]
[DebugInfo][OpenCL] Address post-commit review for r338299

NFC refactor of code to generate debug info for OpenCL 2.X blocks.

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

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

6 years ago[CGObjCGNU] Rename GetSelector helper method to fix -Woverloaded-virtual warning...
Simon Pilgrim [Wed, 8 Aug 2018 15:53:14 +0000 (15:53 +0000)]
[CGObjCGNU] Rename GetSelector helper method to fix -Woverloaded-virtual warning (PR38210)

As suggested by @theraven on PR38210, this patch fixes the gcc -Woverloaded-virtual warnings by renaming the extra CGObjCGNU::GetSelector method to CGObjCGNU::GetTypedSelector

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

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

6 years agoFix -Wdocumentation warnings. NFCI.
Simon Pilgrim [Wed, 8 Aug 2018 15:34:00 +0000 (15:34 +0000)]
Fix -Wdocumentation warnings. NFCI.

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

6 years ago[AST] Check described template at structural equivalence check.
Balazs Keri [Wed, 8 Aug 2018 15:04:27 +0000 (15:04 +0000)]
[AST] Check described template at structural equivalence check.

Summary:
When checking a class or function the described class or function template
is checked too.
Split StructuralEquivalenceContext::Finish into multiple functions.
Improved test with symmetric check, added new tests.

Reviewers: martong, a.sidorin, a_sidorin, bruno

Reviewed By: martong, a.sidorin

Subscribers: rnkovacs, cfe-commits

Tags: #clang

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

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

6 years ago[analyzer] Fix a typo in `RegionStore.txt`.
Henry Wong [Wed, 8 Aug 2018 13:37:28 +0000 (13:37 +0000)]
[analyzer] Fix a typo in `RegionStore.txt`.

Summary: The typo of the description for default bindings can be confusing.

Reviewers: NoQ, george.karpenkov

Reviewed By: NoQ, george.karpenkov

Subscribers: xazax.hun, szepet, a.sidorin, mikhail.ramalho, cfe-commits, MTC

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

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

6 years ago[analyzer][UninitializedObjectChecker] Pointer/reference objects are dereferenced...
Kristof Umann [Wed, 8 Aug 2018 13:18:53 +0000 (13:18 +0000)]
[analyzer][UninitializedObjectChecker] Pointer/reference objects are dereferenced according to dynamic type

This patch fixed an issue where the dynamic type of pointer/reference
object was known by the analyzer, but wasn't obtained in the checker,
which resulted in false negatives. This should also increase reliability
of the checker, as derefencing is always done now according to the
dynamic type (even if that happens to be the same as the static type).

Special thanks to Artem Degrachev for setting me on the right track.

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

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

6 years ago[analyzer][UninitializedObjectChecker] Fixed a false negative by no longer filtering...
Kristof Umann [Wed, 8 Aug 2018 12:23:02 +0000 (12:23 +0000)]
[analyzer][UninitializedObjectChecker] Fixed a false negative by no longer filtering out certain constructor calls

As of now, all constructor calls are ignored that are being called
by a constructor. The point of this was not to analyze the fields
of an object, so an uninitialized field wouldn't be reported
multiple times.

This however introduced false negatives when the two constructors
were in no relation to one another -- see the test file for a neat
example for this with singletons. This patch aims so fix this issue.

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

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

6 years ago[ASTImporter] Load external Decls when getting field index.
Balazs Keri [Wed, 8 Aug 2018 09:40:57 +0000 (09:40 +0000)]
[ASTImporter] Load external Decls when getting field index.

Summary:
At equality check of fields without name the index of fields is compared.
At determining the index of a field all fields of the parent context
should be loaded from external source to find the field at all.

Reviewers: a.sidorin, a_sidorin, r.stahl

Reviewed By: a.sidorin

Subscribers: martong, cfe-commits

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

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

6 years agoFixed a breaking test case
Balaji V. Iyer [Wed, 8 Aug 2018 02:47:28 +0000 (02:47 +0000)]
Fixed a breaking test case

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

6 years ago[NFC][VFS] Fix typos in comments.
Volodymyr Sapsai [Wed, 8 Aug 2018 01:28:37 +0000 (01:28 +0000)]
[NFC][VFS] Fix typos in comments.

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

6 years agoPR38286: Don't crash when attempting to define a constructor for an
Richard Smith [Wed, 8 Aug 2018 00:42:42 +0000 (00:42 +0000)]
PR38286: Don't crash when attempting to define a constructor for an
incomplete class template.

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

6 years ago[CodeGen] IncompleteArray Support
Balaji V. Iyer [Wed, 8 Aug 2018 00:01:21 +0000 (00:01 +0000)]
[CodeGen] IncompleteArray Support

Added code to support ArrayType that is not ConstantArray.

https://reviews.llvm.org/D49952
rdar://42476155

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

6 years ago[analyzer] Avoid querying this-pointers for static-methods.
Matt Davis [Tue, 7 Aug 2018 23:13:28 +0000 (23:13 +0000)]
[analyzer] Avoid querying this-pointers for static-methods.

Summary:
The loop-widening code processes c++ methods looking for `this` pointers.  In
the case of static methods (which do not have `this` pointers), an assertion
was triggering.   This patch avoids trying to process `this` pointers for
static methods, and thus avoids triggering the assertion .

Reviewers: dcoughlin, george.karpenkov, NoQ

Reviewed By: NoQ

Subscribers: NoQ, xazax.hun, szepet, a.sidorin, mikhail.ramalho, cfe-commits

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

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

6 years ago[VFS] Unify iteration code for VFSFromYamlDirIterImpl, NFC intended.
Volodymyr Sapsai [Tue, 7 Aug 2018 23:00:40 +0000 (23:00 +0000)]
[VFS] Unify iteration code for VFSFromYamlDirIterImpl, NFC intended.

First and subsequent iteration steps are similar, capture this similarity.

Reviewers: bruno, benlangmuir

Reviewed By: bruno

Subscribers: dexonsmith, cfe-commits

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

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

6 years ago[Sema] Ensure an auto non-type template parameter is dependent
Erik Pilkington [Tue, 7 Aug 2018 22:59:02 +0000 (22:59 +0000)]
[Sema] Ensure an auto non-type template parameter is dependent

The dependent auto was getting stripped away while rebuilding the template
parameter type, so substitute it in.

rdar://41852459

Differential revision: https://reviews.llvm.org/D50088

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

6 years ago[NFC] Improve auto-var-init alignment check
JF Bastien [Tue, 7 Aug 2018 22:43:44 +0000 (22:43 +0000)]
[NFC] Improve auto-var-init alignment check

We're not actually testing for alignment, we just want to know that whatever incoming alignment got propagated. Do that by capturing the alignment and checking that it's actually what's passed later, instead of hard-coding an alignment value.

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

6 years ago[NFC] CGDecl factor out constant emission
JF Bastien [Tue, 7 Aug 2018 21:55:13 +0000 (21:55 +0000)]
[NFC] CGDecl factor out constant emission

The code is cleaner this way, and with some changes I'm playing with it makes sense to split it out so we can reuse it.

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

6 years agoFix one hard coded value I missed in r339185.
Douglas Yung [Tue, 7 Aug 2018 21:37:14 +0000 (21:37 +0000)]
Fix one hard coded value I missed in r339185.

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

6 years agoClean up and simplify RequireCompleteType.
Richard Smith [Tue, 7 Aug 2018 21:35:41 +0000 (21:35 +0000)]
Clean up and simplify RequireCompleteType.

No functional change intended, except that we will now produce more
"declared here" notes.

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

6 years agoMake test more robust by not checking hard coded debug info values, but instead check...
Douglas Yung [Tue, 7 Aug 2018 21:22:49 +0000 (21:22 +0000)]
Make test more robust by not checking hard coded debug info values, but instead check the relationships between them.

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

6 years ago[analyzer] [tests] Do not be verbose by default when updating reference results.
George Karpenkov [Tue, 7 Aug 2018 21:14:35 +0000 (21:14 +0000)]
[analyzer] [tests] Do not be verbose by default when updating reference results.

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

6 years ago[Headers] Expand _Unwind_Exception for SEH on MinGW/x86_64
Martin Storsjo [Tue, 7 Aug 2018 20:02:40 +0000 (20:02 +0000)]
[Headers] Expand _Unwind_Exception for SEH on MinGW/x86_64

This matches how GCC defines this struct.

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

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

6 years ago[Sema] Fix for crash on conditional operation with address_space pointer
Leonard Chan [Tue, 7 Aug 2018 19:43:53 +0000 (19:43 +0000)]
[Sema] Fix for crash on conditional operation with address_space pointer

Compiling the following causes clang to crash

```
char *cmp(__attribute__((address_space(1))) char *x, __attribute__((address_space(2))) char *y) {
  return x < y ? x : y;
}
```

with the message: "wrong cast for pointers in different address
spaces(must be an address space cast)!"

This is because during IR emission, the source and dest type for a
bitcast should not have differing address spaces.

This fix prints an error since the code shouldn't compile in the first place.

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

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

6 years ago[VFS] Emit an error when entry at root level uses a relative path.
Volodymyr Sapsai [Tue, 7 Aug 2018 19:05:41 +0000 (19:05 +0000)]
[VFS] Emit an error when entry at root level uses a relative path.

Entries with only a filename prevent us from building a file system tree and
cause the assertion

> Assertion failed: (NewParentE && "Parent entry must exist"), function uniqueOverlayTree, file clang/lib/Basic/VirtualFileSystem.cpp, line 1303.

Entries with a relative path are simply not discoverable during header search.

rdar://problem/28990865

Reviewers: bruno, benlangmuir

Reviewed By: bruno

Subscribers: dexonsmith, cfe-commits

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

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

6 years ago[WebAssembly] Remove use of lld -flavor flag
Sam Clegg [Tue, 7 Aug 2018 18:55:41 +0000 (18:55 +0000)]
[WebAssembly] Remove use of lld -flavor flag

This flag is deprecated. The preferred way to select the lld
flavor is by calling it by one of its aliases.

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

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

6 years ago[WebAssembly] Force use of lld for test/Driver/wasm-toolchain.c(pp)
David Greene [Tue, 7 Aug 2018 17:44:43 +0000 (17:44 +0000)]
[WebAssembly] Force use of lld for test/Driver/wasm-toolchain.c(pp)

lld is the only supported linker that works for WebAssembly, so ensure
clang is using it for this test. This gets the tests passing when
configuring clang to use a different linker by default.

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

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

6 years ago[OPENMP] Mark variables captured in declare target region as implicitly
Alexey Bataev [Tue, 7 Aug 2018 16:14:36 +0000 (16:14 +0000)]
[OPENMP] Mark variables captured in declare target region as implicitly
declare target.

According to OpenMP 5.0, variables captured in lambdas in declare target
regions must be considered as implicitly declare target.

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

6 years ago[OpenCL] Restore r338899 (reverted in r338904), fixing stack-use-after-return
Scott Linder [Tue, 7 Aug 2018 15:52:49 +0000 (15:52 +0000)]
[OpenCL] Restore r338899 (reverted in r338904), fixing stack-use-after-return

Always emit alloca in entry block for enqueue_kernel builtin.

Ensures the statically sized alloca is not converted to DYNAMIC_STACKALLOC
later because it is not in the entry block.

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

6 years ago[analyzer][UninitializedObjectChecker] New flag to turn off dereferencing
Kristof Umann [Tue, 7 Aug 2018 12:55:26 +0000 (12:55 +0000)]
[analyzer][UninitializedObjectChecker] New flag to turn off dereferencing

Even for a checker being in alpha, some reports about pointees held so little
value to the user that it's safer to disable pointer/reference chasing for now.
It can be enabled with a new flag, in which case checker should function as it
has always been. This can be set with `CheckPointeeInitialization`.

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

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

6 years ago[AST][NFC] Use unsigned in the bit-fields of IdentifierInfo
Bruno Ricci [Tue, 7 Aug 2018 12:40:41 +0000 (12:40 +0000)]
[AST][NFC] Use unsigned in the bit-fields of IdentifierInfo

Avoid mixing bool and unsigned in the bit-fields of IdentifierInfo
since MSVC packs this poorly. Also clang-format the changes.

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

6 years ago[AST][NFC] Use unsigned in the bit-fields of PrintingPolicy
Bruno Ricci [Tue, 7 Aug 2018 12:23:41 +0000 (12:23 +0000)]
[AST][NFC] Use unsigned in the bit-fields of PrintingPolicy

Avoid the mix between bools and unsigned since MSVC pack
this poorly.

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

6 years ago[objc-gnustep] Don't emit .guess ivar offset vars.
David Chisnall [Tue, 7 Aug 2018 12:02:46 +0000 (12:02 +0000)]
[objc-gnustep] Don't emit .guess ivar offset vars.

These were intended to allow non-fragile and fragile ABI code to be
mixed, as long as the fragile classes were higher up the hierarchy than
the non-fragile ones.  Unfortunately:

 - No one actually wants to do this.
 - Recent versions of Linux's run-time linker break it.

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

6 years ago[clang-format] comment reflow: add last line's penalty when ending broken
Krasimir Georgiev [Tue, 7 Aug 2018 10:23:24 +0000 (10:23 +0000)]
[clang-format] comment reflow: add last line's penalty when ending broken

Summary:
This fixes a bug in clang-format where the last line's penalty is not
taken into account when its ending is broken. Usually the last line's penalty
is handled by addNextStateToQueue, but in cases where the trailing `*/` is put
on a newline, the contents of the last line have to be considered for penalizing.

Reviewers: mprobst

Reviewed By: mprobst

Subscribers: cfe-commits

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

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

6 years agoFix clash of gcc toolchains in driver regression tests
Karl-Johan Karlsson [Tue, 7 Aug 2018 08:10:33 +0000 (08:10 +0000)]
Fix clash of gcc toolchains in driver regression tests

For some regression tests the path to the right toolchain is specified
using the -sysroot switch. However, if clang was configured with a
custom gcc toolchain (either by using GCC_INSTALL_PREFIX in cmake or the
equivalent configure command), the path to the custom gcc toolchain path
takes precedence to the one specified by sysroot. This causes several
regression tests to fail as they will be using an unexpected path. This
patch fixes this issue by adding --gcc-toolchain='' to all tests that
rely on that. The empty string causes the driver to pick the path from
sysroot instead.

This patch contain the same kind of fixes as done in rC225182

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

6 years agoAMDGPU: Add builtin for s_dcache_wb
Matt Arsenault [Tue, 7 Aug 2018 07:49:13 +0000 (07:49 +0000)]
AMDGPU: Add builtin for s_dcache_wb

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

6 years agoAMDGPU: Add builtin for s_dcache_inv_vol
Matt Arsenault [Tue, 7 Aug 2018 07:49:04 +0000 (07:49 +0000)]
AMDGPU: Add builtin for s_dcache_inv_vol

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

6 years agoAuto var init test fix #2
JF Bastien [Tue, 7 Aug 2018 04:44:13 +0000 (04:44 +0000)]
Auto var init test fix #2

It turns out that the AVX bots have different alignment for their vectors, and my test mistakenly assumed a particular vector alignent on the stack. Instead, capture the alignment and test for it in subsequent operations.

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

6 years agoRemove broken command flag
JF Bastien [Tue, 7 Aug 2018 04:03:03 +0000 (04:03 +0000)]
Remove broken command flag

I was using it for testing, r339089 shouldn't have contained it.

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

6 years ago[NFC] Test automatic variable initialization
JF Bastien [Tue, 7 Aug 2018 03:12:52 +0000 (03:12 +0000)]
[NFC] Test automatic variable initialization

Summary:
r337887 started using memset for automatic variable initialization where sensible. A follow-up discussion leads me to believe that we should better test automatic variable initialization, and that there are probably follow-up patches in clang and LLVM to improve codegen. It’ll be important to measure -O0 compile time, and figure out which transforms should be in the frontend versus the backend.

This patch is just a test of the current behavior, no questions asked. Follow-up patches will tune the code generation.

<rdar://problem/42981573>

Subscribers: dexonsmith, cfe-commits

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

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

6 years ago[analyzer] pr37204: Take signedness into account in getTruthValue().
Artem Dergachev [Tue, 7 Aug 2018 02:27:38 +0000 (02:27 +0000)]
[analyzer] pr37204: Take signedness into account in getTruthValue().

It now actually produces a signed APSInt when the QualType passed into it is
signed, which is what any caller would expect.

Fixes a couple of crashes.

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

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

6 years ago[analyzer] NFC: Document that we support implicit argument constructors.
Artem Dergachev [Tue, 7 Aug 2018 02:22:59 +0000 (02:22 +0000)]
[analyzer] NFC: Document that we support implicit argument constructors.

The change in the AST in r338135 caused us to accidentally support
inlining constructors of operator implicit arguments. Previously they were
hard to support because they were treated as arguments in expressions
but not in declarations, but now they can be transparently treated as
simple temporaries.

Add tests and comments to explain how it now works.

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

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

6 years agoPerforming a test commmit as requested by Chris Lattner.
Balaji V. Iyer [Tue, 7 Aug 2018 00:31:44 +0000 (00:31 +0000)]
Performing a test commmit as requested by Chris Lattner.
-This line, and those below, will be ignored--

M    TemplateBase.h

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

6 years agoChanged how LLVM IR was generated to increase vectorization
Emmett Neyman [Mon, 6 Aug 2018 23:11:38 +0000 (23:11 +0000)]
Changed how LLVM IR was generated to increase vectorization

Summary: Changed the structure of the generated IR to make it easier to vectorize

Reviewers: morehouse, kcc

Reviewed By: morehouse

Subscribers: cfe-commits, llvm-commits

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

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

6 years ago[analyzer] Add ASTContext to CheckerManager
George Karpenkov [Mon, 6 Aug 2018 23:09:07 +0000 (23:09 +0000)]
[analyzer] Add ASTContext to CheckerManager

Some checkers require ASTContext. Having it in the constructor saves a
lot of boilerplate of having to pass it around.

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

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

6 years ago[lit, python] Always add quotes around the python path in lit
Stella Stamenova [Mon, 6 Aug 2018 22:37:45 +0000 (22:37 +0000)]
[lit, python] Always add quotes around the python path in lit

Summary:
The issue with the python path is that the path to python on Windows can contain spaces. To make the tests always work, the path to python needs to be surrounded by quotes.

This is a companion change to: https://reviews.llvm.org/D50206

Reviewers: asmith, zturner

Subscribers: cfe-commits

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

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

6 years ago[analyzer] InnerPointerChecker: fix displayed checker name.
Reka Kovacs [Mon, 6 Aug 2018 22:03:42 +0000 (22:03 +0000)]
[analyzer] InnerPointerChecker: fix displayed checker name.

For InnerPointerChecker to function properly, both the checker itself
and parts of MallocChecker that handle relevant use-after-free problems
need to be turned on. So far, the latter part has been developed within
MallocChecker's NewDelete sub-checker, often causing warnings to appear
under that name. This patch defines a new CheckKind within MallocChecker
for the inner pointer checking functionality, so that the correct name
is displayed in warnings and in the ExplodedGraph.

Tested on clang-tidy.

Differential Review: https://reviews.llvm.org/D50211

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

6 years ago[VirtualFileSystem] InMemoryFileSystem::status: Return a Status with the requested...
Simon Marchi [Mon, 6 Aug 2018 21:48:20 +0000 (21:48 +0000)]
[VirtualFileSystem] InMemoryFileSystem::status: Return a Status with the requested name

Summary:
InMemoryFileSystem::status behaves differently than
RealFileSystem::status.  The Name contained in the Status returned by
RealFileSystem::status will be the path as requested by the caller,
whereas InMemoryFileSystem::status returns the normalized path.

For example, when requested the status for "../src/first.h",
RealFileSystem returns a Status with "../src/first.h" as the Name.
InMemoryFileSystem returns "/absolute/path/to/src/first.h".

The reason for this change is that I want to make a unit test in the
clangd testsuite (where we use an InMemoryFileSystem) to reproduce a
bug I get with the clangd program (where a RealFileSystem is used).
This difference in behavior "hides" the bug in the unit test version.

An indirect impact of this change is that a -Wnonportable-include-path
warning is now emitted in test PCH/case-insensitive-include.c.  This is
because the real path of the included file (with the wrong case) was not
available previously, whereas it is now.

Reviewers: malaperle, ilya-biryukov, bkramer

Reviewed By: ilya-biryukov

Subscribers: eric_niebler, malaperle, omtcyfz, hokein, bkramer, ilya-biryukov, ioeric, cfe-commits

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

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

6 years ago[MinGW] Predefine UNICODE if -municode is specified during compilation
Martin Storsjo [Mon, 6 Aug 2018 19:48:44 +0000 (19:48 +0000)]
[MinGW] Predefine UNICODE if -municode is specified during compilation

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

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

6 years agoFix for broken build on clang-hexagon-elf for ambiguous call to
Leonard Chan [Mon, 6 Aug 2018 19:31:00 +0000 (19:31 +0000)]
Fix for broken build on clang-hexagon-elf for ambiguous call to
std::abs.

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

6 years ago[NFC] Remove TODO comment that no longer applies (ParsedAttr)
Erich Keane [Mon, 6 Aug 2018 18:11:48 +0000 (18:11 +0000)]
[NFC] Remove TODO comment that no longer applies (ParsedAttr)

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

6 years agoRemoved the OverflowConversionsToFract tests for now. Will add them back
Leonard Chan [Mon, 6 Aug 2018 18:02:16 +0000 (18:02 +0000)]
Removed the OverflowConversionsToFract tests for now. Will add them back
in once I figure out why this doesn't work on windows.

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

6 years agoFix for failing test from sanitizer-x86_64-linux-fast where there was a
Leonard Chan [Mon, 6 Aug 2018 17:55:38 +0000 (17:55 +0000)]
Fix for failing test from sanitizer-x86_64-linux-fast where there was a
left shift on a negative value.

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

6 years agoForce test/Driver/fuchsia.c(pp) to use lld
David Greene [Mon, 6 Aug 2018 17:35:44 +0000 (17:35 +0000)]
Force test/Driver/fuchsia.c(pp) to use lld

The Fuchsia driver relies on lld so invoke clang with
-fuse-ld=lld. This gets the test passing when the clang default linker
is something other than lld.

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

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

6 years ago[Fixed Point Arithmetic] Remove unused include.
Benjamin Kramer [Mon, 6 Aug 2018 16:53:21 +0000 (16:53 +0000)]
[Fixed Point Arithmetic] Remove unused include.

lib/Basic cannot depend on lib/AST.

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

6 years ago[AST] Remove unnecessary indirections in DeclarationNameTable
Bruno Ricci [Mon, 6 Aug 2018 16:47:31 +0000 (16:47 +0000)]
[AST] Remove unnecessary indirections in DeclarationNameTable

DeclarationNameTable currently hold 3 "void *" to
FoldingSet<CXXSpecialName>, FoldingSet<CXXLiteralOperatorIdName>
and FoldingSet<CXXDeductionGuideNameExtra>.

CXXSpecialName, CXXLiteralOperatorIdName and
CXXDeductionGuideNameExtra are private classes holding extra
information about a "special" declaration name and are in
AST/DeclarationName.cpp. The original intent seems to have
been to keep these classes private and only expose
DeclarationNameExtra and DeclarationName (the code dates from
2008 and has not been significantly changed since).

However this make the code less straightforward than necessary
because of the need to have "void *" in DeclarationNameTable
(with 1 of 3 comments wrong) and to manually allocate/deallocate
the FoldingSets.

Moreover removing the extra indirections reduce the run-time of
an fsyntax-only on all of Boost by 2.3% which is not totally
unexpected given how frequently this data structure is used
(especially for C++).

A concern raised by erichkeane during the review was that
including Type.h would increase the compile time unreasonably.
However test builds (both clean and incremental) showed that
this patch did not result in any compile time increase.

Reviewed By: erichkeane

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

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

6 years ago[Fixed Point Arithmetic] Fixed Point Constant
Leonard Chan [Mon, 6 Aug 2018 16:42:37 +0000 (16:42 +0000)]
[Fixed Point Arithmetic] Fixed Point Constant

This patch proposes an abstract type that represents fixed point numbers, similar to APInt or APSInt that was discussed in https://reviews.llvm.org/D48456#inline-425585. This type holds a value, scale, and saturation and is meant to perform intermediate calculations on constant fixed point values.

Currently this class is used as a way for handling the conversions between fixed point numbers with different sizes and radixes. For example, if I'm casting from a signed _Accum to a saturated unsigned short _Accum, I will need to check the value of the signed _Accum to see if it fits into the short _Accum which involves getting and comparing against the max/min values of the short _Accum. The FixedPointNumber class currently handles the radix shifting and extension when converting to a signed _Accum.

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

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

6 years ago[Fixed Point Arithmetic] Fix for FixedPointValueToString
Leonard Chan [Mon, 6 Aug 2018 16:05:08 +0000 (16:05 +0000)]
[Fixed Point Arithmetic] Fix for FixedPointValueToString

- Print negative numbers correctly
- Handle APInts of different sizes
- Add formal unit tests for FixedPointValueToString
- Add tests for checking correct printing when padding is set
- Restrict to printing in radix 10 since that's all we need for now

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

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

6 years ago[AST] Add individual size info for Types in -print-stats
Bruno Ricci [Mon, 6 Aug 2018 15:17:32 +0000 (15:17 +0000)]
[AST] Add individual size info for Types in -print-stats

This mirrors what is done for Decls and Stmts in the -print-stats
output, ie instead of printing "57426 LValueReference types"
we print "57426 LValueReference types, 40 each (2297040 bytes)".

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

6 years ago[ASTmporter] SourceRange-free function parameter checking for declarations
Gabor Marton [Mon, 6 Aug 2018 14:38:37 +0000 (14:38 +0000)]
[ASTmporter] SourceRange-free function parameter checking for declarations

Summary: The previous code which avoided infinite recursion (because of reparsing declarations in function parameter lists) contained SourceRange dependent code which had some problems when parameter types were coming from macros. The new solution is not using macros and therefore much safer. A couple of importer problems are fixed in redis and tmux by this fix. Various unittests are included.

Reviewers: a.sidorin, r.stahl, a_sidorin

Reviewed By: a_sidorin

Subscribers: cfe-commits, dkrupp, balazske, martong

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

Patch by Zoltan Gera!

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

6 years ago[AST] Move the enum in ObjCMethodDeclBitfields
Bruno Ricci [Mon, 6 Aug 2018 14:33:45 +0000 (14:33 +0000)]
[AST] Move the enum in ObjCMethodDeclBitfields

Move the enum { ObjCMethodFamilyBitWidth = 4 } to the top of
the class. For some dark reason having the enum between the
bitfields breaks the packing with gcc version 7.3-win32 20180312.

Reported by: Abramo Bagnara (by email)

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

6 years ago[clang] Fix broken include_next in float.h
Louis Dionne [Mon, 6 Aug 2018 14:29:47 +0000 (14:29 +0000)]
[clang] Fix broken include_next in float.h

Summary:
The code defines __FLOAT_H and then includes the next <float.h>, which is
guarded on __FLOAT_H so it gets skipped entirely. This commit uses the header
guard __CLANG_FLOAT_H, like other headers (such as limits.h) do.

Reviewers: jfb

Subscribers: dexonsmith, cfe-commits

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

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

6 years agoclang-cl: Parse the new /JMC flag
Hans Wennborg [Mon, 6 Aug 2018 11:34:46 +0000 (11:34 +0000)]
clang-cl: Parse the new /JMC flag

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

6 years ago[clang-rename] make clang-rename.py vim integration python3 compatible
Jonas Toth [Mon, 6 Aug 2018 09:08:06 +0000 (09:08 +0000)]
[clang-rename] make clang-rename.py vim integration python3 compatible

Summary:
This patch makes the clang-rename.py script useable for vim with only python3
support. It uses the print-function and adjust the doc slightly to mention
the correct python3 command for the letter mapping in vim.

Reviewers: arphaman, klimek, aaron.ballman, hokein

Reviewed By: hokein

Subscribers: cfe-commits

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

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

6 years agoRevert "[DebugInfo] Generate debug information for labels. (Fix PR37395)"
Hsiangkai Wang [Mon, 6 Aug 2018 07:07:18 +0000 (07:07 +0000)]
Revert "[DebugInfo] Generate debug information for labels. (Fix PR37395)"

Build failed in
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-autoconf/builds/27258

In lib/CodeGen/LiveDebugVariables.cpp:589, it uses std::prev(MBBI) to
get DebugValue's SlotIndex. however, the previous instruction may be
also a debug instruction.

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

6 years ago[DebugInfo] Generate debug information for labels. (Fix PR37395)
Hsiangkai Wang [Mon, 6 Aug 2018 05:58:59 +0000 (05:58 +0000)]
[DebugInfo] Generate debug information for labels. (Fix PR37395)

Generate DILabel metadata and call llvm.dbg.label after label
statement to associate the metadata with the label.

After fixing PR37395.

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

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

6 years ago[DebugInfo] Use DbgVariableIntrinsic as the base class of variables.
Hsiangkai Wang [Mon, 6 Aug 2018 04:00:08 +0000 (04:00 +0000)]
[DebugInfo] Use DbgVariableIntrinsic as the base class of variables.

After refactoring DbgInfoIntrinsic class hierarchy, we use
DbgVariableIntrinsic as the base class of variable debug info.

In resolveTopLevelMetadata() in CGVTables.cpp, we only care about
dbg.value, so we try to cast the instructions to DbgVariableIntrinsic
before resolving variables.

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

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

6 years ago[docs] Don't use the `asm` syntax highlighting (which our docs builder
Chandler Carruth [Mon, 6 Aug 2018 01:28:42 +0000 (01:28 +0000)]
[docs] Don't use the `asm` syntax highlighting (which our docs builder
errors on) and clean up the formattting.

This isn't actualy assembly anyways, so dropping the highlighting is
probably for the best.

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

6 years agoFix tests for changed opt remarks format
David Bolvansky [Sun, 5 Aug 2018 14:53:34 +0000 (14:53 +0000)]
Fix tests for changed opt remarks format

Summary:
Optimization remark format is slightly changed by LLVM patch D49412.
Two tests are fixed with expected messages changed.
Frankly speaking I have not tested this change yet. I will test when manage to setup the project.

Reviewers: xbolva00

Reviewed By: xbolva00

Subscribers: mehdi_amini, eraman, steven_wu, dexonsmith

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

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

6 years ago[AST][NFC] Remove unneeded forward declarations in Type.h
Bruno Ricci [Sun, 5 Aug 2018 09:48:59 +0000 (09:48 +0000)]
[AST][NFC] Remove unneeded forward declarations in Type.h

These forward declarations for various classes in the Type
hierarchy are not needed since they are all forward declared
systematically a few lines below.

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

6 years agoUse Optional instead of unique_ptr; NFC
George Burgess IV [Sun, 5 Aug 2018 01:37:07 +0000 (01:37 +0000)]
Use Optional instead of unique_ptr; NFC

Looks like the only reason we use a unique_ptr here is so that we can
conditionally construct a LogicalErrorHandler. It's a small type, and
Optional can do the same thing with 100% fewer heap allocations.

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