summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge GetAddrOfCXXConstructor and GetAddrOfCXXDonstructor. NFC.Rafael Espindola2014-09-119-50/+21
| | | | llvm-svn: 217598
* Fix bug 20892 - clang-format does not handle C-style commentsRoman Kashitsyn2014-09-112-2/+19
| | | | | | | | | | | | | | | | | | | | | | Summary: http://llvm.org/bugs/show_bug.cgi?id=20892 Add support of C-style formatting enabling/disabling directives. Now the following two styles are supported: // clang-format on /* clang-format on */ The flexibility in comments (support of extra spaces and/or slashes, etc.) is deliberately avoided to simplify search in large code bases. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits, curdeius, klimek Differential Revision: http://reviews.llvm.org/D5309 llvm-svn: 217588
* Avoid some unnecessary SmallVector copies.Benjamin Kramer2014-09-115-13/+11
| | | | | | No functionality change. llvm-svn: 217586
* NULL->nullptrAlexander Musman2014-09-111-1/+1
| | | | llvm-svn: 217573
* Fix a couple of -Wsign-compare warnings introduced in r217556Justin Bogner2014-09-111-3/+2
| | | | llvm-svn: 217569
* Thread Safety Analysis: major update to thread safety TIL.DeLesley Hutchins2014-09-108-765/+914
| | | | | | | | | | | | Numerous changes, including: * Changed the way variables and instructions are handled in basic blocks to be more efficient. * Eliminated SExprRef. * Simplified futures. * Fixed documentation. * Compute dominator and post dominator trees. llvm-svn: 217556
* More test for "void *" argument as index of a dictionary literal.Fariborz Jahanian2014-09-101-0/+5
| | | | llvm-svn: 217555
* Remove a couple of fixed paths that snuck into my test from 217550Ben Langmuir2014-09-101-2/+2
| | | | | | I forgot to fix these again the second time I copy-and-pasted. llvm-svn: 217552
* Avoid a couple of assertions when preprocessing with modulesBen Langmuir2014-09-108-22/+61
| | | | | | | | | | | | | | | | 1. We were hitting the NextIsPrevious assertion because we were trying to merge decl chains that were independent of each other because we had no Sema object to allow them to find existing decls. This is fixed by delaying loading the "preloaded" decls until Sema is available. 2. We were trying to get identifier info from an annotation token, which asserts. The fix is to special-case the module annotations in the preprocessed output printer. Fixed in a single commit because when you hit 1 you almost invariably hit 2 as well. llvm-svn: 217550
* Update for llvm api change.Rafael Espindola2014-09-101-3/+3
| | | | llvm-svn: 217547
* Only override the target architecture on -m32 and friends if it isJoerg Sonnenberger2014-09-102-1/+42
| | | | | | | | actually different. Fixes a surprising link error with nodejs on rpi, where armv6-netbsd-eabihf turned into armv5e-netbsd-eabihf, which doesn't lacks the necessary VFP support. llvm-svn: 217546
* Objective-C. Accept 'nil' as indexing argument toFariborz Jahanian2014-09-102-1/+12
| | | | | | | dictionary literals since the API which implements them accepts it too. // rdar://18254621 llvm-svn: 217543
* MS ABI: Emit dynamic initializers for selectany globals in ↵Hans Wennborg2014-09-102-6/+25
| | | | | | | | | | comdat-associative sections (PR20889) This prevents initializers for comdat-folded globals from running multiple times. Differential Revision: http://reviews.llvm.org/D5281 llvm-svn: 217534
* Objective-C arc. Fixes a crash when issuing diagnostic forFariborz Jahanian2014-09-102-1/+25
| | | | | | passing parameter to an audited CF API. rdar://18222007 llvm-svn: 217530
* [sphinx cleanup]Dan Liew2014-09-101-1/+1
| | | | | | Fix sphinx warning introduced by r217501. llvm-svn: 217524
* Recognize .lib files as linker input explicitlyEhsan Akhgari2014-09-101-0/+1
| | | | | | | | | | | | | | | | Summary: Currently, this is done implicitly in Driver::BuildInputs by considering any invalid input type as linker input. Test Plan: I don't think this behavior is observable for the reason stated above. Reviewers: hansw Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5294 llvm-svn: 217522
* Add a test for an operator access decl.Nico Weber2014-09-101-1/+7
| | | | | | | | | | In Parser::ParseCXXClassMemberDeclaration(), it was possible to change isAccessDecl = NextToken().is(tok::kw_operator); to isAccessDecl = false; and no tests would fail. Now there's coverage for this. llvm-svn: 217519
* typoSanjay Patel2014-09-101-1/+1
| | | | llvm-svn: 217517
* [analyzer] Fix pthread lock tests so that the API comes from a system header.Jordan Rose2014-09-102-23/+45
| | | | | | | | ...and verify that a global mutex in user code can be used without warnings. Patch by Aleksei Sidorin! llvm-svn: 217515
* clang-format: Add option to allow short case labels on a single line.Daniel Jasper2014-09-104-6/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | On a single line: switch (a) { case 1: x = 1; return; case 2: x = 2; return; default: break; } Not on a single line: switch (a) { case 1: x = 1; return; case 2: x = 2; return; default: break; } This partly addresses llvm.org/PR16535. In the long run, we probably want to lay these out in columns. llvm-svn: 217501
* CodeGen: Use a fixed alignment for vtables.Benjamin Kramer2014-09-102-0/+20
| | | | | | | | | | | | | | | Pointer-sized alignment is sufficient as we only ever read single values from the table. Otherwise we'd bump the alignment to 16 bytes in the backend if the vtable is larger than 16 bytes. This is great for structures that are accessed with vector instructions or copied around, but that's simply not the case for vtables. Shrinks the data segment of a Release x86_64 clang by 0.3%. The wins are larger for i386 and code bases that use vtables more often than we do. This matches the behavior of GCC 5. llvm-svn: 217495
* Revert over-eager unique_ptr conversion.Benjamin Kramer2014-09-101-6/+6
| | | | | | | This test wants to observe PPCallbacks after they have been moved into the preprocessor. That doesn't work if the pointer has been moved away. llvm-svn: 217481
* Unique_ptrify PPCallbacks ownership.Craig Topper2014-09-1018-45/+50
| | | | | | Unique_ptr creation stil needs to be moved earlier at some of the call sites. llvm-svn: 217474
* Don't crash on access decls with invalid scope specifier, PR20887.Nico Weber2014-09-102-0/+10
| | | | llvm-svn: 217472
* Objective-C. Under a special flag, -Wcstring-format-directive,Fariborz Jahanian2014-09-0912-11/+249
| | | | | | | | off by default, issue a warning if %s directive is used in certain CF/NS formatting APIs, to assist user in deprecating use of such %s in these APIs. rdar://18182443 llvm-svn: 217467
* Teach the analyzer that __builtin_assume_aligned returns its first argument.Jordan Rose2014-09-092-1/+31
| | | | | | Patch by Daniel Fahlgren! llvm-svn: 217461
* clang-format: [JS] Support regex literals with trailing escaped slash.Daniel Jasper2014-09-095-38/+71
| | | | | | | | | | | | | | | | | | Before: var regex = / a\//; int i; After: var regex = /a\//; int i; This required pushing the Lexer into its wrapper class and generating a new one in this specific case. Otherwise, the sequence get lexed as a //-comment. This is hacky, but I don't know a better way (short of supporting regex literals in the Lexer). Pushing the Lexer down seems to make all the call sites simpler. llvm-svn: 217444
* Tooling: Ignore file names in tooling::deduplicate.Benjamin Kramer2014-09-093-8/+26
| | | | | | | | | | | This was horribly broken due to how the sort predicate works. We would report a conflict for files with a replacement in the same position but different names if the length differed. Just ignore paths as this is often what the user wants. Files can occur with different names (due to symlinks or relative paths) and we don't ever want to do the same edit in one file twice. llvm-svn: 217439
* Allow empty statements in naked functions in addition to ASM statementsEhsan Akhgari2014-09-092-1/+10
| | | | | | | | | | | | Summary: This fixes PR20883. Test Plan: The patch includes an automated test. Reviewers: hansw Differential Revision: http://reviews.llvm.org/D5256 llvm-svn: 217413
* Fix PCHs that import more than one moduleBen Langmuir2014-09-083-1/+6
| | | | | | | We were passing < to std::unique, but it expects ==. Since the input is sorted, we were always trimming it to one entry. llvm-svn: 217402
* Report source location of returns_nonnull attribute in UBSan reports.Alexey Samsonov2014-09-081-9/+11
| | | | llvm-svn: 217400
* Implement nonnull-attribute sanitizerAlexey Samsonov2014-09-089-40/+108
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch implements a new UBSan check, which verifies that function arguments declared to be nonnull with __attribute__((nonnull)) are actually nonnull in runtime. To implement this check, we pass FunctionDecl to CodeGenFunction::EmitCallArgs (where applicable) and if function declaration has nonnull attribute specified for a certain formal parameter, we compare the corresponding RValue to null as soon as it's calculated. Test Plan: regression test suite Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits, rnk Differential Revision: http://reviews.llvm.org/D5082 llvm-svn: 217389
* Remove a parameter that has been unused since r188481. No behavior change.Nico Weber2014-09-082-4/+3
| | | | llvm-svn: 217386
* Make FileEntry::getName() valid across calls to FileManager::getFile()Ben Langmuir2014-09-082-4/+17
| | | | | | | | | Because we may change the name of a FileEntry inside getFile, the name returned by FileEntry::getName() could be destroyed. This was causing a use-after-free when searching the HeaderFileInfo on-disk hashtable for a module or pch. llvm-svn: 217385
* Add a comment for something that confused me.Nico Weber2014-09-081-0/+1
| | | | llvm-svn: 217384
* Handle constructors and destructors a bit more uniformly in CodeGen.Rafael Espindola2014-09-089-173/+161
| | | | | | | | | There were code paths that are duplicated for constructors and destructors just because we have both CXXCtorType and CXXDtorsTypes. This patch introduces an unified enum and reduces code deplication a bit. llvm-svn: 217383
* Add .clang-tidy configuration file to provide LLVM-optimized defaults for ↵Alexander Kornienko2014-09-081-0/+1
| | | | | | | | | | | | | | clang-tidy. Reviewers: chandlerc, djasper, alexfh Reviewed By: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5237 llvm-svn: 217366
* clang/test/CodeGen/builtin-assume*.c: Fixup for -Asserts.NAKAMURA Takumi2014-09-082-21/+22
| | | | llvm-svn: 217352
* Don't test really-large alignments for nowHal Finkel2014-09-081-1/+3
| | | | | | | | Temporarily comment out the test for really-large powers of two. This seems to be host-sensitive for some reason... trying to fix the clang-i386-freebsd builder. llvm-svn: 217351
* Add __builtin_assume and __builtin_assume_aligned using @llvm.assume.Hal Finkel2014-09-0715-12/+285
| | | | | | | | | | | This makes use of the recently-added @llvm.assume intrinsic to implement a __builtin_assume(bool) intrinsic (to provide additional information to the optimizer). This hooks up __assume in MS-compatibility mode to mirror __builtin_assume (the semantics have been intentionally kept compatible), and implements GCC's __builtin_assume_aligned as assume((p - o) & mask == 0). LLVM now contains special logic to deal with assumptions of this form. llvm-svn: 217349
* Adjust test/CodeGenCXX/pr12251.cppHal Finkel2014-09-071-3/+2
| | | | | | | | InstCombine just got a bit smarter about checking known bits of returned values, and because this test runs the optimizer, it requires an update. We should really rewrite this test to directly check the IR output from CodeGen. llvm-svn: 217347
* Avoid writing to the test directory as it may not be writable.David Blaikie2014-09-071-2/+2
| | | | llvm-svn: 217339
* Fix test to not write output to the test directory, as it may not be writable.David Blaikie2014-09-071-2/+2
| | | | llvm-svn: 217337
* Try to green test/Sema/format-strings.c on Win botsHans Wennborg2014-09-072-3/+7
| | | | llvm-svn: 217327
* MS format strings: parse the 'Z' printf conversion specifier (PR20808)Hans Wennborg2014-09-074-3/+26
| | | | llvm-svn: 217326
* Move x86-specific bits of warn-unused-local-typedef.cpp into their own file.Nico Weber2014-09-062-16/+17
| | | | | | | That way, most of the test can run everywhere. Also give the new file an x86 triple in addition to a REQUIRES line. llvm-svn: 217314
* Attempt to fix ARM bot. (The test references a typedef from x86 asm.)Nico Weber2014-09-061-0/+1
| | | | llvm-svn: 217313
* [x86] Clean up the x86 builtin specs to reflect r217310 in LLVM whichChandler Carruth2014-09-063-16/+16
| | | | | | | | | | | | | | | made the 8-bit masks actually 8-bit arguments to these intrinsics. These builtins are a mess. Many were missing the I qualifier which I added where obviously correct. Most aren't tested, but I've updated the relevant tests. I've tried to catch all the things that should become 'c' in this round. It's also frustrating because the set of these is really ad-hoc and doesn't really map that cleanly to the set supported by either GCC or LLVM. Oh well... llvm-svn: 217311
* Add error, recovery and fixit for "~A::A() {...}".Richard Smith2014-09-064-2/+44
| | | | llvm-svn: 217302
* Add -Wunused-local-typedef, a warning that finds unused local typedefs.Nico Weber2014-09-0625-12/+451
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The warning warns on TypedefNameDecls -- typedefs and C++11 using aliases -- that are !isReferenced(). Since the isReferenced() bit on TypedefNameDecls wasn't used for anything before this warning it wasn't always set correctly, so this patch also adds a few missing MarkAnyDeclReferenced() calls in various places for TypedefNameDecls. This is made a bit complicated due to local typedefs possibly being used only after their local scope has closed. Consider: template <class T> void template_fun(T t) { typename T::Foo s3foo; // YYY (void)s3foo; } void template_fun_user() { struct Local { typedef int Foo; // XXX } p; template_fun(p); } Here the typedef in XXX is only used at end-of-translation unit, when YYY in template_fun() gets instantiated. To handle this, typedefs that are unused when their scope exits are added to a set of potentially unused typedefs, and that set gets checked at end-of-TU. Typedefs that are still unused at that point then get warned on. There's also serialization code for this set, so that the warning works with precompiled headers and modules. For modules, the warning is emitted when the module is built, for precompiled headers each time the header gets used. Finally, consider a function using C++14 auto return types to return a local type defined in a header: auto f() { struct S { typedef int a; }; return S(); } Here, the typedef escapes its local scope and could be used by only some translation units including the header. To not warn on this, add a RecursiveASTVisitor that marks all delcs on local types returned from auto functions as referenced. (Except if it's a function with internal linkage, or the decls are private and the local type has no friends -- in these cases, it _is_ safe to warn.) Several of the included testcases (most of the interesting ones) were provided by Richard Smith. (gcc's spelling -Wunused-local-typedefs is supported as an alias for this warning.) llvm-svn: 217298
OpenPOWER on IntegriCloud