summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [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-043-63/+217
| | | | | | | | | | | | | | | 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-037-7/+52
| | | | | | | | | | | | | | | | | 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-032-5/+17
| | | | llvm-svn: 185578
* Update testing cases to check dwarf-2 for Darwin.Manman Ren2013-07-032-14/+49
| | | | llvm-svn: 185577
* Revert r185557 as it was a bit (a lot) premature.Chad Rosier2013-07-031-4/+0
| | | | llvm-svn: 185574
* Dont define __LONG_DOUBLE_128__ unless LongDoubleWidth is really 128bits width.Roman Divacky2013-07-032-1/+4
| | | | | | It's not the case on ie. FreeBSD. llvm-svn: 185572
* Add target hook CodeGen queries when generating builtin pow*.Eli Bendersky2013-07-034-7/+41
| | | | | | | | | | | 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
* Enable -ffreestanding for this test, to avoid #include_next'ing the system'sRichard Smith2013-07-031-2/+2
| | | | | | <stdint.h> (which might not exist or might not work). llvm-svn: 185565
* Provide test case for commit r185544.Bill Schmidt2013-07-031-0/+3
| | | | | | Verify that assembling an empty file does not auto-include altivec.h. llvm-svn: 185563
* Add file suffix for assembler-with-cpp.Eli Friedman2013-07-031-1/+1
| | | | | | | Fixes crash when trying to recover from a crash on an assembler-with-cpp file. (Not sure how to write a testcase.) llvm-svn: 185562
* Chris has agree to take part ownership of the driver.Chad Rosier2013-07-031-1/+5
| | | | llvm-svn: 185557
* [scan-build] Log compiler invocation to stderr, not stdout.Jordan Rose2013-07-031-4/+4
| | | | | | | | | | This is important for preprocessing steps, which may output to stdout. Also, change ENV accesses using barewords to use string keys instead. PR16414 llvm-svn: 185555
* With CLANG_ENABLE_STATIC_ANALYZER=0, link clang properly and skip clang-check.Jordan Rose2013-07-033-5/+16
| | | | | | | | | | | | | | | 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
* Test case for PR7887 - failed with asm("")Serge Pavlov2013-07-031-0/+12
| | | | llvm-svn: 185543
* 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
* Prevent error message when formatting an empty file.Daniel Jasper2013-07-031-0/+2
| | | | | | This fixes llvm.org/PR16514. llvm-svn: 185531
* Don't insert confusing line breaks in comparisons.Daniel Jasper2013-07-032-2/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-032-13/+27
| | | | | | | | | | | | | | | | 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
* Fixed test options.Serge Pavlov2013-07-031-1/+1
| | | | llvm-svn: 185493
* Allow typo correction to try removing nested name specifiers.Kaelyn Uhrain2013-07-0213-60/+113
| | | | | | | | | | | | | | | | | 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-024-17/+32
| | | | | | | | | | | | | | 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-024-5/+16
| | | | | | | | | | | | 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
* Redirect the output of a test to a temporary file to prevent messing upRichard Trieu2013-07-021-1/+1
| | | | | | the test environment. llvm-svn: 185470
* Documentation: Update docs for C++ lambdas to more accurately reflectJames Dennett2013-07-022-17/+28
| | | | | | C++1y init-capture support, and to improve some Doxygen markup. llvm-svn: 185469
* 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-022-35/+72
| | | | | | | | | | | | | | 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
* Add regression test for PR12331.Richard Smith2013-07-021-0/+9
| | | | llvm-svn: 185453
* More fixes for block mangling.Eli Friedman2013-07-025-57/+90
| | | | | | | | | | | | 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-022-1/+21
| | | | llvm-svn: 185446
* [analyzer] Pointers-to-members are (currently) Locs, not NonLocs.Jordan Rose2013-07-022-1/+2
| | | | | | | | | | 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 ranges computed by git clang-format.Daniel Jasper2013-07-021-2/+2
| | | | | | | | | | | | Before, the computed byte range would include the trailing newline. clang-format on the other hand counts whitespace as belonging to the following token, so that git-clang-format inadvertendly reformats the first unmodified line as well. It is not entirely clear whether clang-format's behavior itself should be modified, but for now this seems to be a safe change. llvm-svn: 185423
* Fix formatting of long declarations with const type.Daniel Jasper2013-07-022-7/+33
| | | | | | | | | | | Before (exceeding the column limit): LoooooooooooooooooooooooooooooooooooooooongType const LoooooooooooooooooooooooooooooooooooooooongVariable; After: LoooooooooooooooooooooooooooooooooooooooongType const LoooooooooooooooooooooooooooooooooooooooongVariable; llvm-svn: 185418
* Teach static analyzer about AttributedStmtsPavel Labath2013-07-022-2/+10
| | | | | | | | | | | | | | | 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-023-22/+22
| | | | | | | | 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-014-56/+5
| | | | | | | | | 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
* Fix mangling for block literals.Eli Friedman2013-07-0115-170/+304
| | | | | | | | | | | | | | | Blocks, like lambdas, can be written in contexts which are required to be treated as the same under ODR. Unlike lambdas, it isn't possible to actually take the address of a block, so the mangling of the block itself doesn't matter. However, objects like static variables inside a block do need to be mangled in a consistent way. There are basically three components here. One, block literals need a consistent numbering. Two, objects/types inside a block literal need to be mangled using it. Three, objects/types inside a block literal need to have their linkage computed correctly. llvm-svn: 185372
* Fix MSP430 builtin types.Anton Korobeynikov2013-07-013-13/+13
| | | | | | Patch by Job Noorman! llvm-svn: 185362
* Fix incorrect token counting introduced by r185319.Daniel Jasper2013-07-012-1/+4
| | | | | | | | | | | | This lead to weird formatting. Before: DoSomethingWithVector({ {} /* No data */ }, { { 1, 2 } }); After: DoSomethingWithVector({ {} /* No data */ }, { { 1, 2 } }); llvm-svn: 185346
* Avoid column limit violation in block comments in certain cases.Alexander Kornienko2013-07-012-4/+27
| | | | | | | | | | | | | | | | | Summary: Add penalty when an excessively long line in a block comment can not be broken on a leading whitespace. Lack of this addition can lead to severe column width violations when they can be easily avoided. Reviewers: djasper Reviewed By: djasper CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D1071 llvm-svn: 185337
OpenPOWER on IntegriCloud