]> granicus.if.org Git - clang/log
clang
10 years agoPR19215: When writing/reading a PCH that imported a module, store the location
Richard Smith [Fri, 21 Mar 2014 00:33:59 +0000 (00:33 +0000)]
PR19215: When writing/reading a PCH that imported a module, store the location
at which that PCH imported each visible submodule of the module. Such locations
are needed when synthesizing macro directives resulting from the import.

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

10 years agoFixed newlines.
Alexander Kornienko [Fri, 21 Mar 2014 00:07:27 +0000 (00:07 +0000)]
Fixed newlines.

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

10 years agoPGO: Don't define instrumentation data available_externally
Duncan P. N. Exon Smith [Thu, 20 Mar 2014 22:50:08 +0000 (22:50 +0000)]
PGO: Don't define instrumentation data available_externally

Variables with available_externally linkage can be dropped at will.
This causes link errors, since there are still references to the
instrumentation!  linkonce_odr is almost equivalent, so use that
instead.

As a drive-by fix (I don't have an Elf system, so I'm not sure how to
write a testcase), use linkonce linkage for the instrumentation of
extern_weak functions.

<rdar://problem/15943240>

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

10 years agoPGO: Rename FuncLinkage to VarLinkage; no functionality change
Duncan P. N. Exon Smith [Thu, 20 Mar 2014 22:49:50 +0000 (22:49 +0000)]
PGO: Rename FuncLinkage to VarLinkage; no functionality change

The variable is used to set the linkage for variables, and will become
different from function linkage in a follow-up commit.

<rdar://problem/15943240>

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

10 years agoWhen the exception specification for a function in an imported PCH or module is
Richard Smith [Thu, 20 Mar 2014 21:47:22 +0000 (21:47 +0000)]
When the exception specification for a function in an imported PCH or module is
resolved, emit an update record.

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

10 years agoRefactor and simplify DeclUpdates serialization.
Richard Smith [Thu, 20 Mar 2014 21:02:00 +0000 (21:02 +0000)]
Refactor and simplify DeclUpdates serialization.

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

10 years agoConsumed Analysis: IgnoreParens bugfix.
DeLesley Hutchins [Thu, 20 Mar 2014 20:39:20 +0000 (20:39 +0000)]
Consumed Analysis: IgnoreParens bugfix.

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

10 years agoFix PR19172 - wrong this adjustment calculated for virtual destructor in a class...
Timur Iskhodzhanov [Thu, 20 Mar 2014 20:38:34 +0000 (20:38 +0000)]
Fix PR19172 - wrong this adjustment calculated for virtual destructor in a class with complex inheritance

Reviewed at http://llvm-reviews.chandlerc.com/D3128

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

10 years agoRefactor to move decl update emission into the decl emission loop.
Richard Smith [Thu, 20 Mar 2014 20:07:19 +0000 (20:07 +0000)]
Refactor to move decl update emission into the decl emission loop.

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

10 years agoPGO: Change runtime prefix from pgo to profile
Duncan P. N. Exon Smith [Thu, 20 Mar 2014 20:00:41 +0000 (20:00 +0000)]
PGO: Change runtime prefix from pgo to profile

These functions are in the profile runtime.  PGO comes later.

Unfortunately, there's only room for 16 characters in a Darwin section,
so use __llvm_prf_ instead of __llvm_profile_ for section names.

<rdar://problem/15943240>

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

10 years agoRearrange serialization block order to put decl update emission into the same
Richard Smith [Thu, 20 Mar 2014 19:44:17 +0000 (19:44 +0000)]
Rearrange serialization block order to put decl update emission into the same
block as decl and type emission. This allows decl updates include statements
and expressions. No functionality change (but the generated PCM files are
incompatible with earlier versions of Clang).

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

10 years agoPGO: Remove explicit static initialization
Duncan P. N. Exon Smith [Thu, 20 Mar 2014 19:23:46 +0000 (19:23 +0000)]
PGO: Remove explicit static initialization

Remove the remaining explicit static initialization from translation
units, at least on Darwin.  Instead, create a use of __llvm_pgo_runtime,
which will pull in required code from compiler-rt.

After this commit (and its pair in compiler-rt), a user can define their
own __llvm_pgo_runtime to satisfy this undefined symbol and call the
functions in compiler-rt directly.

<rdar://problem/15943240>

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

