summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Sort all the #include lines with LLVM's utils/sort_includes.py whichChandler Carruth2014-01-0755-75/+66
| | | | | | | encodes the canonical rules for LLVM's style. I noticed this had drifted quite a bit when cleaning up LLVM, so wanted to clean up Clang as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198686 91177308-0d34-0410-b5e6-96231b3b80d8
* For areVectorOperandsLaxBitCastable(), only return false if both opearands ↵Argyrios Kyrtzidis2014-01-071-14/+18
| | | | | | | | | | are vector types and add a diagnostic when the operand is a vector and non-scalar value. rdar://15722301 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198680 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a -Wparentheses warning from GCC that caught a badly formed assert.Chandler Carruth2014-01-071-1/+1
| | | | | | | I have no idea why Clang's warning doesn't fire here, looks like a Clang bug. I'll investigate that separately. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198677 91177308-0d34-0410-b5e6-96231b3b80d8
* CodeGen: Include llvm/Config/config.h for strtoll on WindowsJustin Bogner2014-01-071-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198672 91177308-0d34-0410-b5e6-96231b3b80d8
* update comment.Adrian Prantl2014-01-071-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198670 91177308-0d34-0410-b5e6-96231b3b80d8
* Bring back magic constants in the digraph diagnosticAlp Toker2014-01-072-5/+18
| | | | | | | | This backs out changes in commit r198605 and part of r198604, replacing the original tok::kw_template with a slightly more obvious placeholder tok::unknown. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198666 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement a new -fstandalone-debug option. rdar://problem/15685848Adrian Prantl2014-01-073-16/+22
| | | | | | | | | | | | | | It controls everything that -flimit-debug-info used to, plus the vtable type optimization. The old -fno-limit-debug-info option is now an alias to -fstandalone-debug and vice versa. Standalone is the default on Darwin until dtrace is updated to work with non-standalone debug info (rdar://problem/15758808). Note: I kept the LimitedDebugInfo name in CodeGenOptions::DebugInfoKind because NoStandaloneDebugInfo sounded even more confusing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198655 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC. Computation of offsets when doing @encode type encodingFariborz Jahanian2014-01-071-1/+12
| | | | | | | is only used in an assert. Do not do it if assert is not on. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198652 91177308-0d34-0410-b5e6-96231b3b80d8
* CodeGen: Sentences end with a periodJustin Bogner2014-01-073-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198649 91177308-0d34-0410-b5e6-96231b3b80d8
* Properly sort CMake list. NFC.Ted Kremenek2014-01-061-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198645 91177308-0d34-0410-b5e6-96231b3b80d8
* CodeGen: Initial instrumentation based PGO implementationJustin Bogner2014-01-0616-59/+1066
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198640 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver: Accept -fprofile-instr-use and -fprofile-instr-generateJustin Bogner2014-01-063-0/+18
| | | | | | These flags will be used for instrumentation based PGO. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198639 91177308-0d34-0410-b5e6-96231b3b80d8
* Prospective MSVC 2010 build fixAlp Toker2014-01-061-3/+3
| | | | | | | Try to fix Compiler Error C2011 following r198607 by removing enum from 'enum TokenKind' parameter types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198621 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify diagnostic tag type using the token kind formatterAlp Toker2014-01-061-7/+2
| | | | | | As far as the parser is concerned the tag type is always a keyword. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198606 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use magic constants in the digraph diagnosticAlp Toker2014-01-061-16/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198605 91177308-0d34-0410-b5e6-96231b3b80d8
* Support diagnostic formatting of keyword tokensAlp Toker2014-01-062-7/+21
| | | | | | | | | Implemented with a new getKeywordSpelling() accessor. Unlike getTokenName() the result of this function is stable and may be used in diagnostic output. Uses of this feature are split out into the subsequent commit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198604 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename getTokenSimpleSpelling() to getPunctuatorSpelling()Alp Toker2014-01-063-4/+4
| | | | | | | That's what it does, what the documentation says it does and what callers expect it to do. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198603 91177308-0d34-0410-b5e6-96231b3b80d8
* Highlight the previous underlying enum type when diagnosing a mismatchAlp Toker2014-01-062-1/+9
| | | | | | | | | | | | | | enum-scoped.cpp:93:6: error: enumeration redeclared with different underlying type 'short' (was 'int') enum Redeclare6 : short; ^ enum-scoped.cpp:92:6: note: previous declaration is here enum Redeclare6 : int; ^ ~~~ The redeclaration source range is still missing but this is a step forward, potentially edging towards a FixIt. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198601 91177308-0d34-0410-b5e6-96231b3b80d8
* Diagnose enum redeclarations properlyAlp Toker2014-01-061-3/+3
| | | | | | | | | | | | | | | | | | In all three checks, the note indicates a previous declaration and never a 'use'. Before: enum-scoped.cpp:92:6: note: previous use is here enum Redeclare6 : int; ^ After: enum-scoped.cpp:92:6: note: previous declaration is here enum Redeclare6 : int; ^ git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198600 91177308-0d34-0410-b5e6-96231b3b80d8
* Use token kind instead of '%select{.|->}0' in diagnosticAlp Toker2014-01-061-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198599 91177308-0d34-0410-b5e6-96231b3b80d8
* Apply some LLVM_READONLY / LLVM_READNONE on diagnostic functionsAlp Toker2014-01-061-3/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198598 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Produce an error if an address space is used on the returnJoey Gouly2014-01-061-0/+13
| | | | | | | type of a function. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198597 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format: Spacing inside enum braces.Daniel Jasper2014-01-051-1/+3
| | | | | | | | | | Before (in Google style): enum ShortEnum {A, B, C}; After: enum ShortEnum { A, B, C }; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198559 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format: Allow formatting short enums on a single line.Daniel Jasper2014-01-052-7/+12
| | | | | | | | | | | | | | | | | Before: enum ShortEnum { A, B, C }; After: enum ShortEnum { A, B, C }; This seems to be the predominant choice in LLVM/Clang as well as in Google style. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198558 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix 'declartion' typosAlp Toker2014-01-051-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198549 91177308-0d34-0410-b5e6-96231b3b80d8
* Pre-declare '::type_info' in MicrosoftMode only, not MicrosoftExtAlp Toker2014-01-051-1/+1
| | | | | | | | It was previously enabled in both but should only have been part of the drop-in quirks mode that is 'MicrosoftMode' given that it's only useful for compatibility with the Microsoft headers/runtime. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198548 91177308-0d34-0410-b5e6-96231b3b80d8
* Tweak the parse recovery in r198540Alp Toker2014-01-051-3/+8
| | | | | | | Cover a hypothetical case when we might not have reached the final argument declaration for some reason during recovery, and split out for readability. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198542 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bungled parse recovery in K&R function declarationsAlp Toker2014-01-051-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | void knrNoSemi(i) int i { } Adherents of The C Programming Language unfortunate enough to miss a semicolon as above would be met with a cascade of errors spanning the remainder of the TU. This patch introduces a beautiful parse error recovery, complete with helpful FixIt to restore sanity. Before (output redacted for brevity): error: 'error' diagnostics seen but not expected: File declarators.c Line 119: declaration does not declare a parameter File declarators.c Line 123: declaration does not declare a parameter File declarators.c Line 127: parameter named 'func_E12' is missing File declarators.c Line 127: expected ';' at end of declaration File declarators.c Line 133: parameter named 'func_E13' is missing File declarators.c Line 133: expected ';' at end of declaration File declarators.c Line 139: parameter named 'func_E14' is missing File declarators.c Line 139: expected ';' at end of declaration File declarators.c Line 145: parameter named 'func_E15' is missing File declarators.c Line 145: expected ';' at end of declaration File declarators.c Line 150: expected function body after function declarator File declarators.c Line 119: declaration of 'enum E11' will not be visible outside of this function File declarators.c Line 123: declaration of 'enum E12' will not be visible outside of this function File declarators.c Line 133: ISO C forbids forward references to 'enum' types File declarators.c Line 133: declaration of 'enum E13' will not be visible outside of this function File declarators.c Line 139: ISO C forbids forward references to 'enum' types File declarators.c Line 139: declaration of 'enum E14' will not be visible outside of this function File declarators.c Line 145: ISO C forbids forward references to 'enum' types File declarators.c Line 145: declaration of 'enum E15' will not be visible outside of this function ... After: declarators.c:103:24: error: expected ';' at end of declaration void knrNoSemi(i) int i { } ^ ; Patch found in a sealed envelope dated 1978 with the message "Do not open until January 2014" git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198540 91177308-0d34-0410-b5e6-96231b3b80d8
* Parse: Token consumption modernization and loop de-nestingAlp Toker2014-01-055-59/+51
| | | | | | Cleanup only. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198539 91177308-0d34-0410-b5e6-96231b3b80d8
* Move MS predefined type_info out of InitializePredefinedMacrosAlp Toker2014-01-042-1/+7
| | | | | | | | | | | Instead of keeping it in amongst the macros, build the declaration at Sema init the same way we do with other predeclared and builtin types. In practice this means the declaration is marked implicit and therefore won't show up as an unwanted user-declared type in tooling which has been a frequently reported issue (though I haven't been able to cook up a test). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198497 91177308-0d34-0410-b5e6-96231b3b80d8
* Only mark dump() function definitions 'used' in debug buildsAlp Toker2014-01-049-42/+27
| | | | | | | | | | | | | | | | This has the dual effect of (1) enabling more dead-stripping in release builds and (2) ensuring that debug helper functions aren't stripped away in debug builds, as they're intended to be called from the debugger. Note that the attribute is applied to definitions rather than declarations in headers going forward because it's now conditional on NDEBUG: /// \brief Mark debug helper function definitions like dump() that should not be /// stripped from debug builds. Requires corresponding macro added in LLVM r198456. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198489 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Remove IdempotentOperations checker.Ted Kremenek2014-01-043-741/+0
| | | | | | | | | This checker has not been updated to work with interprocedural analysis, and actually contains both logical correctness issues but also memory bugs. We can resuscitate it from version control once there is focused interest in making it a real viable checker again. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198476 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] When checking if a bitcast is appropriate between vector types, take intoArgyrios Kyrtzidis2014-01-041-2/+37
| | | | | | | | | | | consideration the num-of-elements*width-of-element width. Disallow casts when such width is not equal between the vector types otherwise we may end up with an invalid LLVM bitcast. rdar://15722308. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198474 91177308-0d34-0410-b5e6-96231b3b80d8
* Ignore qualified templated functions for -Winfinite-recursion. This treatsRichard Trieu2014-01-041-0/+12
| | | | | | | functions like Foo<5>::run() the same way as run<5>() for this warning. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198470 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-cxxabi] Improve vbtable name mangling accuracyReid Kleckner2014-01-032-173/+121
| | | | | | | | | | | | | | | | | | | | | | Summary: This makes us more compatible with MSVC 2012+ and fixes PR17748 where we would give two tables the same name. Rather than doing a fresh depth-first traversal of the inheritance graph for every record's vbtables, now we memoize vbtable paths for each record. By doing memoization, we end up considering virtual bases of subobjects that come later in the depth-first traversal. Where previously we would have ignored a virtual base that we'd already seen, we now consider it for name mangling purposes without emitting a duplicate vbtable for it. Reviewers: majnemer CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2509 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198462 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug info: Ensure that the last stop point in a function is still withinAdrian Prantl2014-01-035-8/+16
| | | | | | | | | the lexical block formed by the compound statement that is the function body. rdar://problem/15010825 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198461 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactored Builtin::Context::isPrintfLike and isScanfLike into a helper ↵Aaron Ballman2014-01-031-28/+23
| | | | | | | | function. The implementations are identical, except for the format arguments being searched for. No functional changes intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198446 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix 80 col violation.Argyrios Kyrtzidis2014-01-031-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198444 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass the decl directly to the diagnostic, no need to call getDeclName().Argyrios Kyrtzidis2014-01-031-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198442 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixing a FIXME; the RetTy template parameter is always bool in practice, and ↵Aaron Ballman2014-01-031-48/+47
| | | | | | so it has been removed. No functional changes intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198440 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for llvm's DataLayout including mangling information.Rafael Espindola2014-01-031-38/+57
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198439 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed one of the string versions of getQualifiedNameAsString, and switched ↵Aaron Ballman2014-01-032-23/+34
| | | | | | over to using printQualifiedName where possible. No functional changes intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198433 91177308-0d34-0410-b5e6-96231b3b80d8
* [objc] Refactor and improve functionality for the -Wunused-property-ivar ↵Argyrios Kyrtzidis2014-01-039-54/+83
| | | | | | | | | | | | | | warning. - Remove the additions to ObjCMethodDecl & ObjCIVarDecl that were getting de/serialized and consolidate all functionality for the checking for this warning in Sema::DiagnoseUnusedBackingIvarInAccessor - Don't check immediately after the method body is finished, check when the @implementation is finished. This is so we can see if the ivar was referenced by any other method, even if the method was defined after the accessor. - Don't silence the warning if any method is called from the accessor silence it if the accessor delegates to another method via self. rdar://15727325 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198432 91177308-0d34-0410-b5e6-96231b3b80d8
* Reformat the description strings. No functionality change.Rafael Espindola2014-01-031-81/+33
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198430 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed a FIXME; created a print method for Selectors that accepts a ↵Aaron Ballman2014-01-0312-29/+49
| | | | | | | | raw_ostream, and started using it in places it made sense. No functional changes intended, just API cleanliness. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198428 91177308-0d34-0410-b5e6-96231b3b80d8
* Make clang::ento::CreateAnalysisConsumer a part of a public interface of the ↵Alexander Kornienko2014-01-033-45/+2
| | | | | | | | | | | | | | | | | | static analyzer. Summary: This allows for a better alternative to the FrontendAction hack used in clang-tidy in order to get static analyzer's ASTConsumer. Reviewers: jordan_rose, krememek Reviewed By: jordan_rose CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2505 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198426 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplifying the mutual exclusion check now that the diagnostics engine knows ↵Aaron Ballman2014-01-031-12/+7
| | | | | | how to handle Attr objects directly. Updates an associated test case due to the attribute name being properly quoted again. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198424 91177308-0d34-0410-b5e6-96231b3b80d8
* Using the proper helper function instead of manually doing this work. No ↵Aaron Ballman2014-01-031-2/+2
| | | | | | functional changes intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198421 91177308-0d34-0410-b5e6-96231b3b80d8
* Removing some more unnecessary manual quotes from diagnostics.Aaron Ballman2014-01-031-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198420 91177308-0d34-0410-b5e6-96231b3b80d8
* Removing an unneeded typecast. getScopeRep() already returns a ↵Aaron Ballman2014-01-031-1/+1
| | | | | | NestedNameSpecifier. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198419 91177308-0d34-0410-b5e6-96231b3b80d8