summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Set the default hardware division features for ARM cpus. Also set it as ↵Silviu Baranga2013-10-211-2/+17
| | | | | | default for A32 armv8. llvm-svn: 193075
* Add the __ARM_ARCH_EXT_IDIV__ predefine. It is set to 1 if we have hardware ↵Silviu Baranga2013-10-212-0/+39
| | | | | | divide in the mode that we are compiling in (depending on the target features), not defined if we don't. Should be compatible with the GCC conterpart. Also adding a -hwdiv option to overide the default behavior. llvm-svn: 193074
* Fix to PR8880 (clang dies processing a for loop).Serge Pavlov2013-10-213-0/+68
| | | | | | | | | | | | | | | | Due to statement expressions supported as GCC extension, it is possible to put 'break' or 'continue' into a loop/switch statement but outside its body, for example: for ( ; ({ if (first) { first = 0; continue; } 0; }); ) Such usage must be diagnosed as an error, GCC rejects it. To recognize this and similar patterns the flags BreakScope and ContinueScope are temporarily turned off while parsing condition expression. Differential Revision: http://llvm-reviews.chandlerc.com/D1762 llvm-svn: 193073
* Fixes PR17617: Crash on joining short if statements.Manuel Klimek2013-10-211-0/+6
| | | | | | | | Now that we iterate on the formatting multiple times when we have chains of preprocessor branches, we need to correctly reset the token's previous and next pointer for the first / last token. llvm-svn: 193071
* Expose -fmodule-name and -fmodule-map-file as driver options.Daniel Jasper2013-10-211-1/+16
| | | | | Review: http://llvm-reviews.chandlerc.com/D1974 llvm-svn: 193069
* Lex: Don't restrict legal UCNs when preprocessing assemblyJustin Bogner2013-10-211-0/+4
| | | | | | | | | | | | | | | The C and C++ standards disallow using universal character names to refer to some characters, such as basic ascii and control characters, so we reject these sequences in the lexer. However, when the preprocessor isn't being used on C or C++, it doesn't make sense to apply these restrictions. Notably, accepting these characters avoids issues with unicode escapes when GHC uses the compiler as a preprocessor on haskell sources. Fixes rdar://problem/14742289 llvm-svn: 193067
* Sema: Explain our deviation from the standard by referencing the, now open, ↵David Majnemer2013-10-211-0/+2
| | | | | | LWG issue. llvm-svn: 193062
* Implement function type checker for the undefined behavior sanitizer.Peter Collingbourne2013-10-208-6/+95
| | | | | | | | | This uses function prefix data to store function type information at the function pointer. Differential Revision: http://llvm-reviews.chandlerc.com/D1338 llvm-svn: 193058
* Revert r193022 and r193048. They broke the ubsan test suite.Peter Collingbourne2013-10-201-16/+13
| | | | llvm-svn: 193057
* Fix crash in cleanup attr handlingAlp Toker2013-10-202-2/+10
| | | | | | | | | | | ResolveSingleFunctionTemplateSpecialization() returns 0 and doesn't emit diags unless the expression has template-ids, so we must null check the result. Also add a better diag noting which overloads are causing the problem. Reviewed by Aaron Ballman. llvm-svn: 193055
* clang-format: Better understand Lambda poarameters.Daniel Jasper2013-10-201-1/+8
| | | | | | | | | | | | Before: auto PointerBinding = [](const char * S) {}; After: auto PointerBinding = [](const char *S) {}; This fixes llvm.org/PR17618. llvm-svn: 193054
* clang-format: Fix formatting of nested blocks after comment.Daniel Jasper2013-10-201-10/+11
| | | | | | | | | | | | | | | Before: DEBUG({ // Comment that used to confuse clang-format. fdafas(); }); Before: DEBUG({ // Comments are now fine. fdafas(); }); This fixed llvm.org/PR17619. llvm-svn: 193051
* clang-format: Support case ranges.Daniel Jasper2013-10-201-1/+1
| | | | | | | | | | | | | | | | | | | Before (note the missing space before "..." which can lead to compile errors): switch (x) { case 'A'... 'Z': case 1... 5: break; } After: switch (x) { case 'A' ... 'Z': case 1 ... 5: break; } llvm-svn: 193050
* clang-format: Improve formatting of ObjC dict literals.Daniel Jasper2013-10-201-2/+9
| | | | | | | | | | | | | | | | Before: NSDictionary *d = @{ @"nam" : NSUserNam(), @"dte" : [NSDate date], @"processInfo" : [NSProcessInfo processInfo] }; After: NSDictionary *d = @{ @"nam" : NSUserNam(), @"dte" : [NSDate date], @"processInfo" : [NSProcessInfo processInfo] }; llvm-svn: 193049
* Driver: libubsan_cxx depends on libubsan. Preserve the topological ordering, ↵Benjamin Kramer2013-10-201-2/+3
| | | | | | some linkers depend on it. llvm-svn: 193048
* Forgot some references to misspelled enums.Benjamin Kramer2013-10-201-4/+4
| | | | llvm-svn: 193047
* Miscellaneous speling fixes.Benjamin Kramer2013-10-201-1/+1
| | | | llvm-svn: 193046
* Sema: Diagnose global replacement functions declared as inlineDavid Majnemer2013-10-201-0/+7
| | | | | | | | | | | This fixes PR17591. N.B. This actually goes beyond what the standard mandates by requiring the restriction to hold for declarations instead of definitions. This is believed to be a defect in the standard and an LWG issue has been submitted. llvm-svn: 193044
* Simplify some implementations of get*Decl.Rafael Espindola2013-10-194-7/+5
| | | | | | | | | | * NamedDecl and CXXMethodDecl were missing getMostRecentDecl. * The const version can just forward to the non const. * getMostRecentDecl can use cast instead of cast_or_null. This then removes some casts from the callers. llvm-svn: 193039
* Reduce indentation with an early exit.Rafael Espindola2013-10-191-23/+24
| | | | llvm-svn: 193028
* Add isFirstDecl to DecBase too and use it instead of getPreviousDecl() == 0.Rafael Espindola2013-10-193-9/+7
| | | | | | Redeclarable already had a isFirstDecl, but it was missing from DeclBase. llvm-svn: 193027
* Fix typo.Rafael Espindola2013-10-191-1/+1
| | | | llvm-svn: 193026
* Simplify FunctionDecl::getBody.Rafael Espindola2013-10-191-9/+5
| | | | llvm-svn: 193025
* When building ubsan, link in ubsan parts first and sanitizer-common second, toNick Lewycky2013-10-191-12/+14
| | | | | | | pick up the common bits ubsan actually needs. Also remove whole-archive when we aren't trying to re-export the symbols. llvm-svn: 193022
* Allow CorrectTypo to replace CXXScopeSpecifiers that refer to classes.Kaelyn Uhrain2013-10-193-7/+55
| | | | | | | | | | | Now that CorrectTypo knows how to correctly search classes for typo correction candidates, there is no good reason to only replace an existing CXXScopeSpecifier if it refers to a namespace. While the actual enablement was a matter of changing a single comparison, the fallout from enabling the functionality required a lot more code changes (including my two previous commits). llvm-svn: 193020
* Be smarter about deciding to add a leading '::' to aKaelyn Uhrain2013-10-191-22/+49
| | | | | | NestedNameSpecifier that replaces an existing specifier. llvm-svn: 193019
* Merge NamespaceSpecifierSet's AddNamespace and AddRecord as they areKaelyn Uhrain2013-10-191-75/+9
| | | | | | essentially the same. llvm-svn: 193018
* Consumed analysis: fix assert failure.DeLesley Hutchins2013-10-181-8/+20
| | | | llvm-svn: 193010
* clang-cl: diagnose setting asm listing filename with multiple inputsHans Wennborg2013-10-181-1/+12
| | | | llvm-svn: 193006
* Fix crash if a submodule @imports another submodule from the same module. TheRichard Smith2013-10-181-6/+6
| | | | | | | test also adds FIXMEs for a number of places where imports and includes of submodules don't work very well. llvm-svn: 193005
* ObjectiveC. Added support for methods annotated with format_argFariborz Jahanian2013-10-181-0/+21
| | | | | | | attributes when such methods are actually envoked in message expression. // rdar://15242010 llvm-svn: 193003
* Reverted r192992 broke windows and freebsd builds.Ariel J. Bernal2013-10-181-10/+4
| | | | llvm-svn: 192997
* Consumed analysis: assume that non-const reference parameters are initiallyDeLesley Hutchins2013-10-181-13/+21
| | | | | | in the "uknown" state. Patch by chris.wailes@gmail.com. Reviewed by delesley. llvm-svn: 192995
* This patch fixes replacements that are not applied when relative paths areAriel J. Bernal2013-10-181-4/+10
| | | | | | | | | | specified. In particular it makes sure that relative paths for non-virtual files aren't made absolute. Added unittest. llvm-svn: 192992
* Consumed analysis: All the return_typestate parameter to be attached to theDeLesley Hutchins2013-10-181-26/+34
| | | | | | default constructor. Patch by chris.wailes@gmail.com, reviewed by delesley. llvm-svn: 192991
* clang-format: Be more aggressive on incorrect code.Daniel Jasper2013-10-181-4/+1
| | | | | | | | | | | | | | | | Before, clang-format would not adjust leading indents if it found a structural error (e.g. unmatched {}). It seems, however, that clang-format has gotten good enough at parsing the code structure that this hurts in almost all cases. Commonly, while writing code, it is very useful to be able to correclty indent incomplete if statements or for loops. In case this leads to errors that we don't anticipate, we need to find out and fix those. This fixed llvm.org/PR17594. llvm-svn: 192988
* clang-format: Don't force linebreak between return and multiline string.Daniel Jasper2013-10-181-2/+2
| | | | | | | | | | | | | | | This looks ugly and leads to llvm.org/PR17590. Before (with AlwaysBreakBeforeMultilineStrings): return "aaaa" "bbbb"; After: return "aaaa" "bbbb"; llvm-svn: 192984
* Make clang-format slightly more willing to break before trailing annotations.Daniel Jasper2013-10-181-1/+1
| | | | | | | | | | | | | | | | | Specifically, prefer breaking before trailing annotations over breaking before the first parameter. Before: void ffffffffffffffffffffffff( int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) OVERRIDE; After: void ffffffffffffffffffffffff(int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) OVERRIDE; llvm-svn: 192983
* Add another MinGW header include pathHans Wennborg2013-10-181-0/+1
| | | | llvm-svn: 192982
* clang-format: Improve formatting of templated builder-type calls.Daniel Jasper2013-10-181-3/+6
| | | | | | | | | | | | | Before: aaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaa().aaaaaaaaaaaaaaaaa().has< bbbbbbbbbbbbbbbbbbbbb>(); After: aaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaa() .aaaaaaaaaaaaaaaaaaaaaaaaaa() .has<bbbbbbbbbbbbbbbbbbbbb>(); llvm-svn: 192981
* [AArch64] Add support for NEON scalar extract narrow instructions.Chad Rosier2013-10-181-2/+23
| | | | llvm-svn: 192971
* [Mips] Define __mips_fpr and _MIPS_FPSET macros.Simon Atanasyan2013-10-181-1/+11
| | | | llvm-svn: 192969
* clang-format: Make continuation indent width configurable.Daniel Jasper2013-10-182-11/+17
| | | | | | Patch by Kim Gräsman. Thank you! llvm-svn: 192964
* C++ modules: don't lose track of a 'namespace std' that is imported from a ↵Richard Smith2013-10-181-13/+28
| | | | | | module. llvm-svn: 192951
* Basic ODR checking for C++ modules:Richard Smith2013-10-182-4/+72
| | | | | | | | | | | | | | | If we have multiple definitions of the same entity from different modules, we nominate the first definition which we see as being the canonical definition. If we load a declaration from a different definition and we can't find a corresponding declaration in the canonical definition, issue a diagnostic. This is insufficient to prevent things from going horribly wrong in all cases -- we might be in the middle of emitting IR for a function when we trigger some deserialization and discover that it refers to an incoherent piece of the AST, by which point it's probably too late to bail out -- but we'll at least produce a diagnostic. llvm-svn: 192950
* Check "late parsed" friend functions for redefinitionAlp Toker2013-10-181-1/+3
| | | | | | | | | | | | | | | r177003 applied the late parsed template technique to friend functions but omitted the corresponding check for redefinitions. This patch adds the same check already in use for templates to the new code path in order to diagnose and reject invalid redefinitions that were being silently accepted. Fixes PR17324. Reviewed by Richard Smith. llvm-svn: 192948
* Fix missed exception spec checks and crashesAlp Toker2013-10-182-23/+30
| | | | | | | | | | | | | | | | | | | Delayed exception specification checking for defaulted members and virtual destructors are both susceptible to mutation during iteration so we need to swap and process the worklists. This resolves both accepts-invalid and rejects-valid issues and moreover fixes potential invalid memory access as the contents of the vectors change during iteration and recursive template instantiation. Checking can be further delayed where parent classes aren't yet fully defined. This patch adds two assertions at end of TU to ensure no specs are left unchecked as was happenning before the fix, plus a test case from Marshall Clow for the defaulted member crash extracted from the libcxx headers. Reviewed by Richard Smith. llvm-svn: 192947
* Fix 80-column violation.Richard Smith2013-10-181-1/+2
| | | | llvm-svn: 192937
* [-fms-extensions] Permit 'override' in C++98 and 'sealed' as a synonym for ↵David Majnemer2013-10-1811-27/+74
| | | | | | | | | | | | | | 'final' Summary: Some MS headers use these features. Reviewers: rnk, rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1948 llvm-svn: 192936
* Consumed analysis: Add param_typestate attribute, which specifies thatDeLesley Hutchins2013-10-173-15/+114
| | | | | | | function parameters must be in a particular state. Patch by chris.wailes@gmail.com. Reviewed by delesley@google.com. llvm-svn: 192934
OpenPOWER on IntegriCloud