10 years ago[-Wunreachable-code] Tweak isTrivialDoWhile() to handle implicit casts.
Ted Kremenek [Thu, 20 Mar 2014 18:47:53 +0000 (18:47 +0000)]
[-Wunreachable-code] Tweak isTrivialDoWhile() to handle implicit casts.

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

10 years agoRemove dead assignment dominated by a call to llvm_unreachable().
Ted Kremenek [Thu, 20 Mar 2014 18:47:50 +0000 (18:47 +0000)]
Remove dead assignment dominated by a call to llvm_unreachable().

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

10 years ago[analyzer] Fix a bad bug in reversePropagateInterstingSymbols() where only one subexp...
Ted Kremenek [Thu, 20 Mar 2014 18:47:47 +0000 (18:47 +0000)]
[analyzer] Fix a bad bug in reversePropagateInterstingSymbols() where only one subexpression of BinaryOperator would be explored.

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

10 years agoUse nullptr; no functionality change
Duncan P. N. Exon Smith [Thu, 20 Mar 2014 18:40:55 +0000 (18:40 +0000)]
Use nullptr; no functionality change

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

10 years agoCoding style fixup; no functionality change
Duncan P. N. Exon Smith [Thu, 20 Mar 2014 18:40:53 +0000 (18:40 +0000)]
Coding style fixup; no functionality change

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

10 years agoPrevent lookup of subframework modules by name without parent framework
Ben Langmuir [Thu, 20 Mar 2014 18:27:26 +0000 (18:27 +0000)]
Prevent lookup of subframework modules by name without parent framework

We were 'allowing' the following import
@import Sub;

where Sub is a subframework of Foo and we had a -F path inside
Foo.framework/Frameworks and no module map file for Sub. This would
later hit assertion failures in debug builds.

Now we should correctly diagnose this as a module not found error.

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

10 years ago[analyzer] scan-build: allow quotes around "-cc1" when looking at -### output.
Jordan Rose [Thu, 20 Mar 2014 17:43:54 +0000 (17:43 +0000)]
[analyzer] scan-build: allow quotes around "-cc1" when looking at -### output.

Third time's the charm. Patch by Brennan Shacklett!

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

10 years ago[analyzer] scan-build: match whitespace instead of word boundaries around flags.
Jordan Rose [Thu, 20 Mar 2014 16:37:54 +0000 (16:37 +0000)]
[analyzer] scan-build: match whitespace instead of word boundaries around flags.

Because neither ' ' nor '-' is alphanumeric, \b won't match between them!
Since in this case we know our output is coming from a -### invocation,
we should always have spaces on both sides of the flag we're trying to match,
"-cc1".

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

10 years agoReplacing the exclusive_lock_function, shared_lock_function and unlock_function attri...
Aaron Ballman [Thu, 20 Mar 2014 16:02:49 +0000 (16:02 +0000)]
Replacing the exclusive_lock_function, shared_lock_function and unlock_function attributes with the acquire_capability and release_capability attributes. The old spellings will continue to work, but the underlying semantic attributes have been replaced.

Downgraded the capability diagnostics from error to warning to match the desired behavior, and updated the existing test cases.

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

10 years agoRemove wchar_t* buffer from scanf format fix-it test.
Jordan Rose [Thu, 20 Mar 2014 15:54:16 +0000 (15:54 +0000)]
Remove wchar_t* buffer from scanf format fix-it test.

Amends r204300 to not try to test fixing a wchar_t* to "%ls", which we don't
do correctly anyway. In C mode, wchar_t is just a typedef for a normal
primitive integer type, not a distinct type like it is in C++. To make this
work correctly, we'll need to look for the wchar_t typedef, not just the
builtin type.

Should fix the buildbots.

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

10 years ago[msan] -fsanitize-memory-track-origins=[level] flag and docs.
Evgeniy Stepanov [Thu, 20 Mar 2014 14:58:36 +0000 (14:58 +0000)]
[msan] -fsanitize-memory-track-origins=[level] flag and docs.

This change turns -fsanitize-memory-track-origins into
-fsanitize-memory-track-origins=[level] flag (keeping the old one for
compatibility). Possible levels are 0 (off), 1 (default) and 2 (incredibly
detailed). See docs (part of this patch) for more info.

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

10 years agoSilencing an MSVC warning about not all control paths returning a value. No functiona...
Aaron Ballman [Thu, 20 Mar 2014 14:22:33 +0000 (14:22 +0000)]
Silencing an MSVC warning about not all control paths returning a value. No functional change intended.

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

