summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Fix regression from r185450.Eli Friedman2013-07-051-4/+5
| | | | | | | | As it turns out, the NoFunction bit for local class mangling needed to be propagated into more places. r185450 turned what used to be an incorrect mangling into an assertion. llvm-svn: 185713
* Objective-C: diagnose when synthesizing an ivar ofFariborz Jahanian2013-07-051-1/+7
| | | | | | abstract class type. // rdar://14261999 llvm-svn: 185710
* Fix PR16547.Rafael Espindola2013-07-051-2/+3
| | | | | | | | | | | We should not be asking unique_file to prepend the system temporary directory when creating the html report. Unfortunately I don't think we can test this with the current infrastructure since unique_file ignores MakeAbsolute if the directory is already absolute and the paths provided by lit are. I will take a quick look at making this api a bit less error prone. llvm-svn: 185707
* We don't need to check for windows' error codes in here.Rafael Espindola2013-07-051-3/+1
| | | | | | | The operator== calls equivalent which calls default_error_condition which handles windows to posix conversion. llvm-svn: 185702
* Fix formatting for allocation of new pointer variables.Daniel Jasper2013-07-051-1/+2
| | | | | | | | | | | | Before: T **t = new T * ; T **q = new T * (); After: T **t = new T *; T **q = new T *(); llvm-svn: 185699
* Improve detection for preventing certain kind of formatting patterns.Daniel Jasper2013-07-051-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a better implementation of r183097. The main purpose is to prevent certain constructs to be formatted "like a block of text". Before: aaaaaaaaaaaaa< aaaaaaaaaa, aaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>* aaaa = new aaaaaaaaaaaaa< aaaaaaaaaa, aaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>(bbbbbbbbbbbbbbbbbbbbbbbb); aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb] = (*cccccccccccccccc)[ dddddddddddddddddddddddddddddddddddddddddddddddddddddddd]; After: aaaaaaaaaaaaa<aaaaaaaaaa, aaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>* aaaa = new aaaaaaaaaaaaa<aaaaaaaaaa, aaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>( bbbbbbbbbbbbbbbbbbbbbbbb); aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb] = (*cccccccccccccccc)[ dddddddddddddddddddddddddddddddddddddddddddddddddddddddd]; llvm-svn: 185687
* Don't break after a "(" following a binary operator.Daniel Jasper2013-07-051-4/+10
| | | | | | | | | | | | | | | | Additionally, allow breaking after c-style casts, but with a high penalty. Before: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa *foo = ( aaaaaaaaaaaaaaaaa *)bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb; After: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa *foo = (aaaaaaaaaaaaaaaaa *) bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb; This fixes llvm.org/PR16049. llvm-svn: 185685
* Sema: Call IgnoreParens fewer times in CheckAddressOfOperandDavid Majnemer2013-07-051-4/+4
| | | | llvm-svn: 185684
* Use typedef for Densemap contraining SmallVector passed to a function to ↵Craig Topper2013-07-051-6/+4
| | | | | | avoid repeating SmallVector size. llvm-svn: 185683
* Add typedefs for Densemaps containing SmallVectors to avoid repeating the ↵Craig Topper2013-07-053-10/+12
| | | | | | SmallVector size when creating iterators for the DenseMap. llvm-svn: 185682
* Fixed typo: NoneComment -> NonComment, no other changes.Alexander Kornienko2013-07-043-26/+26
| | | | llvm-svn: 185640
* Added AlwaysBreakBeforeMultilineStrings option.Alexander Kornienko2013-07-042-0/+11
| | | | | | | | | | | | | | | | | Summary: Always breaking before multiline strings can help format complex expressions containing multiline strings more consistently, and avoid consuming too much horizontal space. Reviewers: djasper Reviewed By: djasper CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D1097 llvm-svn: 185622
* Add a space between closing template '>' to unbreak build.Craig Topper2013-07-041-1/+1
| | | | llvm-svn: 185611
* Use SmallVectorImpl instead of SmallVector for iterators and references to ↵Craig Topper2013-07-0420-57/+57
| | | | | | avoid specifying the vector size unnecessarily. llvm-svn: 185610
* [analyzer] Suppress reports reported in std::listAnna Zaks2013-07-041-8/+23
| | | | | | | | | | | The motivation is to suppresses false use-after-free reports that occur when calling std::list::pop_front() or std::list::pop_back() twice. The analyzer does not reason about the internal invariants of the list implementation, so just do not report any of warnings in std::list. Fixes radar://14317928. llvm-svn: 185609
* [analyzer] Make sure that inlined defensive checks work on div by zero.Anna Zaks2013-07-041-5/+9
| | | | | | | This suppresses a false positive in std::hash_map. Fixes radar://14255587. llvm-svn: 185608
* Part of PR15673: If a function template has a default argument in whichRichard Smith2013-07-042-5/+14
| | | | | | | | | substitution failed, report that as a substitution failure rather than pretending that there was no default argument. The test cases in PR15673 have exposed some pre-existing poor diagnostics here. llvm-svn: 185604
* Improve -Wlogical-not-parentheses to catch when the not is applied to an enum.Richard Trieu2013-07-041-1/+1
| | | | llvm-svn: 185602
* [ObjectiveC migrator] relax the rules for setter/getterFariborz Jahanian2013-07-041-3/+8
| | | | | | | types when deciding on validity of a property inclusion. // rdar://14345082 llvm-svn: 185599
* PR16480: Reimplement token-caching for constructor initializer lists. ThisRichard Smith2013-07-041-59/+147
| | | | | | | | | | | | | | | previously didn't work if a mem-initializer-id had a template argument which contained parentheses or braces. We now implement a simple rule: just look for a ') {' or '} {' that is not nested. The '{' is assumed to start the function-body. There are still two cases which we misparse, where the ') {' comes from a compound literal or from a lambda. The former case is not valid C++, and the latter will probably not be valid C++ once DR1607 is resolved, so these seem to be of low value, and we do not regress on them with this change. EDG and g++ also misparse both of these cases. llvm-svn: 185598
* Minor refactoring of my last patch.Fariborz Jahanian2013-07-031-22/+20
| | | | llvm-svn: 185593
* [ObjectiveC Migration]: Provide knobs for Fariborz Jahanian2013-07-031-2/+49
| | | | | | | | migrating setter/getter methods to an eventual property declaraiton. This is wip. // rdar://14345082 llvm-svn: 185591
* Check LongDoubleFormat instead of just Width as this is PowerPC specific.Roman Divacky2013-07-031-1/+2
| | | | llvm-svn: 185584
* [PowerPC] FreeBSD does not require f128 in its data layout string.Bill Schmidt2013-07-031-1/+1
| | | | | | Long double is 64 bits on FreeBSD PPC, so the f128 entry is superfluous. llvm-svn: 185582
* "bool" should be a context-sensitive keyword in Altivec mode.Bill Schmidt2013-07-033-0/+27
| | | | | | | | | | | | | | | | | PR16456 reported that Clang implements a hybrid between AltiVec's "Keyword and Predefine Method" and its "Context Sensitive Keyword Method," where "bool" is always a keyword, but "vector" and "pixel" are context-sensitive keywords. This isn't permitted by the AltiVec spec. For consistency with gcc, this patch implements the Context Sensitive Keyword Method for bool, and stops treating true and false as keywords in Altivec mode. The patch removes KEYALTIVEC as a trigger for defining these keywords in include/clang/Basic/TokenKinds.def, and adds logic for "vector bool" that mirrors the existing logic for "vector pixel." The test case is taken from the bug report. llvm-svn: 185580
* Add support for TF/TC modes available on eg. PowerPC64.Roman Divacky2013-07-031-5/+8
| | | | llvm-svn: 185578
* Dont define __LONG_DOUBLE_128__ unless LongDoubleWidth is really 128bits width.Roman Divacky2013-07-031-1/+2
| | | | | | It's not the case on ie. FreeBSD. llvm-svn: 185572
* Add target hook CodeGen queries when generating builtin pow*.Eli Bendersky2013-07-033-7/+20
| | | | | | | | | | | Without fmath-errno, Clang currently generates calls to @llvm.pow.* intrinsics when it sees pow*(). This may not be suitable for all targets (for example le32/PNaCl), so the attached patch adds a target hook that CodeGen queries. The target can state its preference for having or not having the intrinsic generated. Non-PNaCl behavior remains unchanged; PNaCl-specific test added. llvm-svn: 185568
* With CLANG_ENABLE_STATIC_ANALYZER=0, link clang properly and skip clang-check.Jordan Rose2013-07-031-3/+8
| | | | | | | | | | | | | | | Previously, the CMake build still tried to link clang against the static analyzer libraries, even if CLANG_ENABLE_STATIC_ANALYZER was off. Furthermore, clang-check depends on the analyzer, so it should be disabled (in both CMake and configure builds). In theory, clang-check could be made to conditionally include analyzer support (like clang itself), but for now this at least gets a CMake ALL_BUILD working. Patch by Stephen Kelly, modified by me. llvm-svn: 185548
* Fix PR16454: Don't #include altivec.h when preprocessing assembly.Bill Schmidt2013-07-031-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the -maltivec flag is present, altivec.h is auto-included for the compilation. This is not appropriate when the job action is to preprocess a file containing assembly code. So don't do that. I was unable to convert the test in the bug report into a regression test. The original symptom was exposed with: % touch x.S % ./bin/clang -target powerpc64-unknown-linux-gnu -maltivec -S -o - x.S I tried this test (and numerous variants) on a PPC64 system: ---------------------------------------------------------------------------- // RUN: touch %t // RUN: %clang -maltivec -S %t -o - | FileCheck %s // Verify that assembling an empty file does not auto-include altivec.h. // CHECK-NOT: static vector ---------------------------------------------------------------------------- However, this test passes for some reason even on a clang built without the fix. I'd be happy to add a test case but at this point I'm not able to figure one out, and I don't want to hold up the patch unnecessarily. Please let me know if you have ideas. Thanks, Bill llvm-svn: 185544
* We don't need to know the OpenSUSE version, so don't parse it.Rafael Espindola2013-07-031-19/+11
| | | | | | Patch by Johannes Obermayr. llvm-svn: 185537
* Don't insert confusing line breaks in comparisons.Daniel Jasper2013-07-031-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In general, clang-format breaks after an operator if the LHS spans multiple lines. Otherwise, this can lead to confusing effects and effectively hide the operator precendence, e.g. in if (aaaaaaaaaaaaaa == bbbbbbbbbbbbbb && c) { ... This patch removes this rule for comparisons, if the LHS is not a binary expression itself as many users were wondering why clang-format inserts an unnecessary linebreak. Before: if (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) > 5) { ... After: if (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) > 5) { ... In the long run, we might: - Want to do this for other binary expressions as well. - Do this only if the RHS is short or even only if it is a literal. llvm-svn: 185530
* [analyzer] Improve handling of noreturn destructorsPavel Labath2013-07-031-13/+11
| | | | | | | | | | | | | | | | Summary: The analyzer incorrectly handled noreturn destructors which were hidden inside function calls. This happened because NoReturnFunctionChecker only listened for PostStmt events, which are not executed for destructor calls. I've changed it to listen to PostCall events, which should catch both cases. Reviewers: jordan_rose CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1056 llvm-svn: 185522
* Allow typo correction to try removing nested name specifiers.Kaelyn Uhrain2013-07-027-31/+72
| | | | | | | | | | | | | | | | | The removal is tried by retrying the failed lookup of a correction candidate with either the MemberContext or SS (CXXScopeSpecifier) or both set to NULL if they weren't already. If the candidate identifier is then looked up successfully, make a note in the candidate that the SourceRange should include any existing nested name specifier even if the candidate isn't adding a different one (i.e. the candidate has a NULL NestedNameSpecifier). Also tweak the diagnostic messages to differentiate between a suggestion that just replaces the identifer but leaves the existing nested name specifier intact and one that replaces the entire qualified identifier, in cases where the suggested replacement is unqualified. llvm-svn: 185487
* Look for corrections in enclosing namespaces that require a global ↵Kaelyn Uhrain2013-07-021-13/+13
| | | | | | | | | | | | | | NestedNameSpecifier. CorrectTypo will now see and consider those corrections that are effectively shadowed by other declarations in a closer context when resolved via an unqualified lookup. This involves adding any parent namespaces to the set of namespaces as fully-qualified name specifiers, and also adding potential corrections that passed name lookup but were rejected by the given CorrectionCandidateCallback into the set of failed corrections that should be tried with the set of namespace specifiers. llvm-svn: 185486
* Debug Info: set default to gdwarf-2 for Darwin.Manman Ren2013-07-021-2/+7
| | | | | | | | | | | | Darwin systems currently do not support dwarf version 3 or above. When we are ready, we can bump the default to gdwarf-4 for Darwin. For other systems, the default is dwarf version 3, if everything goes smoothly, we can bump the version to 4. rdar://13591116 llvm-svn: 185483
* Debug Info: clean up usage of Verify.Manman Ren2013-07-021-14/+14
| | | | | | | No functionality change. It should suffice to check the type of a debug info metadata, instead of calling Verify. llvm-svn: 185463
* [ms-cxxabi] Mangle variadic template parameter packsReid Kleckner2013-07-021-35/+49
| | | | | | | | | | | | | | Unlike Itanium, there is no code to indicate the beginning of a parameter pack. I tested this with MSVC 2013, which is the only version that implements variadic templates so far. This is needed to compile APInt.cpp for the MS C++ ABI. Reviewers: timurrrr Differential Revision: http://llvm-reviews.chandlerc.com/D1077 llvm-svn: 185454
* More fixes for block mangling.Eli Friedman2013-07-021-44/+77
| | | | | | | | | | | | Make sure we properly treat names defined inside a block as local names. There are basically three fixes here. One, correctly treat blocks as a context where we need to use local-name mangling using the new isLocalContainerContext helper. Two, make CXXNameMangler::manglePrefix handle local names in a consistent way. Three, extend CXXNameMangler::mangleLocalName so it can mangle a block correctly. llvm-svn: 185450
* Fix to PR15826 - clang hits assert in clang::ASTContext::getASTRecordLayout.Serge Pavlov2013-07-021-1/+2
| | | | llvm-svn: 185446
* [analyzer] Pointers-to-members are (currently) Locs, not NonLocs.Jordan Rose2013-07-021-1/+1
| | | | | | | | | | While we don't model pointers-to-members besides "null" and "non-null", we were using Loc symbols for valid pointers and NonLoc integers for the null case. This hit the assert committed in r185401. Fixed by using a true (Loc) null for null member pointers. llvm-svn: 185444
* Suppress "control reaches end of non-void function" warning when compiling ↵Andy Gibbs2013-07-021-0/+2
| | | | | | with gcc. llvm-svn: 185439
* Simplify getting CXXRecordDecl from a base iteratorTimur Iskhodzhanov2013-07-021-21/+11
| | | | llvm-svn: 185438
* Fix formatting of long declarations with const type.Daniel Jasper2013-07-021-7/+28
| | | | | | | | | | | Before (exceeding the column limit): LoooooooooooooooooooooooooooooooooooooooongType const LoooooooooooooooooooooooooooooooooooooooongVariable; After: LoooooooooooooooooooooooooooooooooooooooongType const LoooooooooooooooooooooooooooooooooooooooongVariable; llvm-svn: 185418
* Teach static analyzer about AttributedStmtsPavel Labath2013-07-021-1/+1
| | | | | | | | | | | | | | | Summary: Static analyzer used to abort when encountering AttributedStmts, because it asserted that the statements should not appear in the CFG. This is however not the case, since at least the clang::fallthrough annotation makes it through. This commit simply makes the analyzer ignore the statement attributes. CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1030 llvm-svn: 185417
* Don't skip lambdas when mangling local vars.Eli Friedman2013-07-021-18/+18
| | | | | | | | This commit rearranges the logic in CXXNameMangler::mangleLocalName and GetLocalClassDecl so that it doesn't accidentally skip over lambdas. It also reduces code duplication a bit. llvm-svn: 185402
* [analyzer] Explicitly disallow mixed Loc-NonLoc comparisons.Jordan Rose2013-07-021-22/+3
| | | | | | | | | The one bit of code that was using this is gone, and neither C nor C++ actually allows this. Add an assertion and remove dead code. Found by Matthew Dempsky! llvm-svn: 185401
* Simplify code in mangler.Eli Friedman2013-07-011-6/+2
| | | | llvm-svn: 185384
* Simplify linkage code for static local vars.Eli Friedman2013-07-013-55/+4
| | | | | | | | | The key insight here is that weak linkage for a static local variable should always mean linkonce_odr, because every file that needs it will generate a definition. We don't actually care about the precise linkage of the parent context. I feel a bit silly that I didn't realize this before. llvm-svn: 185381
* Fix CMakeLists.txt.Eli Friedman2013-07-011-1/+1
| | | | | | Sorry about that. llvm-svn: 185374
OpenPOWER on IntegriCloud