Commit Graph

51472 Commits

Author SHA1 Message Date
Richard Smith 6ef4293678 Refactor and simplify DeclUpdates serialization.
llvm-svn: 204397
2014-03-20 21:02:00 +00:00
DeLesley Hutchins d7fa5bd431 Consumed Analysis: IgnoreParens bugfix.
llvm-svn: 204395
2014-03-20 20:39:20 +00:00
Timur Iskhodzhanov ba5570221d Fix PR19172 - wrong this adjustment calculated for virtual destructor in a class with complex inheritance
Reviewed at http://llvm-reviews.chandlerc.com/D3128

llvm-svn: 204394
2014-03-20 20:38:34 +00:00
Richard Smith 59442b4f3a Refactor to move decl update emission into the decl emission loop.
llvm-svn: 204392
2014-03-20 20:07:19 +00:00
Duncan P. N. Exon Smith a7807637bf 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>

llvm-svn: 204390
2014-03-20 20:00:41 +00:00
Richard Smith b9eab6d1c8 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).

llvm-svn: 204385
2014-03-20 19:44:17 +00:00
Duncan P. N. Exon Smith 5188e91cd4 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>

llvm-svn: 204379
2014-03-20 19:23:46 +00:00
Ted Kremenek d4576318b4 [-Wunreachable-code] Tweak isTrivialDoWhile() to handle implicit casts.
llvm-svn: 204376
2014-03-20 18:47:53 +00:00
Ted Kremenek 3d84c96dd3 Remove dead assignment dominated by a call to llvm_unreachable().
llvm-svn: 204375
2014-03-20 18:47:50 +00:00
Ted Kremenek 03a3d74ff2 [analyzer] Fix a bad bug in reversePropagateInterstingSymbols() where only one subexpression of BinaryOperator would be explored.
llvm-svn: 204374
2014-03-20 18:47:47 +00:00
Duncan P. N. Exon Smith a5f804a7ea Use nullptr; no functionality change
llvm-svn: 204372
2014-03-20 18:40:55 +00:00
Duncan P. N. Exon Smith 3095e4d3bf Coding style fixup; no functionality change
llvm-svn: 204371
2014-03-20 18:40:53 +00:00
Ben Langmuir c3ea5654f9 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.

llvm-svn: 204368
2014-03-20 18:27:26 +00:00
Jordan Rose 0d7d09f804 [analyzer] scan-build: allow quotes around "-cc1" when looking at -### output.
Third time's the charm. Patch by Brennan Shacklett!