10 years agoFlust stdout after each vftable dumped to simplify debugging
Timur Iskhodzhanov [Thu, 20 Mar 2014 13:42:14 +0000 (13:42 +0000)]
Flust stdout after each vftable dumped to simplify debugging

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

10 years agoTooling: Move heavyweight vectors around instead of copying.
Benjamin Kramer [Thu, 20 Mar 2014 12:48:36 +0000 (12:48 +0000)]
Tooling: Move heavyweight vectors around instead of copying.

While there convert to range-based for loops. No functionality change.

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

10 years agoMake format-strings-fixit.c aware of "%hu" uint16_t on wchar_t for targeting win32.
NAKAMURA Takumi [Thu, 20 Mar 2014 10:54:53 +0000 (10:54 +0000)]
Make format-strings-fixit.c aware of "%hu" uint16_t on wchar_t for targeting win32.

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

10 years agoKill -faddress-sanitizer, -fthread-sanitizer and -fcatch-undefined-behavior flags.
Alexey Samsonov [Thu, 20 Mar 2014 10:48:29 +0000 (10:48 +0000)]
Kill -faddress-sanitizer, -fthread-sanitizer and -fcatch-undefined-behavior flags.

These flags are deprecated since at least Clang 3.3. Users should instead
use -fsanitize= with appropriate values.

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

10 years ago[-Wunreachable-code] Look through member accesses for 'static const bool' configurati...
Ted Kremenek [Thu, 20 Mar 2014 06:44:35 +0000 (06:44 +0000)]
[-Wunreachable-code] Look through member accesses for 'static const bool' configuration values.

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

10 years ago[-Wunreachable-code] constexpr functions can be used as configuration values.
Ted Kremenek [Thu, 20 Mar 2014 06:07:35 +0000 (06:07 +0000)]
[-Wunreachable-code] constexpr functions can be used as configuration values.

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

10 years ago[-Wunreachable-code] Simplify and broad -Wunreachable-code-return, including nontrivi...
Ted Kremenek [Thu, 20 Mar 2014 06:07:30 +0000 (06:07 +0000)]
[-Wunreachable-code] Simplify and broad -Wunreachable-code-return, including nontrivial returns.

The exception is return statements that include control-flow,
which are clearly doing something "interesting".

99% of the cases I examined for -Wunreachable-code that fired
on return statements were not interesting enough to warrant
being in -Wunreachable-code by default.  Thus the move to
include them in -Wunreachable-code-return.

This simplifies a bunch of logic, including removing the ad hoc
logic to look for std::string literals.

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

10 years ago[libclang] Introduce clang_VirtualFileOverlay_setCaseSensitivity that exposes the...
Argyrios Kyrtzidis [Thu, 20 Mar 2014 04:51:48 +0000 (04:51 +0000)]
[libclang] Introduce clang_VirtualFileOverlay_setCaseSensitivity that exposes the VFS option
to set the case-sensitivity for lookups.

rdar://16374696

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

10 years agoPGO: use linker magic to find instrumentation data on Darwin
Duncan P. N. Exon Smith [Thu, 20 Mar 2014 03:57:11 +0000 (03:57 +0000)]
PGO: use linker magic to find instrumentation data on Darwin

<rdar://problem/15943240>

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

10 years agoscanf format checking: include the buffer length in the fix-it for %s.
Jordan Rose [Thu, 20 Mar 2014 03:32:39 +0000 (03:32 +0000)]
scanf format checking: include the buffer length in the fix-it for %s.

Patch by Zach Davis!

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

10 years agoPGO: Separate out common isMachO logic; no functionality change
Duncan P. N. Exon Smith [Thu, 20 Mar 2014 03:17:15 +0000 (03:17 +0000)]
PGO: Separate out common isMachO logic; no functionality change

<rdar://problem/15943240>

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

10 years agoObjective-C. Make getObjCEncodingForMethodParameter public.
Fariborz Jahanian [Wed, 19 Mar 2014 20:52:13 +0000 (20:52 +0000)]
Objective-C. Make getObjCEncodingForMethodParameter public.

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

10 years agoAdd a new spelling for module map files 'module.modulemap'
Ben Langmuir [Wed, 19 Mar 2014 20:23:34 +0000 (20:23 +0000)]
Add a new spelling for module map files 'module.modulemap'

This name, while more verbose, plays more nicely with tools that use
file extensions to determine file types. The existing spelling
'module.map' will continue to work, but the new spelling will take
precedence.

In frameworks, this new filename will only go in a new 'Modules'
sub-directory.

