Commit Graph

54298 Commits

Author SHA1 Message Date
Jordan Rose 50de57df6d [test] Turn off warnings for test/Analysis/identical-expressions.cpp.
Also, make it slightly clearer what's being tested by only differentiating integer
literals based on their suffix, rather than using a very large constant.

llvm-svn: 216133
2014-08-20 22:40:57 +00:00
Alex Lorenz e3b04a9f3b Test: CoverageMapping: use "RUN: FileCheck" command instead of "RUN: cat | Filecheck".
Change the lit RUN commands for 3 tests to use the following pattern
"FileCheck -input-file ..." instead of "cat ... | FileCheck ..." as
suggested by Justin Bogner.

llvm-svn: 216085
2014-08-20 17:29:47 +00:00
Alex Lorenz fdd769e847 Coverage mapping: fix mapping for objective-c for statement
llvm-svn: 216082
2014-08-20 17:11:53 +00:00
Alex Lorenz 01a0d062aa Coverage mapping: fix mapping for objective-c message expression
llvm-svn: 216081
2014-08-20 17:10:56 +00:00
Jordan Rose ba129af62a [analyzer] UnixAPI: Check that the third argument to open(2) (if present) is an integer.
Patch by Daniel Fahlgren.

llvm-svn: 216079
2014-08-20 16:58:09 +00:00
Jordan Rose cd4db5c6d2 [analyzer] UnixAPI: Check when open(2) is called with more than three arguments.
Patch by Daniel Fahlgren.

llvm-svn: 216078
2014-08-20 16:58:03 +00:00
Jordan Rose f3544e913d [analyzer] IdenticalExpr: don't try to compare integer literals with different widths.
PR20659. Patch by Anders Rönnholm.

llvm-svn: 216076
2014-08-20 16:51:26 +00:00
Jordan Rose b6100301e8 [analyzer] IdenticalExpr: use getBytes rather than getString to compare string literals.
PR20693. Patch by Anders Rönnholm.

llvm-svn: 216075
2014-08-20 16:51:18 +00:00
Fariborz Jahanian 19c2e2fab2 Objective-C [qoi]. Provide fix-it hint when sending
class method to an object receiver. rdar://16263395

llvm-svn: 216038
2014-08-19 23:39:17 +00:00
Brad Smith f436e9efbe Handle SPARC float command line parameters for SPARCv9.
llvm-svn: 216029
2014-08-19 21:50:15 +00:00
Alex Lorenz b5f3a844a7 Test: Coverage Mapping: add missing RUN commands
Add the llvm-lit RUN commands for the two coverage mapping tests
that filecheck a temporary file.

llvm-svn: 216020
2014-08-19 20:51:54 +00:00
Alex Lorenz 34ac9b5e25 Add tests for coverage mapping generation.
This patch adds the tests for the coverage mapping generation. 
Most of the tests check the mapping regions produced by 
the generator, and one checks the llvm IR.

Differential Revision: http://reviews.llvm.org/D4847

llvm-svn: 215995
2014-08-19 17:32:30 +00:00
Fariborz Jahanian 91b2fa2a9a ext_vector IRGen. Patch to allow indexing into
ext_vector_type's 'hi/lo' components when
used as lvalue. rdar://18031917 pr20697

llvm-svn: 215991
2014-08-19 17:17:40 +00:00
Aaron Ballman dd69ef38db C++1y is now C++14!
Changes diagnostic options, language standard options, diagnostic identifiers, diagnostic wording to use c++14 instead of c++1y. It also modifies related test cases to use the updated diagnostic wording.

llvm-svn: 215982
2014-08-19 15:55:55 +00:00
Rafael Espindola e8337304f3 Move the body out of line to try to fix a buildbot.
llvm-svn: 215980
2014-08-19 14:36:35 +00:00
Rafael Espindola aca3be852a Go back to having a takeModule instead of a getModule.
Returning a std::unique_ptr is more constrained. Thanks to David Blaikie for the
suggestion.

llvm-svn: 215979
2014-08-19 14:32:16 +00:00
Alexander Musman 3aaab669c8 [OPENMP] Extract common superclass from all the loop directives. No functional changes (having common superclass is convenient for future loop directives CodeGen implementation)
llvm-svn: 215975
2014-08-19 11:27:13 +00:00
David Majnemer 9a3bc59407 MS ABI: Update alias template mangling for VC "14" CTP 3
MSVC "14" CTP 3 has fixed it's mangling for alias templates when used as
template-template arguments; update clang to be compatible with this
mangling.

