summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Simplify a few loops over CallArgList/FunctionArgList. NFCAlexey Samsonov2014-08-133-21/+13
| | | | llvm-svn: 215571
* AArch64: Prefetch intrinsicYi Kong2014-08-132-0/+30
| | | | llvm-svn: 215569
* ARM: Prefetch intrinsicsYi Kong2014-08-132-0/+17
| | | | llvm-svn: 215568
* Revert what looks like an unintended change in r215557.Rafael Espindola2014-08-131-1/+1
| | | | | | Should fix test ulibc driver tests. llvm-svn: 215561
* Small cleanup: Don't duplicate default behavior.Rafael Espindola2014-08-131-2/+2
| | | | | | | | std::unique_ptr is null initialized and reset default to null. Thanks to David Blaikie for noticing. llvm-svn: 215560
* Use std::unique_ptr to simplify memory management a bit.Rafael Espindola2014-08-131-12/+6
| | | | llvm-svn: 215559
* Header guard canonicalization, clang part.Benjamin Kramer2014-08-1353-116/+116
| | | | | | Modifications made by clang-tidy with minor tweaks. llvm-svn: 215557
* Work around missing handling of temporaries bound to default arguments.Manuel Klimek2014-08-131-6/+15
| | | | | | | | | | | Yet more problems due to the missing CXXBindTemporaryExpr in the CFG for default arguments. Unfortunately we cannot just switch off inserting temporaries for the corresponding default arguments, as that breaks existing tests (test/SemaCXX/return-noreturn.cpp:245). llvm-svn: 215554
* [Driver] Support -muclibc / -mglibc command line options for a coupleSimon Atanasyan2014-08-133-4/+31
| | | | | | | | | | | | | of MIPS toolchains. The uCLibc implemented for multiple architectures. A couple of MIPS toolchains contains both uCLibc and glibc implementation so these options allow to select used C library. Initially -muclibc / -mglibc (as well as -mbionic) have been implemented in gcc for various architectures so they are not MIPS specific. llvm-svn: 215552
* For NetBSD, use the same settings for PPC64 as for PPC when it comes toJoerg Sonnenberger2014-08-133-2/+24
| | | | | | | integrated assembler, libc++ and libgcc. Set emulation for ld for both platforms for correct -m32 handling. llvm-svn: 215551
* Fix crasher bug in clang-format.Manuel Klimek2014-08-131-1/+4
| | | | llvm-svn: 215549
* Default getFile() to use the last accessed name in the FileEntry.Manuel Klimek2014-08-131-0/+7
| | | | | | | | | | | | With modules we start accessing headers for the first time while reading the module map, which often has very different paths from the include scanning logic. Using the name by which the file was accessed gets us one step closer to the right solution, which is using a FileName abstraction that decouples the name by which a file was accessed from the FileEntry. llvm-svn: 215541
* Emit diagnostic for -munaligned-access on v6m targetsOliver Stannard2014-08-131-1/+5
| | | | | | | | | | Rather than silently disabling unaligned accesses for v6m targets as in the previous patch to llvm, instead produce a warning saying that this architecture doesn't support unaligned accesses. Patch by Ben Foster llvm-svn: 215531
* clang-format: Format long lists in columns if without bin-packing.Daniel Jasper2014-08-131-3/+5
| | | | | | | | | | | | | | | | After (even with BinPacking = false): const Aaaaaa aaaaa = { aaaaa, bbbbb, ccccc, ddddd, eeeee, ffffff, ggggg, hhhhhh, iiiiii, jjjjjj, kkkkkk, aaaaa, bbbbb, ccccc, ddddd, eeeee, ffffff, ggggg, hhhhhh, iiiiii, jjjjjj, kkkkkk, }; Before: <each element on its own line> This fixes http://llvm.org/PR20623. llvm-svn: 215529
* clang-format: Understand #defines defining system includes.Daniel Jasper2014-08-131-2/+12
| | | | | | | | | | Before: #define MY_IMPORT < a / b > After: #define MY_IMPORT <a/b> llvm-svn: 215527
* PR20634: add some more cases that can legitimately come after a struct ↵Richard Smith2014-08-131-4/+7
| | | | | | declaration to our list of special cases. llvm-svn: 215520
* [modules] When performing a lookup into a namespace, ensure that any laterRichard Smith2014-08-135-24/+44
| | | | | | | | | | redefinitions of that namespace have already been loaded. When writing out the names in a namespace, if we see a name that is locally declared and had imported declarations merged on top of it, export the local declaration as the lookup result, because it will be the most recent declaration of that entity in the redeclaration chain of an importer of the module. llvm-svn: 215518
* [AVX512] Add intrinsics for FP scalar broadcastsAdam Nemet2014-08-131-0/+18
| | | | | | | | | | Similar approach to the set1 intrinsics is used: implement in terms of vector initializers and then ensure with an LLVM test that a broadcast is generated at the end. Part of <rdar://problem/17688758> llvm-svn: 215486
* [UBSan] Add returns-nonnull sanitizer.Alexey Samsonov2014-08-131-1/+18
| | | | | | | | | | | | | | | | | | | | Summary: This patch adds a runtime check verifying that functions annotated with "returns_nonnull" attribute do in fact return nonnull pointers. It is based on suggestion by Jakub Jelinek: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140623/223693.html. Test Plan: regression test suite Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4849 llvm-svn: 215485
* Objective-C [qoi]. Patch to not do Fix-It for fixingFariborz Jahanian2014-08-121-3/+6
| | | | | | | | | a messaging expression except in the simple case of a unary selector. We cannot reliably provide such a fixit due to numerous reasons where a matching selector could not be found. rdar://15756038 llvm-svn: 215480
* Support named values in the autocomplete feature.Samuel Benzaquen2014-08-124-160/+224
| | | | | | | | | | | | | | | | | | | Summary: This includes: - Passing a Sema to completeExpression to allow for named values in the expression. - Passing a map of names to values to the parser. - Update the Sema interface to include completion for matchers. - Change the parser to use the Sema for completion, instead of going directly to Registry. Reviewers: pcc Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D3509 llvm-svn: 215472
* Improve -Wuninitialized to catch const classes being used in their own copyRichard Trieu2014-08-122-6/+21
| | | | | | constructors. llvm-svn: 215471
* MS ABI: Mangle this qualifiers on function typesDavid Majnemer2014-08-121-9/+14
| | | | | | | | | | | C++11 allows this qualifiers to exist on function types when used in template arguments. Previously, I believed it wasn't possible because MSVC rejected declarations like: S<int () const &> s; However, it turns out MSVC properly allows them in using declarations; updated clang to be compatible with this mangling. llvm-svn: 215464
* [analyzer] Check for negative values used as the size of a C variable-length ↵Jordan Rose2014-08-121-2/+24
| | | | | | | | array. Patch by Daniel Fahlgren! llvm-svn: 215456
* Verify all the module map files for a pcm are the same on loadBen Langmuir2014-08-123-55/+124
| | | | | | | | | | We already verified the primary module map file (either the one that defines the top-level module, or the one that allows inferring it if it is an inferred framework module). Now we also verify any other module map files that define submodules, such as when there is a module.private.modulemap file. llvm-svn: 215455
* Allow @synchronized to contextually convert a C++ object to an ObjC object ↵Jordan Rose2014-08-121-3/+18
| | | | | | | | pointer. Patch by Grant Paul! llvm-svn: 215453
* Objective-C. Fixes an assert where because of capturedFariborz Jahanian2014-08-121-0/+10
| | | | | | | | variable in block is over-aligned with an align attribute causing block metadata size not be multiple of alignment. rdar://17878679 llvm-svn: 215449
* Use StringRef instead of MemoryBuffer&.Rafael Espindola2014-08-123-10/+11
| | | | | | | This code doesn't care where the data it is processing comes from, so a StringRef is probably the most natural interface. llvm-svn: 215448
* clang-format: Avoid bad line break.Daniel Jasper2014-08-121-2/+3
| | | | | | | | | | | | | Before: int aaaaaaaaaaaaaaaaaaaaaaaaaaaaa(const typename aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaa); After: int aaaaaaaaaaaaaaaaaaaaaaaaaaaaa( const typename aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaa); llvm-svn: 215442
* Correctly implement -include search logic.Manuel Klimek2014-08-125-65/+43
| | | | | | | | | | | | | | | According to the gcc docs, -include uses the current working directory for the lookup instead of the main source file. This patch gets rid of NormalizeIncludePath (which relied on an implementation detail of FileManager / FileEntry for the include path logic to work), and instead hands the correct lookup information down to LookupFile. This will allow us to change the FileEntry's behavior regarding its Name caching. llvm-svn: 215433
* Debuginfo: Correctly tag variadic ObjC methods with ↵Frederic Riss2014-08-121-0/+3
| | | | | | | | DW_TAG_unspecified_parameter. Fixes rdar://13690847 llvm-svn: 215423
* Reject virt-specifiers on friend declarations. Give anonymous bitfields aRichard Smith2014-08-122-5/+23
| | | | | | location so their diagnostics have somewhere to point. llvm-svn: 215416
* Reject varargs '...' in function prototype if there are more parameters afterRichard Smith2014-08-112-5/+50
| | | | | | | | | | | it. Diagnose with recovery if it appears after a function parameter that was obviously supposed to be a parameter pack. Otherwise, warn if it immediately follows a function parameter pack, because the user most likely didn't intend to write a parameter pack followed by a C-style varargs ellipsis. This warning can be syntactically disabled by using ", ..." instead of "...". llvm-svn: 215408
* Modify behavior of -ast-dump-lookups: if -ast-dump is not also provided, dumpRichard Smith2014-08-114-10/+38
| | | | | | | | anyway. If -ast-dump *is* also provided, then dump the AST declarations as well as the lookup results. This is invaluable for cross-correlating the lookup information with the declarations actually found. llvm-svn: 215393
* Change MemoryBuffer* to MemoryBuffer& parameter to Lexer::ComputePreambleDavid Blaikie2014-08-113-14/+14
| | | | | | | | | | | | | (dropping const from the reference as MemoryBuffer is immutable already, so const is just redundant - and while I'd personally put const everywhere, that's not the LLVM Way (see llvm::Type for another example of an immutable type where "const" is omitted for brevity)) Changing the pointer argument to a reference parameter makes call sites identical between callers with unique_ptrs or raw pointers, minimizing the churn in a pending unique_ptr migrations. llvm-svn: 215391
* unique_ptr-ify FileSystemStatCache::setNextStatCacheDavid Blaikie2014-08-114-10/+13
| | | | | | | | | | And in the process, discover that FileManager::removeStatCache had a double-delete when removing an element from the middle of the list (at the beginning or the end of the list, there was no problem) and add a unit test to exercise the code path (which successfully crashed when run (with modifications to match the old API) without this patch applied) llvm-svn: 215388
* unique_ptr-ify the MemoryBuffer parameter of GlobalModuleIndexDavid Blaikie2014-08-111-5/+4
| | | | llvm-svn: 215376
* Add some FIXMEs.Richard Smith2014-08-112-0/+4
| | | | llvm-svn: 215375
* Sema: Properly perform lookup when acting on fields for desig initsDavid Majnemer2014-08-111-88/+35
| | | | | | | | | | | | | | | | | | | | Clang used a custom implementation of lookup when handling designated initializers. The custom code was not particularly optimized and relied on standard lookup for typo-correction anyway. This custom code has to go, it doesn't properly support MSVC-style anonymous structs embedded inside other records; replace it with the typo-correction path. This has the side effect of speeding up semantic handling of the fields for a designated initializer while simplifying the code at the same time. This fixes PR20573. Differential Revision: http://reviews.llvm.org/D4839 llvm-svn: 215372
* Revert r215365 - Coverage mapping: emit mapping for cxx constructors that ↵Alex Lorenz2014-08-111-6/+1
| | | | | | use microsoft's ABI llvm-svn: 215371
* ToolChains.cpp: Increase size of Lines vector in DetectDistroHans Wennborg2014-08-111-1/+1
| | | | | | In a Clang bootstrap, the size of this vector was always 11. llvm-svn: 215370
* Increase the size of two SmallVectors in ↵Hans Wennborg2014-08-111-2/+2
| | | | | | | | Generic_GCC::GCCInstallationDetector::init In a bootstrap build of Clang, the size was always greater than 12. llvm-svn: 215369
* GCC compatibility: Ignore -fexec-charset=UTF-8 argument. It is the default ↵Sylvestre Ledru2014-08-111-0/+8
| | | | | | | | | | | | | | | | | | in Clang. Reject other values. Summary: Just like with -finput-charset=UTF-8 in review http://reviews.llvm.org/D4347, I think we should just ignore it when UTF-8 is provided. Reviewers: rnk, rafael Reviewed By: rafael Subscribers: rafael, cfe-commits Differential Revision: http://reviews.llvm.org/D4841 llvm-svn: 215368
* Coverage mapping: emit mapping for cxx constructors that use microsoft's ABIAlex Lorenz2014-08-111-1/+6
| | | | llvm-svn: 215365
* Increase SmallVector<> size in DiagnosticsEngine::setSeverityForGroupHans Wennborg2014-08-111-3/+3
| | | | | | | | In a Clang bootstrap, this vector always held 129 elements. Also switch to a range-based for loop. llvm-svn: 215360
* Work around default parameter problem in the static analyzer.Manuel Klimek2014-08-111-4/+7
| | | | | | | | | | | | | | | | | In cases like: struct C { ~C(); } void f(C c = C()); void t() { f(); } We currently do not add the CXXBindTemporaryExpr for the temporary (the code mentions that as the default parameter expressions are owned by the declaration, we'd otherwise add the same expression multiple times), but we add the temporary destructor pointing to the CXXBindTemporaryExpr. We need to fix that before we can re-enable the assertion. llvm-svn: 215357
* Fixes bug 20587 - Add K&R break before braces styleRoman Kashitsyn2014-08-111-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: http://llvm.org/bugs/show_bug.cgi?id=20587 Added K&R style. It could be enabled by the following option: ``` BreakBeforeBraces: KernighanRitchie ``` This style is like `Attach`, but break *only* before function declarations. As I can see, no additional logic required to support this style, any style different from other styles automagically satisfies K&R. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D4837 llvm-svn: 215354
* Sema: Handle declspecs without declarators in records properly in C modeDavid Majnemer2014-08-111-16/+28
| | | | | | | | | | | | | | | | | | | | | We had two bugs: - We wouldn't properly warn when a struct/union/enum was mentioned inside of a record definition if no declarator was provided. We should have mentioned that this declaration declares nothing. - We didn't properly support Microsoft's extension where certain declspecs without declarators would act as anonymous structs/unions. * We completely ignored the case where such a declspec could be a union. * We didn't properly handle the case where a record was defined inside another record: struct X { int a; struct Y { int b; }; }; llvm-svn: 215347
* Revert r215331, "unique_ptrify CompilerInstance::OutputFile(s) and remove a ↵NAKAMURA Takumi2014-08-112-18/+16
| | | | | | | | | | | | | | | | | | | | | unique_ptr around a non-owning raw_ostream in CodeGenAction::CreateASTConsumer" It cannot be compiled on Visual Studio 2012. clang\include\clang/Frontend/CompilerInstance.h(153): error C2248: 'std::unique_ptr<_Ty>::unique_ptr' : cannot access private member declared in class 'std::unique_ptr<_Ty>' with [ _Ty=llvm::raw_ostream ] D:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\memory(1447) : see declaration of 'std::unique_ptr<_Ty>::unique_ptr' with [ _Ty=llvm::raw_ostream ] This diagnostic occurred in the compiler generated function 'clang::CompilerInstance::OutputFile::OutputFile(const clang::CompilerInstance::OutputFile &)' llvm-svn: 215346
* unique_ptrify CompilerInstance::OutputFile(s) and remove a unique_ptr around ↵David Blaikie2014-08-102-16/+18
| | | | | | a non-owning raw_ostream in CodeGenAction::CreateASTConsumer llvm-svn: 215331
OpenPOWER on IntegriCloud