Similarly, add a module.private.modulemap corresponding to
module_private.map.

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

10 years ago[analyzer] scan-build: when matching flags, make sure the - is the first letter.
Jordan Rose [Wed, 19 Mar 2014 17:42:26 +0000 (17:42 +0000)]
[analyzer] scan-build: when matching flags, make sure the - is the first letter.

PR19191

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

10 years agoComment parsing: fix a crash when dumping comment ast for a function template
Dmitri Gribenko [Wed, 19 Mar 2014 14:03:47 +0000 (14:03 +0000)]
Comment parsing: fix a crash when dumping comment ast for a function template
with variadic parameters

Patch by Joe Ranieri.

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

10 years agoComment parsing: recognize \param ... on function templates with variadic
Dmitri Gribenko [Wed, 19 Mar 2014 13:59:36 +0000 (13:59 +0000)]
Comment parsing: recognize \param ... on function templates with variadic
parameters

Patch by Joe Ranieri.

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

10 years agoUse the expansion location of the file name when finding the module.
Manuel Klimek [Wed, 19 Mar 2014 10:22:36 +0000 (10:22 +0000)]
Use the expansion location of the file name when finding the module.

The spelling location of stringified strings is not a file location.
Optimally, we'll want to solve the problem (as the FIXME states) by
handing in the right FileEntry of the #include location.

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

10 years agoTests for DR450-475.
Richard Smith [Wed, 19 Mar 2014 08:04:12 +0000 (08:04 +0000)]
Tests for DR450-475.

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

10 years agoFix a typo in r204164 that made *all* keywords available in OpenCL mode.
Richard Smith [Tue, 18 Mar 2014 22:43:19 +0000 (22:43 +0000)]
Fix a typo in r204164 that made *all* keywords available in OpenCL mode.

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

10 years agoCodeGen: Include a function hash in instrumentation based profiling
Justin Bogner [Tue, 18 Mar 2014 21:58:06 +0000 (21:58 +0000)]
CodeGen: Include a function hash in instrumentation based profiling

The hash itself is still the number of counters, which isn't all that
useful, but this separates the API changes from the actual
implementation of the hash and will make it easier to transition to
the ProfileData library once it's implemented.

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

10 years agoSimplify and add FIXME. No functionality change.
Richard Smith [Tue, 18 Mar 2014 21:02:14 +0000 (21:02 +0000)]
Simplify and add FIXME. No functionality change.

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

10 years agoIn the presence of modules, we can have multiple implicit instantiations of the same...
Richard Smith [Tue, 18 Mar 2014 20:31:31 +0000 (20:31 +0000)]
In the presence of modules, we can have multiple implicit instantiations of the same template. Teach RecursiveASTVisitor to visit all of those, not just one of them. This is difficult to test by itself, but will be covered by an upcoming change.

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

10 years agoCreating a printing policy for "half":
Yunzhong Gao [Tue, 18 Mar 2014 17:55:18 +0000 (17:55 +0000)]
Creating a printing policy for "half":
Since "half" is an OpenCL keyword and clang accepts __fp16 as an extension for
other languages, error messages and metadata (and hence debug info) should refer
to the half-precision floating point as "__fp16" instead of "half" when
compiling for non-OpenCL languages. This patch creates a new printing policy for
half in a similar manner to what is done for bool and wchar_t.

Differential Revision: http://llvm-reviews.chandlerc.com/D2952

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

10 years agoObjective-C. Better fix for my previous patch
Fariborz Jahanian [Tue, 18 Mar 2014 16:25:22 +0000 (16:25 +0000)]
Objective-C. Better fix for my previous patch
"No need to issue deprecated warning if deprecated method
in class extension is being implemented in primary class implementation
(no overriding is involved).
// rdar://16249335". No functionality change.

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

10 years agoclang-format: Detect function-like macros only when upper case is used.
Alexander Kornienko [Tue, 18 Mar 2014 14:35:20 +0000 (14:35 +0000)]
clang-format: Detect function-like macros only when upper case is used.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D3110

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

10 years agoAdded a __has_feature() for 'is_constructible'
Marshall Clow [Tue, 18 Mar 2014 14:13:10 +0000 (14:13 +0000)]
Added a __has_feature() for 'is_constructible'

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

10 years agomodify declare-use.S to work when full toolchain not present
Matthew Curtis [Tue, 18 Mar 2014 12:25:27 +0000 (12:25 +0000)]
modify declare-use.S to work when full toolchain not present

