summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Teach clang driver about Cortex-A53 and Cortex-A57.Bernard Ogden2013-10-245-3/+12
| | | | | | | | | | | Adds some Cortex-A53 strings where they were missing before. Cortex-A57 is entirely new to clang. Doesn't touch code only used by Darwin, in consequence of which one of the A53 lines has been removed. Change-Id: I5edb58f6eae93947334787e26a8772c736de6483 llvm-svn: 193364
* ObjectiveC IRGen. Replace _objc_empty_vtable pointer in Objective-C Fariborz Jahanian2013-10-242-8/+28
| | | | | | class metadata for certain deployment targets. // rdar://14802916 llvm-svn: 193359
* Revert "Tooling/ReplacementsYaml.h: Prune Tooling's ↵Argyrios Kyrtzidis2013-10-241-0/+12
| | | | | | | | llvm::yaml::ScalarTraits<std::string> corresponding to LLVM r193344." This reverts commit r193350, because it addressed an llvm API change that has been reverted. llvm-svn: 193353
* clang-format: Properly reset nested AnnotatedLine structure.Daniel Jasper2013-10-242-0/+8
| | | | | | | | | | | | | | | | | | | | This fixes llvm.org/PR17682. Without this patch, the following code leads to invalid reads/writes: DEBUG({ return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa; }); #if a #else #endif Because of the #if-#else structure, the code is formatted and annotated twice and becauce of the nested block, the annotated lines form a hierarchical structure. This structure was not properly reset between runs. llvm-svn: 193352
* Replaced duplicate code with calls to forwardInfo.Chris Wailes2013-10-241-27/+17
| | | | | | Also made move constructor handling safer. llvm-svn: 193347
* Tooling/ReplacementsYaml.h: Prune Tooling's ↵NAKAMURA Takumi2013-10-241-12/+0
| | | | | | llvm::yaml::ScalarTraits<std::string> corresponding to LLVM r193344. llvm-svn: 193346
* clang-format: Be more conservative about column layout formatting.Daniel Jasper2013-10-242-7/+17
| | | | | | | | | | | Specifically, if a braced list has at least one nested braced list, format it either all on one line or in one column (i.e. one item per line). This seems in general to be an improvement as the structure of nested braced lists can make a tightly packed outer braced list hard to read. llvm-svn: 193345
* ARM-Darwin: Use the *-*-darwin-eabi triple for v6m & v7m archsTim Northover2013-10-244-5/+27
| | | | | | | These arch arguments are used for embedded targets (obviously) which need a different calling convention to iOS. llvm-svn: 193328
* clang-format: Cleanup array initializer and dict initializer formatting.Daniel Jasper2013-10-245-41/+64
| | | | | | | | Significant changes: - Also recognize these literals with missing "@" for robustness. - Reorganize tests. llvm-svn: 193325
* Teach Clang to accept and ignore -f[no-]implicit-templates.Chandler Carruth2013-10-242-0/+2
| | | | | | | | | | | | | | | | This GCC flag is useful when you want to control whether implicit template instantiation occurs at the commandline level. Clang doesn't currently support such controls, but technically *always* implicitly instantiating (what Clang does, and what every other compiler still in use does by default) is valid behavior even under -fno-implicit-templates, it just may be slow and very wasteful. If people really want this, we can try to implement it, but I don't have an actual use. This should help fix the build of libstdc++ with Clang, its build system uses this flag. llvm-svn: 193319
* Teach Clang to recognize and ignore GCC's -fdiagnostics-show-locationChandler Carruth2013-10-242-0/+5
| | | | | | | | | flag. We should probably wire at least some variants of this up to our actual diagnostics engine, but I'm leaving that for someone else. This fixes the builds of packages which hard code something here, at least including libstdc++ itself. llvm-svn: 193318
* Use the same SourceManager for ModuleMaps and compilations.Manuel Klimek2013-10-2417-85/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows using virtual file mappings on the original SourceManager to map in virtual module.map files. Without this patch, the ModuleMap search will find a module.map file (as the FileEntry exists in the FileManager), but will be unable to get the content from the SourceManager (as ModuleMap previously created its own SourceManager). Two problems needed to be fixed which this patch exposed: 1. Storing the inferred module map When writing out a module, the ASTWriter stores the names of the files in the main source manager; when loading the AST again, the ASTReader errs out if such a file is found missing, unless it is overridden. Previously CompilerInstance's compileModule method would store the inferred module map to a temporary file; the problem with this approach is that now that the module map is handled by the main source manager, the ASTWriter stores the name of the temporary module map as source to the compilation; later, when the module is loaded, the temporary file has already been deleted, which leads to a compilation error. This patch changes the inferred module map to instead inject a virtual file into the source manager. This both saves some disk IO, and works with how the ASTWriter/ASTReader handle overridden source files. 2. Changing test input in test/Modules/Inputs/* Now that the module map file is handled by the main source manager, the VerifyDiagnosticConsumer will not ignore diagnostics created while parsing the module map file. The module test test/Modules/renamed.m uses -I test/Modules/Inputs and triggers recursive loading of all module maps in test/Modules/Inputs, some of which had conflicting names, thus leading errors while parsing the module maps. Those diagnostics already occur on trunk, but before this patch they would not break the test, as they were ignored by the VerifyDiagnosticConsumer. This patch thus changes the module maps that have been recently introduced which broke the invariant of compatible modules maps in test/Modules/Inputs. llvm-svn: 193314
* Remove dead recursive function.Benjamin Kramer2013-10-241-22/+0
| | | | llvm-svn: 193313
* Support GNU attributes in alias-declarations now that GCC has implemented themRichard Smith2013-10-242-4/+12
| | | | | | and we know where they go. llvm-svn: 193297
* Fix a test file option from -emit-llvm -o to -emit-llvm-only.Faisal Vali2013-10-241-1/+1
| | | | | | As requested by Rafael Espindola here: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131021/091556.html llvm-svn: 193296
* PR17666: Instead of allowing an initial identifier argument in any attributeRichard Smith2013-10-249-73/+89
| | | | | | | | | | | | which we don't think can't have one, only allow it in the tiny number of attributes which opts into this weird parse rule. I've manually checked that the handlers for all these attributes can in fact cope with an identifier as the argument. This is still somewhat terrible; we should move more fully towards picking the parsing rules based on the attribute, and make the Parse -> Sema interface more type-safe. llvm-svn: 193295
* Fix an instantiation bug with nested generic lambdas and conversion to fptrs.Faisal Vali2013-10-242-41/+151
| | | | | | | | | | | | | | | | | This patch fixes the typelocs of the conversion-operator and the conversion-operator-name and adds the parameters of the call operator to the FunctionProtoTypeLoc of the respective entities. Thus, when the template declarations (conversion operators) undergo deduction and instantiation/transformation/substitution - they add themselves to the local instantiation scope if needed. This patch supports the following: auto L = [](auto b) { return [](auto a) ->decltype(a) { return a; }; }; int (*fp)(int) = L(8); Richard LGTM'd this patch: http://llvm-reviews.chandlerc.com/D1831 Thanks! llvm-svn: 193294
* Undoing accidental change to docs/LanguageExtensions.rst in my previous Warren Hunt2013-10-241-7/+11
| | | | | | patch. llvm-svn: 193293
* Implements 64 bit microsoft record layout and adds lit tests to cover Warren Hunt2013-10-2313-465/+1545
| | | | | | | | | it. Also removes all of the microsoft C++ ABI related code from the itanium layout builder. Differential Revision: http://llvm-reviews.chandlerc.com/D2003 llvm-svn: 193290
* More wordsmithing on objc_requires_super documentation.Ted Kremenek2013-10-231-7/+11
| | | | llvm-svn: 193288
* Wordsmith text of objc_requires_super.Ted Kremenek2013-10-231-9/+9
| | | | llvm-svn: 193283
* Fix typo.Ted Kremenek2013-10-231-1/+1
| | | | llvm-svn: 193281
* Provide documentation on attribute((objc_requires_super)).Ted Kremenek2013-10-231-0/+39
| | | | llvm-svn: 193278
* Change title of section to reflect the concept, and not the mechanism.Ted Kremenek2013-10-231-2/+3
| | | | llvm-svn: 193277
* Parse: Disable delayed template parsing for constexpr functionsDavid Majnemer2013-10-234-8/+14
| | | | | | | | | | | | | | | Commit r191484 treated constexpr function templates as normal function templates with respect to delaying their parsing. However, this is unnecessarily restrictive because there is no compatibility concern with constexpr, MSVC doesn't support it. Instead, simply disable delayed template parsing for constexpr function templates. This largely reverts the changes made in r191484 but keeps it's unit test. This fixes PR17661. llvm-svn: 193274
* AST: Mangle fields in anonymous structs/unionsDavid Majnemer2013-10-233-4/+15
| | | | | | | | | | | | | The Itanium mangler couldn't cope with mangling an IndirectFieldDecl. Instead, mangle the field the IndirectFieldDecl refers to. Further, give IndirectFieldDecl no linkage just like FieldDecl. N.B. Decl.cpp:getLVForNamespaceScopeDecl tried to calculate linkage for data members of anonymous structs/unions. However, this seems impossible so turn it into an assertion. llvm-svn: 193269
* Intrinsics: fix extract & insert when index is out of bound.Manman Ren2013-10-234-11/+53
| | | | | | | | | Now, all extract & insert intrinsics should have the correct and operation to ignore higher bits. rdar://15250497 llvm-svn: 193267
* [analyzer] Generate a LazyCompoundVal when loading from a union-typed region.Jordan Rose2013-10-232-3/+62
| | | | | | | | | | This ensures that variables accessible through a union are invalidated when the union value is passed to a function. We still don't fully handle union values, but this should at least quiet some false positives. PR16596 llvm-svn: 193265
* A decl never becomes unused. Make that explicit in the API.Rafael Espindola2013-10-234-6/+9
| | | | llvm-svn: 193248
* Refactor out the circular reference to LambdaExpr in CXXRecordDecl.Faisal Vali2013-10-239-77/+161
| | | | | | | | | | | | | | | | | A prior commit of this patch was reverted because it was within the blamelist's purview of a failing test. The failure of that test has been addressed here: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131021/091546.html. Therefore I am recommitting this patch (all tests pass on windows, except for the usual modules & index suspects that never pass on my box). Some background: Both Doug and Richard had asked me in Chicago to remove the circular reference in CXXRecordDecl to LambdaExpr by factoring out and storing the needed information from LambdaExpr directly into CXXRecordDecl. In addition, I have added an IsGenericLambda flag - this makes life a little easier when we implement capturing, and are Sema-analyzing the body of a lambda (and the calloperator hasn't been wired to the closure class yet). Any inner lambdas can have potential captures that could require walking up the scope chain and checking if any generic lambdas are capture-ready. This 'bit' makes some of that checking easier. No change in functionality. This patch was approved by Doug with minor modifications (comments were cleaned up, and all data members were converted from bool/enum to unsigned, as requested): http://llvm-reviews.chandlerc.com/D1856 Thanks! llvm-svn: 193246
* [mips][msa] Add intrinsics that map to pseudo-instructions.Daniel Sanders2013-10-232-0/+11
| | | | | | | | | | | Unlike the previously added intrinsics, these do not map to a single instruction on MIPS32. They are provided for regularity (to round out the .[bhw] variants of the same operation) and compatibility with GCC. Includes: copy_[us].d, fill.d, insert.d, insve.d llvm-svn: 193237
* And Again: Teach TreeTransform how to transform nested generic lambdas.Faisal Vali2013-10-235-54/+653
| | | | | | | | | | | | | | | | | | | | | | | | A previous attempt http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130930/090049.html resulted in PR 17476, and was reverted, The original TransformLambdaExpr (pre generic-lambdas) transformed the TypeSourceInfo of the Call operator in its own instantiation scope via TransformType. This resulted in the parameters of the call operator being mapped to their transformed counterparts in an instantiation scope that would get popped off. Then a call to TransformFunctionParameters would add the parameters and their transformed mappings (but newly created ones!) to the current instantiation scope. This would result in a disconnect between the new call operator's TSI parameters and those used to construct the call operator declaration. This was ok in the non-generic lambda world - but would cause issues with nested transformations (when non-generic and generics were interleaved) in the generic lambda world - that I somewhat kludged around initially - but this resulted in PR17476. The new approach seems cleaner. We only do the transformation of the TypeSourceInfo - but we make sure to do it in the current instantiation scope so we don't lose the untransformed to transformed mappings of the ParmVarDecls when they get created. Another attempt caused a test to fail (http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131021/091533.html) and also had to be reverted - my apologies - in my haste, i did not run all the tests - argh! Now all the tests seem to pass - but a Fixme has been added - since I suspect Richard will find the fix a little inelegant ;) I shall try and work on a more elegant fix once I have had a chance to discuss with Richard or Doug at a later date. Hopefully the third time;s a charm *fingers crossed* This does not yet include capturing. Please see test file for examples. This patch was LGTM'd by Doug: http://llvm-reviews.chandlerc.com/D1784 llvm-svn: 193230
* Revert r193223 and r193216.Rafael Espindola2013-10-2313-797/+132
| | | | | | | | | | They were causing CodeGenCXX/mangle-exprs.cpp to fail. Revert "Remove the circular reference to LambdaExpr in CXXRecordDecl." Revert "Again: Teach TreeTransform and family how to transform generic lambdas nested within templates and themselves." llvm-svn: 193226
* Remove the circular reference to LambdaExpr in CXXRecordDecl.Faisal Vali2013-10-239-77/+161
| | | | | | | | | | | | | | | Both Doug and Richard had asked me to remove the circular reference in CXXRecordDecl to LambdaExpr by factoring out and storing the needed information from LambdaExpr directly into CXXRecordDecl. No change in functionality. In addition, I have added an IsGenericLambda flag - this makes life a little easier when we implement capturing, and are Sema-analyzing the body of a lambda (and the calloperator hasn't been wired to the closure class yet). Any inner lambdas can have potential captures that could require walking up the scope chain and checking if any generic lambdas are capture-ready. This 'bit' makes some of that checking easier. This patch was approved by Doug with minor modifications (comments were cleaned up, and all data members were converted from bool/enum to unsigned, as requested): http://llvm-reviews.chandlerc.com/D1856 Thanks! llvm-svn: 193223
* Make UsingShadowDecls redeclarable. This fixes some visibility problems withRichard Smith2013-10-2311-34/+118
| | | | | | | | | | modules. With this fixed, I no longer see any test regressions in the libc++ test suite when enabling a single-module module.map for libc++ (other than issues with my system headers). llvm-svn: 193219
* Again: Teach TreeTransform and family how to transform generic Faisal Vali2013-10-235-55/+636
| | | | | | | | | | | | | | | | | | | | | lambdas nested within templates and themselves. A previous attempt http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130930/090049.html resulted in PR 17476, and was reverted, The original TransformLambdaExpr (pre generic-lambdas) transformed the TypeSourceInfo of the Call operator in its own instantiation scope via TransformType. This resulted in the parameters of the call operator being mapped to their transformed counterparts in an instantiation scope that would get popped off. Then a call to TransformFunctionParameters would add the parameters and their transformed mappings (but newly created ones!) to the current instantiation scope. This would result in a disconnect between the new call operator's TSI parameters and those used to construct the call operator declaration. This was ok in the non-generic lambda world - but would cause issues with nested transformations (when non-generic and generics were interleaved) in the generic lambda world - that I somewhat kludged around initially - but this resulted in PR17476. The new approach seems cleaner. We only do the transformation of the TypeSourceInfo - but we make sure to do it in the current instantiation scope so we don't lose the untransformed to transformed mappings of the ParmVarDecls when they get created. This does not yet include capturing. Please see test file for examples. This patch was LGTM'd by Doug: http://llvm-reviews.chandlerc.com/D1784 llvm-svn: 193216
* Teach AST dumper to dump the containing module and hidden flag for declarations.Richard Smith2013-10-221-0/+7
| | | | llvm-svn: 193210
* CFG: Properly print delegating initializer CFG elements.Jordan Rose2013-10-222-1/+23
| | | | | | | | ...rather than segfaulting. Patch by Enrico P! llvm-svn: 193208
* Retain previous language linkage of friend function declarationsAlp Toker2013-10-223-3/+38
| | | | | | | | | | | | | | | | | | With this extension, friend function declarations will retain the language linkage specified for previous declarations instead of emitting an error diagnostic. The feature is known to be compatible with GCC and MSVC and permits a language to be specified indirectly where it cannot otherwise be written directly in class scope. Work is ongoing to improve linkage spec diagnostics. Fixes PR17337. Reviewed by Richard Smith. llvm-svn: 193206
* Split -fsanitize=bounds to -fsanitize=array-bounds (for the frontend-insertedRichard Smith2013-10-229-27/+35
| | | | | | | | | | | | | | check using the ubsan runtime) and -fsanitize=local-bounds (for the middle-end check which inserts traps). Remove -fsanitize=local-bounds from -fsanitize=undefined. It does not produce useful diagnostics and has false positives (PR17635), and is not a good compromise position between UBSan's checks and ASan's checks. Map -fbounds-checking to -fsanitize=local-bounds to restore Clang's historical behavior for that flag. llvm-svn: 193205
* Sema: Allow IndirectFieldDecl to appear in a non-type template argumentDavid Majnemer2013-10-222-1/+8
| | | | | | | | | | | We would not identify pointer-to-member construction in a non-type template argument if it was either a FieldDecl or a CXXMethodDecl. However, this would incorrectly reject declarations that were injected via an IndirectFieldDecl (e.g. a field inside of an anonymous union). This fixes PR17657. llvm-svn: 193203
* Consider hidden decls for isUsed checks.Rafael Espindola2013-10-223-2/+20
| | | | | | | | | | | | | | | | | This fixes pr17624. A FIXME from Richard Smith: It seems to me that the root cause is that a per-Decl 'used' flag doesn't really make much sense in the way we use it now. I think we should either track whether that particular declaration is used (with isUsed scanning the entire redecl chain), or we should only have one flag for the entire redeclaration chain (perhaps by always looking at the flag on either the most recent decl or the canonical decl). Modeling it as "is this declaration or any previous declaration used" is weird, and requires contortions like the loop at the end of Sema::MarkFunctionReferenced. llvm-svn: 193202
* Treat aliases as definitions.Rafael Espindola2013-10-228-26/+122
| | | | | | | | | | | | | | This fixes pr17639. Before this patch clang would consider void foo(void) __attribute((alias("__foo"))); a declaration. It now correctly handles it as a definition. Initial patch by Alp Toker. I added support for variables. llvm-svn: 193200
* New fix for pr17535.Rafael Espindola2013-10-224-0/+101
| | | | | | | | | | | | | | | | | | | This is a fixed version of r193161. In order to handle void foo() __attribute__((alias("bar"))); void bar() {} void zed() __attribute__((alias("foo"))); it is not enough to delay aliases to the end of the TU, we have to do two passes over them to find if they are defined or not. This can be implemented by producing alias as we go and just doing the second pass at the end. This has the advantage that other parts of clang that were expecting alias to be processed in order don't have to be changed. This patch also handles cyclic aliases. llvm-svn: 193188
* _mm_extract_epi16: use "& 7" when index is out of bound.Manman Ren2013-10-222-1/+8
| | | | | | | This is in line with implementation of _mm_extract_pi16. rdar://15250497 llvm-svn: 193187
* [analyzer] scan-build: Handle -m* option wildcard after compiler/linker flags.Jordan Rose2013-10-221-4/+5
| | | | | | | | | | Some of the shared compiler/linker flags start with -m, so they've been getting passed to the compiler only since r180073. Now, the -m* wildcard is processed after the shared flags and the ignored flags. Found by Laszlo Nagy! llvm-svn: 193184
* Use GEPs correctly when adjusting this in MicrosoftCXXABITimur Iskhodzhanov2013-10-224-15/+24
| | | | | | Reviewed at http://llvm-reviews.chandlerc.com/D1977 llvm-svn: 193176
* Revert r193073 and the attempt to fix it in r193170.Chandler Carruth2013-10-229-199/+15
| | | | | | | | | | This patch wasn't reviewed, and isn't correctly preserving the behaviors relied upon by QT. I don't have a direct example of fallout, but it should go through the standard code review process. For example, it should never have removed the QT test case that was added when fixing those users. llvm-svn: 193174
* Reenable 'break' in 'for' specifier to allow compilation of QT macro 'foreach'Serge Pavlov2013-10-222-5/+17
| | | | | | | | This is a fix to PR17649, caused by fix in r193073. QT uses 'break' statement to implement their 'foreach' macro. To enable build of QT, this fix reenables break but only in 'for' statement specifier and only in the third expression. llvm-svn: 193170
* clang-format: Fix ObjC literal indentation in Google style.Daniel Jasper2013-10-223-11/+26
| | | | | | | | | | | | | | | | | | | | | | Style guide demands a two-space indent. Before: NSArray *arguments = @[ kind == kUserTicket ? @"--user-store" : @"--system-store", @"--print-tickets", @"--productid", @"com.google.Chrome" ]; After: NSArray *arguments = @[ kind == kUserTicket ? @"--user-store" : @"--system-store", @"--print-tickets", @"--productid", @"com.google.Chrome" ]; llvm-svn: 193168
OpenPOWER on IntegriCloud