llvm-svn: 215972
2014-08-19 07:29:03 +00:00
Rafael Espindola a296664479 Update for llvm api change.
llvm-svn: 215968
2014-08-19 04:04:30 +00:00
Nico Weber f69cba649e Add a warning flag for an existing diagnostic.
One more, and the number of flags without a dedicated flag fits in two decimal
digits :-)

llvm-svn: 215946
2014-08-18 23:02:03 +00:00
Alexey Samsonov c4f1fc2af1 Update link strategy for sanitizer runtime libraries on Linux:
1. Always put static sanitizer runtimes to the front of the linker
invocation line. This was already done for all sanitizers except UBSan:
in case user provides static libstdc++ we need to make sure that new/delete
operator definitions are picked from sanitizer runtimes instead of libstdc++.
We have to put UBSan runtime first for similar reasons: it depends on some
libstdc++ parts (e.g. __dynamic_cast function), and has to go first in
link line to ensure these functions will be picked up from libstdc++.

2. Put sanitizer libraries system dependencies (-ldl, -lpthread etc.) right
after sanitizer runtimes. This will ensure these libraries participate in
the link even if user provided -Wl,-as-needed flag. This should fix PR15823.

3. In case we link in several sanitizer runtimes (e.g. "ubsan", "ubsan_cxx"
and "san"), add system dependencies (-ldl, -lpthread, ...) only once.

llvm-svn: 215940
2014-08-18 22:10:42 +00:00
Ben Langmuir e13fd1c430 Fix the rececl chain for redeclarations of predefined decls
Predefined decls like 'Protocol' in objc are not loaded from AST files,
so we cannot rely on loading the canonical decl to complete the redecl
chain for redeclarations of these decls.  The broken redecl chain was
non-circular, so looping over redecls() would hang.

llvm-svn: 215929
2014-08-18 19:32:45 +00:00
Rafael Espindola 5cd06f26ae Store std::unique_ptr in InMemoryBuffers. NFC.
llvm-svn: 215928
2014-08-18 19:16:31 +00:00
Rafael Espindola 2346a37599 return a std::unique_ptr from getMainBufferWithPrecompiledPreamble. NFC.
llvm-svn: 215927
2014-08-18 18:47:08 +00:00
Rafael Espindola e0f6d88678 Use std::unique_ptr to simplify this code a bit.
llvm-svn: 215926
2014-08-18 18:33:41 +00:00
Rafael Espindola b694a0d5c5 Inline function into only use.
llvm-svn: 215925
2014-08-18 18:17:32 +00:00
Rafael Espindola 32482080fe Simplify ASTUnit::Parse a bit by passing a std::unique_ptr to it.
llvm-svn: 215900
2014-08-18 16:23:45 +00:00
Pavel Chupin 4a29468dcd [x32] Handle -m64/-m32 switches by Driver in x32 mode
Summary:
Adding remaining 2 cases handling:
* from x32 to 32 via -m32
* from x32 to 64 via -m64

Test Plan: linux-ld test updated

Reviewers: chandlerc, atanasyan

Subscribers: cfe-commits, zinovy.nis

Differential Revision: http://reviews.llvm.org/D4930