Test doesn't actually require production of an object file and for
some targets (e.g. hexagon) an assembler is not always available when
lit tests are run.

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

10 years ago[OPENMP] DSA fix
Alexey Bataev [Tue, 18 Mar 2014 12:19:12 +0000 (12:19 +0000)]
[OPENMP] DSA fix

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

10 years agoFix crasher bug.
Manuel Klimek [Tue, 18 Mar 2014 11:22:45 +0000 (11:22 +0000)]
Fix crasher bug.

Due to not resetting the fake rparen data on the token when iterating
over annotated lines, we would pop the last element of the paren stack.

This patch fixes the underlying root cause, and makes the code more
robust against similar problems in the future:
- reset the first token when iterating on the same annotated lines due
  to preprocessor branches
- never pop the last element from the paren stack, so we do not crash,
  but rather incorrectly format
- add assert()s so we can figure out if our assumptions are violated

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

10 years agoclang/test/Driver/sanitizer-ld.c: Tweak to accept dos path.
NAKAMURA Takumi [Tue, 18 Mar 2014 10:47:10 +0000 (10:47 +0000)]
clang/test/Driver/sanitizer-ld.c: Tweak to accept dos path.

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

10 years ago[OPENMP] Simplified data-sharing attributes analysis.
Alexey Bataev [Tue, 18 Mar 2014 10:23:46 +0000 (10:23 +0000)]
[OPENMP] Simplified data-sharing attributes analysis.

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

10 years agoAdd support for sanitizers arguments on FreeBSD
Viktor Kutuzov [Tue, 18 Mar 2014 09:36:50 +0000 (09:36 +0000)]
Add support for sanitizers arguments on FreeBSD

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

10 years agoclang/test/Modules/cxx-templates.cpp: Tweak for dos path.
NAKAMURA Takumi [Tue, 18 Mar 2014 05:58:02 +0000 (05:58 +0000)]
clang/test/Modules/cxx-templates.cpp: Tweak for dos path.

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

10 years agoFix const correctness issue in CXXConstructExpr::getArgs().
Peter Collingbourne [Tue, 18 Mar 2014 04:42:01 +0000 (04:42 +0000)]
Fix const correctness issue in CXXConstructExpr::getArgs().

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

10 years agoMore working around a GCC range-based for scope bug.
Richard Smith [Tue, 18 Mar 2014 02:37:59 +0000 (02:37 +0000)]
More working around a GCC range-based for scope bug.

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

10 years agoDebug info: Update testcases to new DIBuilder behaviour. Variables now
Adrian Prantl [Tue, 18 Mar 2014 02:34:54 +0000 (02:34 +0000)]
Debug info: Update testcases to new DIBuilder behaviour. Variables now
store DIRefs to their types for improved type uniquing.

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

10 years agoAST dumper: if we have multiple implicit instantiations of the same class
Richard Smith [Tue, 18 Mar 2014 02:07:28 +0000 (02:07 +0000)]
AST dumper: if we have multiple implicit instantiations of the same class
template specialization (from different modules), dump them all, so that every
declaration is dumped somewhere.

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

10 years agoPGO: Switch to isOSBinFormatMachO()
Duncan P. N. Exon Smith [Tue, 18 Mar 2014 00:39:26 +0000 (00:39 +0000)]
PGO: Switch to isOSBinFormatMachO()

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

10 years agoFix variable shadowing. Due to a bug in GCC's implementation of range-based for
Richard Smith [Tue, 18 Mar 2014 00:35:12 +0000 (00:35 +0000)]
Fix variable shadowing. Due to a bug in GCC's implementation of range-based for
loops, it was making this an error, resulting in buildbot failures.

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

10 years agoRemove 'REQUIRES: LP64' from these tests and use a more targeted fix.
Richard Smith [Tue, 18 Mar 2014 00:30:09 +0000 (00:30 +0000)]
Remove 'REQUIRES: LP64' from these tests and use a more targeted fix.

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

10 years agoObjective-C. No need to issue deprecated warning if deprecated method
Fariborz Jahanian [Tue, 18 Mar 2014 00:10:37 +0000 (00:10 +0000)]
Objective-C. No need to issue deprecated warning if deprecated method
in class extension is being implemented in primary class implementation
(no overriding is involved).
// rdar://16249335

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

10 years agoFactor out repeated code in dumping template declarations.
Richard Smith [Mon, 17 Mar 2014 23:34:53 +0000 (23:34 +0000)]
Factor out repeated code in dumping template declarations.

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

