summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Correctly remove OptimizeForSize from functions marked OptimizeNone.Paul Robinson2014-11-241-10/+15
| | | | | | | This allows using __attribute__((optnone)) and the -Os/-Oz options. Fixes PR21604. llvm-svn: 222683
* CodeGen: make i686-windows-itanium more similar to msvcSaleem Abdulrasool2014-11-241-0/+1
| | | | | | | The itanium environment follows the system calling convention for structures. Pass small aggregates via registers. llvm-svn: 222680
* CodeGen: use a range-based for loopSaleem Abdulrasool2014-11-241-3/+2
| | | | | | Convert a debug assertion into a range-based loop form. NFC. llvm-svn: 222679
* Reverting r222646; the tests do not pass on Windows. Also reverts r222664, ↵Aaron Ballman2014-11-242-15/+3
| | | | | | which was required for r222646 to compile with Visual Studio 2012. llvm-svn: 222667
* Fix line endingsNico Rieck2014-11-241-3/+3
| | | | llvm-svn: 222666
* Fix crash when using __if_exists in C modeNico Rieck2014-11-241-2/+3
| | | | llvm-svn: 222665
* Reverting r222638; it broke the MSVC build bots because Visual Studio 2012 ↵Aaron Ballman2014-11-245-371/+413
| | | | | | does not support variadic templates. Also reverting r222641 because it was relying on 222638. llvm-svn: 222656
* Adding 4 ASTMatchers: typedefDecl, isInMainFile, isInSystemFile, ↵Manuel Klimek2014-11-242-3/+15
| | | | | | | | | | | | | | | | | | | | isInFileMatchingName Summary: Often one is only interested in matches within the main-file or matches that are not within a system-header, for which this patch adds isInMainFile and isInSystemFile. They take no arguments and narrow down the matches. The isInFileMatchingName is mainly thought for interactive clang-query-sessions, to make a matcher more specific without restarting the session with the files you are interested in for that moment. It takes a string that will be used as regular-expression to match the filename of where the matched node is expanded. Patch by Hendrik von Prince. llvm-svn: 222646
* clang-format: Make short case labels work with #ifsDaniel Jasper2014-11-231-0/+3
| | | | | | | | | | | | | | | | | | | Before: switch (a) { #if FOO case 0: return 0; #endif } After: switch (a) { #if FOO case 0: return 0; #endif } This fixed llvm.org/PR21544. llvm-svn: 222642
* clang-format: [Java] Treat 'instanceof' like other binary operators.Daniel Jasper2014-11-232-2/+6
| | | | | | This fixes llvm.org/PR21436. llvm-svn: 222641
* clang-format: [Java] Space before array initializers.Daniel Jasper2014-11-231-0/+2
| | | | | | | | | | Before: new int[]{1, 2, 3, 4}; After: new int[] {1, 2, 3, 4}; llvm-svn: 222640
* clang-format: Improve ObjC blocks with return type.Daniel Jasper2014-11-231-1/+1
| | | | | | | | | | | | Before: Block b = ^int * (A * a, B * b) {} After: Block b = ^int *(A *a, B *b) {} This fixed llvm.org/PR21619. llvm-svn: 222639
* clang-format: Refactoring.Daniel Jasper2014-11-235-413/+367
| | | | | | | Provide more overloads to simplify testing the type of a token. No functional changes intended. llvm-svn: 222638
* clang-format: [JS] Support Closure's module statements.Daniel Jasper2014-11-235-26/+40
| | | | | | | These are like import statements and should not be line-wrapped. Minor restructuring of the handling of other import statements. llvm-svn: 222637
* CodeGen: tweak struct ABI handlingSaleem Abdulrasool2014-11-231-1/+1
| | | | | | | | Cygwin and MinGW fail to conform to the underlying system's structure passing ABI. Make the check more precise to ensure that we correctly generate code for the itanium environment. llvm-svn: 222626
* CodeGen: Make atomic operations play nice with address spacesDavid Majnemer2014-11-221-6/+8
| | | | | | | | We were being a little sloppy with our pointer/address space casts. This fixes PR21643. llvm-svn: 222615
* Simplify MicrosoftMangleContextImpl::shouldMangleStringLiteralDavid Majnemer2014-11-221-2/+1
| | | | | | No functionality changed. llvm-svn: 222610
* Delay checking overrides for exception specifications if the overriddenRichard Smith2014-11-223-21/+22
| | | | | | specification has not yet been parsed. llvm-svn: 222603
* MS ABI: Mangle u8 string literalsDavid Majnemer2014-11-211-1/+2
| | | | | | UTF8 string literals are mangled just like ASCII string literals. llvm-svn: 222591
* Objective-C ARC. Fixes a crash when checking for 'weak' propery Fariborz Jahanian2014-11-211-0/+2
| | | | | | whose base is not an expression. rdar://19053620 llvm-svn: 222570
* Sema: Don't permit variably modified types in typeidDavid Majnemer2014-11-211-0/+7
| | | | | | | | | | GCC and ICC both reject this and the 'Runtime-sized arrays with automatic storage duration' (N3639) paper forbade this as well. Previously, we would crash on our way to mangling. This fixes PR21632. llvm-svn: 222569
* Implement -Wcast-qual, fixing #13772.Roman Divacky2014-11-211-4/+40
| | | | | | Many thanks to dblaikie for his advices and suggestions! llvm-svn: 222568
* MS ABI: Mangle char16_t and char32_t string literalsDavid Majnemer2014-11-211-10/+7
| | | | | | | | | | | | | | | | We previously had support for char and wchar_t string literals. VS 2015 added support for char16_t and char32_t. String literals must be mangled in the MS ABI in order for them to be deduplicated across translation units: their linker has no notion of mergeable section. Instead, they use the mangled name to make a COMDAT for the string literal; the COMDAT will merge with other COMDATs in other object files. This allows strings in object files generated by clang to get merged with strings in object files generated by MSVC. llvm-svn: 222564
* Add an assertion for detecting missed/uncorrected TypoExprs.Kaelyn Takata2014-11-211-0/+2
| | | | llvm-svn: 222552
* Enable ActOnIdExpression to use delayed typo correction for non-C++ codeKaelyn Takata2014-11-218-22/+62
| | | | | | when calling DiagnoseEmptyLookup. llvm-svn: 222551
* Properly correct initializer expressions based on whether they would be valid.Kaelyn Takata2014-11-211-0/+17
| | | | llvm-svn: 222550
* Use the full-Expr filter to disambiguate equidistant correctionKaelyn Takata2014-11-211-26/+41
| | | | | | candidates. llvm-svn: 222549
* clang-format: Understand more lambda return types.Daniel Jasper2014-11-212-1/+7
| | | | | | | | | | Before: auto a = [&b, c ](D * d) -> D * {} After: auto a = [&b, c](D* d) -> D* {} llvm-svn: 222534
* clang-format: Use nested block special case for all languages.Daniel Jasper2014-11-213-30/+27
| | | | | | | | | | | | | | | | | | | Previously this was only used for JavaScript. Before: functionCall({ int i; int j; }, aaaa, bbbb, cccc); After: functionCall({ int i; int j; }, aaaa, bbbb, cccc); llvm-svn: 222531
* clang-format: Handle comments in short case labels.Daniel Jasper2014-11-211-1/+1
| | | | | | | | | | | | | | | With AllowShortCaseLabelsOnASingleLine set to true: This gets now left unchanged: case 1: // comment return; Whereas before it was changed into: case 1: // comment return; This fixes llvm.org/PR21630. llvm-svn: 222529
* clang-format: [Java] Support more Java keywords.Daniel Jasper2014-11-212-2/+7
| | | | | | | | | | | | | | | | | | Before: public final<X> Foo foo() { } public abstract<X> Foo foo(); After: public final <X> Foo foo() { } public abstract <X> Foo foo(); Patch by Harry Terkelsen. Thank you. llvm-svn: 222527
* clang: do not add -pie for tsanDmitry Vyukov2014-11-212-5/+5
| | | | | | | | | Revision 220571 removes the requirement to use -pie for tsan binaries. So remove -pie from driver. Also s/hasZeroBaseShadow/requiresPIE/ because that is what it is used for. Msan does not have zero-based shadow, but requires pie. And in general the relation between zero-based shadow and pie is unclear. http://reviews.llvm.org/D6318 llvm-svn: 222526
* clang-format: [Java] Basic lambda support.Daniel Jasper2014-11-212-0/+10
| | | | llvm-svn: 222524
* [OPENMP] Disable CapturedStmt generation for standalone directives.Alexey Bataev2014-11-211-32/+4
| | | | | | No functional changes, just code improvement. llvm-svn: 222523
* MS ABI: Mangle char16_t and char32_t typesDavid Majnemer2014-11-211-2/+2
| | | | | | | These mangling make clang more compatible with MSVC 2015. Correctly mangling char16_t and char32_t will take a little more work. llvm-svn: 222515
* Fix missing diagnostic for unsupported TLS for some thread_local variables.Bob Wilson2014-11-211-16/+14
| | | | | | | | | Clang r181627 moved a check for block-scope variables into this code for handling thread storage class specifiers, but in the process, it broke the logic for checking if the target supports TLS. Fix this with some simple restructuring of the code. rdar://problem/18796883 llvm-svn: 222512
* [modules] When explicitly importing a module, it's fine for the imported moduleRichard Smith2014-11-211-0/+7
| | | | | | | | to be newer than we were expecting. That happens if .pcm's get moved between file systems during a distributed build. (It's still not OK for them to actually be different, though, so we still check the size and signature matches.) llvm-svn: 222507
* PR21323: Fix iterator invalidation issue when looking for redeclarations of aRichard Smith2014-11-211-3/+8
| | | | | | | | | special member function. No test yet: the only testcases we have for this issue are extremely complex. Testcase will be added once I get a reasonable reduction. llvm-svn: 222506
* Extend -Wuninitialized to warn when accessing uninitialized base classes in aRichard Trieu2014-11-211-12/+41
| | | | | | constructor. llvm-svn: 222503
* Debug info for blocks: Fix a bug caught by the Verifier.Adrian Prantl2014-11-213-5/+11
| | | | | | | | | | | | When emitting nested block definitions, the insert-at-point variant of DIBuilder::insertDeclare() could be called with the insertion point set to the end-of-BasicBlock sentinel, causing the parent pointer of the CallInst to be set to the intentionally bogus value of the sentinel. Fixed by conditionally invoking the correct version of insertDeclare(). rdar://problem/19034882 llvm-svn: 222487
* DebugInfo: Fix another case of r222377 when we do have a definition of the ↵David Blaikie2014-11-211-11/+7
| | | | | | variable, but we might not be emitting it (such as templates) llvm-svn: 222485
* Remove code that tries to avoid transforming non-dependent call operator typesRichard Smith2014-11-201-78/+24
| | | | | | | | | | for lambda expressions. That can't ever work; we need to transform the parameters in order to create new ones in the new call operator context. Fixes a rejects-valid when transforming a context containing a lambda-expression that uses its function parameters in C++14 mode. llvm-svn: 222482
* Fix crash-on-valid if a lambda-expression appears lexically directly within aRichard Smith2014-11-201-1/+4
| | | | | | local class inside a template. llvm-svn: 222476
* Intercept __crt_va_* used by MSVC "14"Reid Kleckner2014-11-201-0/+16
| | | | | | | Moving further into the implementor's namespace is good, but now we have one more name to intercept. llvm-svn: 222473
* PR21565: Further refine the conditions for enabling eager parsing ofRichard Smith2014-11-202-9/+24
| | | | | | | | std::X::swap exception specifications (allowing parsing of non-conforming code in libstdc++). The old conditions also matched the functions in MSVC's STL, which were relying on deferred parsing here. llvm-svn: 222471
* Ensure all TypoExprs are diagnosed by the tree transform.Kaelyn Takata2014-11-201-0/+16
| | | | | | | | | | | | If there is more than one TypoExpr within the expr being transformed and any but the last TypoExpr seen don't have any viable candidates, the tree transform will be aborted early and the remaining TypoExprs are never seen and hence never diagnosed. This adds a simple RecursiveASTVisitor to find all of the TypoExprs to be diagnosed in the case where typo correction of the entire expr fails (and the result of the tree transform is an ExprError). llvm-svn: 222465
* Wire up delayed typo correction to DiagnoseEmptyLookup and set upKaelyn Takata2014-11-2010-40/+178
| | | | | | | | | Sema::ActOnIdExpression to use the new functionality. Among other things, this allows recovery in several cases where it wasn't possible before (e.g. correcting a mistyped static_cast<>). llvm-svn: 222464
* Add a flag to BuildDeclarationNameExpr to not reject invalid decls.Kaelyn Takata2014-11-202-8/+10
| | | | llvm-svn: 222463
* Factor out the default recovery handling.Kaelyn Takata2014-11-201-14/+77
| | | | | | | | | | | The default handling is extended to properly create member expressions and Objective-C ivar references. Also detect and reject cases where multiple corrections have identical correction distances and are valid, instead of suggesting the first one that is found. llvm-svn: 222462
* Correctly set the SourceRange a TypoCorrection will replace.Kaelyn Takata2014-11-201-3/+5
| | | | | | Also clean up TypoCorrection::setCorrectionRange while we're at it. llvm-svn: 222460
OpenPOWER on IntegriCloud