llvm-svn: 215899
2014-08-18 15:38:38 +00:00
Sylvestre Ledru b248256089 Fix a memory leak in one of the test unit. Silent coverity warning CID 1095912
llvm-svn: 215898
2014-08-18 15:18:56 +00:00
Sylvestre Ledru 75c2914114 Add the break in the switch case (even if there is llvm_unreachable. It will silent coverity warning CID 1231654
llvm-svn: 215897
2014-08-18 15:13:44 +00:00
Sylvestre Ledru 0ae4074599 Update the call to llvm::sys::fs::UniqueID to match the definition: UniqueID(uint64_t Device, uint64_t File)
Fixes CID 1095247

llvm-svn: 215896
2014-08-18 15:00:11 +00:00
Craig Topper 4dd9b43c8d Repace SmallPtrSet with SmallPtrSetImpl in function arguments to avoid needing to mention the size.
llvm-svn: 215869
2014-08-17 23:49:53 +00:00
Rafael Espindola 8d04452973 Use the pointer-like API of ErrorOr.
Thanks to David Blaikie for the suggestion.

llvm-svn: 215866
2014-08-17 23:31:27 +00:00
Rafael Espindola 91ac8dfa9d Create a std::unique_ptr earlier.
Thanks to David Blaikie for the suggestion.

llvm-svn: 215865
2014-08-17 23:27:13 +00:00
Rafael Espindola 1a1b1562e6 Use std::unique_ptr in a few methods that take ownership.
llvm-svn: 215864
2014-08-17 23:12:27 +00:00
Rafael Espindola b3402685f6 Update for llvm api changes.
llvm-svn: 215856
2014-08-17 22:20:41 +00:00
Rafael Espindola 04ab21d75d Convert a few ownership comments with std::unique_ptr.
llvm-svn: 215853
2014-08-17 22:12:58 +00:00
Manuel Klimek f560b22a92 Do not rely on bin/ path prefix in tests.
llvm-svn: 215845
2014-08-17 19:11:18 +00:00
Rafael Espindola 69d2ad031b Add a test for -no-canonical-prefixes.
llvm-svn: 215836
2014-08-17 16:22:16 +00:00
Olivier Goffart fc8f893192 Fix assertion on asm register that are "%"
Name might be empty again after we removed the '%' prefix
and Name[0] would assert.

Found on code like
register int foo asm("%" MACRO);
where MACRO was supposed to be defined in a header file that was not found.

llvm-svn: 215834
2014-08-17 13:19:48 +00:00
Abramo Bagnara 152eb39cc6 Uniformed parsing of GNU attributes at line beginnning and added GNU attributes parsing FIXMEs.
llvm-svn: 215814
2014-08-16 08:29:27 +00:00
Ben Langmuir fe971d9894 When loading a module with no local entities, still bump the size of the
tables that correspond to ContinuousRangeMaps, since the keys to those
maps need to be unique, or we may map to the wrong offset.

This fixes a crash + malformed AST file seen when loading some modules
that import Cocoa on Darwin, which is a module with no contents except
imports of other modules. Unfortunately I have not been able to find a
reduced test case that reproduces this problem.

Also add an assert that we aren't mapping one key to multiple values
in CRM.  We ought to be able to say there are no duplicate keys at all,
but there are a bunch of 0 -> 0 mappings that are showing up, probably
coming from the source location table.

llvm-svn: 215810
2014-08-16 04:54:18 +00:00
Nick Lewycky 12be8efc62 Clarify.
llvm-svn: 215808
2014-08-16 02:14:37 +00:00
Nick Lewycky 367cbddfc2 Try indenting to put all the text inside the block.
llvm-svn: 215807
2014-08-16 02:11:54 +00:00
Nick Lewycky e9a774022a Document what's experimental about __attribute__((enable_if)). PR20392
llvm-svn: 215806
2014-08-16 02:09:42 +00:00
Argyrios Kyrtzidis ac3997eb52 [libclang] Introduce clang_File_isEqual for comparing CXFile handles.
llvm-svn: 215796
2014-08-16 00:26:19 +00:00
Sean Silva bcd500e09a Revert "Update for LLVM change (StringSaver)"
This reverts commit r215785 / 170ebf4f19459ae51a9561d0e65c87ee4c9b2c97.

LLD has some StringSavers that need to be updated. One of which takes a
lock and I need to investigate that more closely.

llvm-svn: 215791
2014-08-15 23:39:12 +00:00
Nico Weber ae4bb8c8f4 Make sure that vtables referenced from delay-parsed templates get referenced.
This fixes PR20671, see the bug for details. In short, ActOnTranslationUnit()
calls DefineUsedVTables() and only then PerformPendingInstantiations(). But
PerformPendingInstantiations() is what does delayed template parsing, so
vtables only references from late-parsed templates weren't marked used.

As a fix, move the SavePendingInstantiationsAndVTableUsesRAII in
PerformPendingInstantiations() up above the delayed template parsing code.
That way, vtables referenced from templates end up in the RAII object, and the
call to DefineUsedVTables() in PerformPendingInstantiations() marks them used.

llvm-svn: 215786
2014-08-15 23:21:41 +00:00
Sean Silva 43bd97c77b Update for LLVM change (StringSaver)
There is more cleanup to be done here. Once
llvm::sys::Process::GetArgumentVector is switched over to StringSaver,
we can simplify this code a fair amount.

llvm-svn: 215785
2014-08-15 23:18:49 +00:00
Nico Weber ccec9d8cee Add a RAII class for saving and restoring instantiations and uses. No behavior change.
llvm-svn: 215780
2014-08-15 22:29:14 +00:00