10 years agoRange-ify and simplify some of the AST dumping code by factoring out the lastChild...
Richard Smith [Mon, 17 Mar 2014 23:00:06 +0000 (23:00 +0000)]
Range-ify and simplify some of the AST dumping code by factoring out the lastChild check.

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

10 years agoDon't fold together the name lookup entries for two declarations if they are
Richard Smith [Mon, 17 Mar 2014 21:46:03 +0000 (21:46 +0000)]
Don't fold together the name lookup entries for two declarations if they are
declared in different namespaces in the same inline namespace set.

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

10 years agoObjective-C. Consider blocks for designated initializer
Fariborz Jahanian [Mon, 17 Mar 2014 21:41:40 +0000 (21:41 +0000)]
Objective-C. Consider blocks for designated initializer
warnings (warning or lack there of) as well since
blocks are another pattern for envoking other
designated initializers. // rdar://16323233

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

10 years agoPGO: Statically generate data structures
Duncan P. N. Exon Smith [Mon, 17 Mar 2014 21:18:30 +0000 (21:18 +0000)]
PGO: Statically generate data structures

In instrumentation-based profiling, we need a set of data structures to
represent the counters.  Previously, these were built up during static
initialization.  Now, they're shoved into a specially-named section so
that they show up as an array.

As a consequence of the reorganizing symbols, instrumentation data
structures for linkonce functions are now correctly coalesced.

This is the first step in a larger project to minimize runtime overhead
and dependencies in instrumentation-based profilng.  The larger picture
includes removing all initialization overhead and making the dependency
on libc optional.

<rdar://problem/15943240>

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

10 years ago[C++11] Replacing CGFunctionInfo arg iterators with iterator_range arguments(). Updat...
Aaron Ballman [Mon, 17 Mar 2014 18:10:01 +0000 (18:10 +0000)]
[C++11] Replacing CGFunctionInfo arg iterators with iterator_range arguments(). Updating all of the usages of the iterators with range-based for loops.

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

10 years agoObjective-C. Do not warn when an instance method and
Fariborz Jahanian [Mon, 17 Mar 2014 17:46:10 +0000 (17:46 +0000)]
Objective-C. Do not warn when an instance method and
class method with the same selctor but different argument
types having one of them in class extension.
// rdar://16312105

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

10 years ago[C++11] Replacing CallArgList writeback iterators with iterator_range writebacks...
Aaron Ballman [Mon, 17 Mar 2014 17:22:27 +0000 (17:22 +0000)]
[C++11] Replacing CallArgList writeback iterators with iterator_range writebacks(). Updating all of the usages of the iterators with range-based for loops, and removing the no-longer-needed iterator versions.

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

10 years ago[C++11] Replacing DeclContext iterators using_directives_begin() and using_directives...
Aaron Ballman [Mon, 17 Mar 2014 17:14:12 +0000 (17:14 +0000)]
[C++11] Replacing DeclContext iterators using_directives_begin() and using_directives_end() with iterator_range using_directives(). Updating all of the usages of the iterators with range-based for loops, and removing the no-longer-needed iterator versions. Also used as an opportunity to normalize the name from getUsingDirectives() to using_directives().

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

10 years ago[C++11] Replacing Scope iterators using_directives_begin() and using_directives_end...
Aaron Ballman [Mon, 17 Mar 2014 17:03:37 +0000 (17:03 +0000)]
[C++11] Replacing Scope iterators using_directives_begin() and using_directives_end() with iterator_range using_directives(). Updating all of the usages of the iterators with range-based for loops, and removing the no-longer-needed iterator versions.

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

10 years ago[C++11] Replacing Scope iterators decl_begin() and decl_end() with iterator_range...
Aaron Ballman [Mon, 17 Mar 2014 16:55:25 +0000 (16:55 +0000)]
[C++11] Replacing Scope iterators decl_begin() and decl_end() with iterator_range decls(). Updating all of the usages of the iterators with range-based for loops, and removing the no-longer-needed iterator versions.

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

10 years agoRemove unused variable from test.
Richard Smith [Mon, 17 Mar 2014 16:53:13 +0000 (16:53 +0000)]
Remove unused variable from test.

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

10 years ago[C++11] Replacing ObjCObjectPointerType iterators qual_begin() and qual_end() with...
Aaron Ballman [Mon, 17 Mar 2014 16:14:00 +0000 (16:14 +0000)]
[C++11] Replacing ObjCObjectPointerType iterators qual_begin() and qual_end() with iterator_range quals(). Updating all of the usages of the iterators with range-based for loops.

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