llvm-svn: 204362
2014-03-20 17:43:54 +00:00
Jordan Rose 428f2e980a [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".

llvm-svn: 204356
2014-03-20 16:37:54 +00:00
Aaron Ballman 18d85aed39 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.

llvm-svn: 204350
2014-03-20 16:02:49 +00:00
Jordan Rose 202113ff5b 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.

llvm-svn: 204349
2014-03-20 15:54:16 +00:00
Evgeniy Stepanov 2bfcaabdec [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.

llvm-svn: 204346
2014-03-20 14:58:36 +00:00
Aaron Ballman d8de5b6868 Silencing an MSVC warning about not all control paths returning a value. No functional change intended.
llvm-svn: 204345
2014-03-20 14:22:33 +00:00
Timur Iskhodzhanov 4fea4f917d Flust stdout after each vftable dumped to simplify debugging
llvm-svn: 204341
2014-03-20 13:42:14 +00:00
Benjamin Kramer efb1eb981b Tooling: Move heavyweight vectors around instead of copying.
While there convert to range-based for loops. No functionality change.

llvm-svn: 204338
2014-03-20 12:48:36 +00:00
NAKAMURA Takumi d49823667d Make format-strings-fixit.c aware of "%hu" uint16_t on wchar_t for targeting win32.
llvm-svn: 204334
2014-03-20 10:54:53 +00:00
Alexey Samsonov cb3f812b6b 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.

llvm-svn: 204330
2014-03-20 10:48:29 +00:00
Ted Kremenek f5ae0bc671 [-Wunreachable-code] Look through member accesses for 'static const bool' configuration values.
llvm-svn: 204315
2014-03-20 06:44:35 +00:00
Ted Kremenek 2766ad27e8 [-Wunreachable-code] constexpr functions can be used as configuration values.
llvm-svn: 204308
2014-03-20 06:07:35 +00:00
Ted Kremenek f3c93bb61b [-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.

llvm-svn: 204307
2014-03-20 06:07:30 +00:00
Argyrios Kyrtzidis a9ab4d46bb [libclang] Introduce clang_VirtualFileOverlay_setCaseSensitivity that exposes the VFS option
to set the case-sensitivity for lookups.

rdar://16374696

llvm-svn: 204303
2014-03-20 04:51:48 +00:00
Duncan P. N. Exon Smith 780443e83b PGO: use linker magic to find instrumentation data on Darwin
<rdar://problem/15943240>

llvm-svn: 204301
2014-03-20 03:57:11 +00:00
Jordan Rose 177b0a3600 scanf format checking: include the buffer length in the fix-it for %s.
Patch by Zach Davis!

llvm-svn: 204300
2014-03-20 03:32:39 +00:00
Duncan P. N. Exon Smith 7134d47d0d PGO: Separate out common isMachO logic; no functionality change
<rdar://problem/15943240>

llvm-svn: 204297
2014-03-20 03:17:15 +00:00
Fariborz Jahanian eff3a8be93 Objective-C. Make getObjCEncodingForMethodParameter public.
llvm-svn: 204264
2014-03-19 20:52:13 +00:00
Ben Langmuir 984e1df77a 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.

llvm-svn: 204261
2014-03-19 20:23:34 +00:00
Jordan Rose 69ab726724 [analyzer] scan-build: when matching flags, make sure the - is the first letter.
PR19191

llvm-svn: 204253
2014-03-19 17:42:26 +00:00
Dmitri Gribenko dbff5c71fa Comment parsing: fix a crash when dumping comment ast for a function template
with variadic parameters

Patch by Joe Ranieri.

llvm-svn: 204236
2014-03-19 14:03:47 +00:00
Dmitri Gribenko d9eb05aca3 Comment parsing: recognize \param ... on function templates with variadic
parameters

Patch by Joe Ranieri.

llvm-svn: 204235
2014-03-19 13:59:36 +00:00
Manuel Klimek 98a9a6c667 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.

llvm-svn: 204220
2014-03-19 10:22:36 +00:00
Richard Smith 17710217fa Tests for DR450-475.
llvm-svn: 204217
2014-03-19 08:04:12 +00:00
Richard Smith 997ff02c7b Fix a typo in r204164 that made *all* keywords available in OpenCL mode.
llvm-svn: 204196
2014-03-18 22:43:19 +00:00
Justin Bogner b4416f58d5 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.

llvm-svn: 204186
2014-03-18 21:58:06 +00:00
Richard Smith c42c219d57 Simplify and add FIXME. No functionality change.
llvm-svn: 204181
2014-03-18 21:02:14 +00:00
Richard Smith 1b42d1c7ac 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.
llvm-svn: 204175
2014-03-18 20:31:31 +00:00
Yunzhong Gao fcdc45ff2d 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

llvm-svn: 204164
2014-03-18 17:55:18 +00:00
Fariborz Jahanian ed39e7cfeb 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.

llvm-svn: 204159
2014-03-18 16:25:22 +00:00
Alexander Kornienko ce08126733 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

llvm-svn: 204156
2014-03-18 14:35:20 +00:00
Marshall Clow d28acc0d98 Added a __has_feature() for 'is_constructible'
llvm-svn: 204153
2014-03-18 14:13:10 +00:00
Matthew Curtis 68f426ef15 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.

llvm-svn: 204144
2014-03-18 12:25:27 +00:00
Alexey Bataev 750a58bcd9 [OPENMP] DSA fix
llvm-svn: 204143
2014-03-18 12:19:12 +00:00
Manuel Klimek 819788da83 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

llvm-svn: 204140
2014-03-18 11:22:45 +00:00
NAKAMURA Takumi a65db1e9ee clang/test/Driver/sanitizer-ld.c: Tweak to accept dos path.
llvm-svn: 204138
2014-03-18 10:47:10 +00:00
Alexey Bataev a590b08308 [OPENMP] Simplified data-sharing attributes analysis.
llvm-svn: 204135
2014-03-18 10:23:46 +00:00