10 years ago[C++11] Replacing ObjCObjectType iterators qual_begin() and qual_end() with iterator_...
Aaron Ballman [Mon, 17 Mar 2014 15:55:30 +0000 (15:55 +0000)]
[C++11] Replacing ObjCObjectType iterators qual_begin() and qual_end() with iterator_range quals(). Updating all of the usages of the iterators with range-based for loops.

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

10 years ago[C++11] Replacing FunctionProtoType iterators exception_begin() and exception_end...
Aaron Ballman [Mon, 17 Mar 2014 15:38:09 +0000 (15:38 +0000)]
[C++11] Replacing FunctionProtoType iterators exception_begin() and exception_end() with iterator_range exceptions(). Updating all of the usages of the iterators with range-based for loops.

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

10 years ago[C++11] Replacing FunctionProtoType iterators param_type_begin() and param_type_end...
Aaron Ballman [Mon, 17 Mar 2014 15:23:01 +0000 (15:23 +0000)]
[C++11] Replacing FunctionProtoType iterators param_type_begin() and param_type_end() with iterator_range param_types(). Updating all of the usages of the iterators with range-based for loops.

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

10 years agoclang-format: Indent from dict literal labels.
Daniel Jasper [Mon, 17 Mar 2014 14:32:47 +0000 (14:32 +0000)]
clang-format: Indent from dict literal labels.

Before:
  @{
    NSFontAttributeNameeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee :
    regularFont,
  };

After:
  @{
    NSFontAttributeNameeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee :
        regularFont,
  };

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

10 years ago[C++11] Replacing CompoundStmt iterators body_begin() and body_end() with iterator_ra...
Aaron Ballman [Mon, 17 Mar 2014 14:19:37 +0000 (14:19 +0000)]
[C++11] Replacing CompoundStmt iterators body_begin() and body_end() with iterator_range body(). Updating all of the usages of the iterators with range-based for loops.

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

10 years agoclang/test/CXX/drs: Add "REQUIRES:LP64" to a couple of tests in r204033. [PR8833]
NAKAMURA Takumi [Mon, 17 Mar 2014 11:55:46 +0000 (11:55 +0000)]
clang/test/CXX/drs: Add "REQUIRES:LP64" to a couple of tests in r204033. [PR8833]

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

10 years agoTests for DR400-450.
Richard Smith [Mon, 17 Mar 2014 08:20:10 +0000 (08:20 +0000)]
Tests for DR400-450.

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

10 years agoPR19152: If a variable template's type involves 'auto', instantiate the
Richard Smith [Sun, 16 Mar 2014 01:00:40 +0000 (01:00 +0000)]
PR19152: If a variable template's type involves 'auto', instantiate the
initializer with the variable in order to determine the type.

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

10 years agoMake some assertions on constant expressions static.
Benjamin Kramer [Sat, 15 Mar 2014 18:54:13 +0000 (18:54 +0000)]
Make some assertions on constant expressions static.

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

10 years agoThe year is 2014. MSVC is still unable to synthesize move ctors.
Benjamin Kramer [Sat, 15 Mar 2014 17:35:02 +0000 (17:35 +0000)]
The year is 2014. MSVC is still unable to synthesize move ctors.

Work around with a ton of boilerplate.

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

10 years agoPreprocessor: Clarify the ownership of the IncludeMacroStack with unique_ptr.
Benjamin Kramer [Sat, 15 Mar 2014 16:40:40 +0000 (16:40 +0000)]
Preprocessor: Clarify the ownership of the IncludeMacroStack with unique_ptr.

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

10 years agoSerialization: Directly compare objects instead of using a functor duplicating the...
Benjamin Kramer [Sat, 15 Mar 2014 14:21:58 +0000 (14:21 +0000)]
Serialization: Directly compare objects instead of using a functor duplicating the compare operators.

No functionality change.

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

10 years agoFix PR18806: Canonicalize the replacement type when deserializing a SubstTemplateType...
Stephan Tolksdorf [Sat, 15 Mar 2014 10:23:27 +0000 (10:23 +0000)]
Fix PR18806: Canonicalize the replacement type when deserializing a SubstTemplateTypeParmType

What's going on in the test case (without the patch applied) is this:

When the header is parsed, decltype(B()) is canonicalized to decltype(Y()),
because that was the first parsed equivalent decltype expression. Hence, the
TemplateSpecializationType for Id<decltype(B())> ends up with
SubstTemplateTypeParmType(T, decltype(Y())) as the AliasedType member.

When the PCH file is included and the AST reader reads Id<decltype(B())>, it
sees decltype(B()) before decltype(Y()). So, this time decltype(B()) ends up
being the canonical type for both decltypes, which leads to an assert violation
when the reader calls getSubstTemplateTypeParmType with the non-canonical
decltype(Y()) as the replacement type.

Reviewers: rsmith

Reviewed By: rsmith

CC: cfe-commits, aemerson
Differential Revision: http://llvm-reviews.chandlerc.com/D3073

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

10 years agoRemove dead functions from unreachable code analysis.
Benjamin Kramer [Sat, 15 Mar 2014 10:20:49 +0000 (10:20 +0000)]
Remove dead functions from unreachable code analysis.

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

10 years ago[C++11] Add 'override' keyword to virtual methods that override their base class.
Craig Topper [Sat, 15 Mar 2014 07:47:46 +0000 (07:47 +0000)]
[C++11] Add 'override' keyword to virtual methods that override their base class.

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

10 years ago-Wunreachable-code: treat 'const bool' locals as control values.
Ted Kremenek [Sat, 15 Mar 2014 06:47:45 +0000 (06:47 +0000)]
-Wunreachable-code: treat 'const bool' locals as control values.

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

10 years agoFurther refine -Wunreachable-code groups so that -Wno-unreachable-code-break doesn...
Ted Kremenek [Sat, 15 Mar 2014 05:47:06 +0000 (05:47 +0000)]
Further refine -Wunreachable-code groups so that -Wno-unreachable-code-break doesn't turn off all unreachable code warnings.

Also relax unreachable 'break' and 'return' to not check for being
preceded by a call to 'noreturn'.  That turns out to not be so
interesting in practice.

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

10 years ago[C++11] Add 'override' keyword to virtual methods that override their base class.
Craig Topper [Sat, 15 Mar 2014 04:29:04 +0000 (04:29 +0000)]
[C++11] Add 'override' keyword to virtual methods that override their base class.

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

10 years agoStart breaking -Wunreachable-code up into different diagnostic groups.
Ted Kremenek [Sat, 15 Mar 2014 01:26:32 +0000 (01:26 +0000)]
Start breaking -Wunreachable-code up into different diagnostic groups.

Recent work on -Wunreachable-code has focused on suppressing uninteresting
unreachable code that center around "configuration values", but
there are still some set of cases that are sometimes interesting
or uninteresting depending on the codebase.  For example, a dead
"break" statement may not be interesting for a particular codebase,
potentially because it is auto-generated or simply because code
is written defensively.

To address these workflow differences, -Wunreachable-code is now
broken into several diagnostic groups:

-Wunreachable-code: intended to be a reasonable "default" for
most users.

and then other groups that turn on more aggressive checking:

-Wunreachable-code-break: warn about dead break statements

-Wunreachable-code-trivial-return: warn about dead return statements
that return "trivial" values (e.g., return 0).  Other return
statements that return non-trivial values are still reported
under -Wunreachable-code (this is an area subject to more refinement).

-Wunreachable-code-aggressive: supergroup that enables all these
groups.

The goal is to eventually make -Wunreachable-code good enough to
either be in -Wall or on-by-default, thus finessing these warnings
into different groups helps achieve maximum signal for more users.

TODO: the tests need to be updated to reflect this extra control
via diagnostic flags.

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

10 years agoASTTests//EvaluateAsRValueTest.cpp: Appease *-win32 target to add -fno-delayed-templa...
NAKAMURA Takumi [Sat, 15 Mar 2014 00:36:51 +0000 (00:36 +0000)]
ASTTests//EvaluateAsRValueTest.cpp: Appease *-win32 target to add -fno-delayed-template-parsing.

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

10 years agoImplement the MS extension __identifier properly: take a token and strip it of
Richard Smith [Sat, 15 Mar 2014 00:06:08 +0000 (00:06 +0000)]
Implement the MS extension __identifier properly: take a token and strip it of
its keywordliness.

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

10 years agoObjective-C. Redo turning off designated initialization warnings on
Fariborz Jahanian [Fri, 14 Mar 2014 23:30:18 +0000 (23:30 +0000)]
Objective-C. Redo turning off designated initialization warnings on
'init' methods which are unavailable. Subclasses of NSObject
have to implement such methods as a common pattern to prevent
user's own implementation. // rdar://16305460

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