summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* Correction to -mfu=neon-vfpv4 to pass the correct backend feature nameRichard Barton2014-12-182-4/+4
| | | | | Change-Id: I4dbfe1d97670fc4e626368ef1f91fc008778dfca llvm-svn: 224523
* Enabling this test again on mingw. The problem seems to happen whenYaron Keren2014-12-181-1/+0
| | | | | | | two identical module.modulemap are available on the include path and so should be fixed in the mingw driver include dies, when we'll have it. llvm-svn: 224515
* clang-format: Fix incorrect detection of ObjC "in" keyword.Daniel Jasper2014-12-182-1/+3
| | | | | | | | | | Before: for (auto v : in [1]) { .. After: for (auto v : in[1]) { .. llvm-svn: 224513
* Fixed warnings on redefine keywords and reserved ids.Serge Pavlov2014-12-188-36/+245
| | | | | | | | | | | | | | | | | | | | | | | | | | | Repared support for warnings -Wkeyword-macro and -Wreserved-id-macro. The warning -Wkeyword-macro now is not issued in patterns that are used in configuration scripts: #define inline also for 'const', 'extern' and 'static'. If macro repalcement is identical to macro name, the warning also is not issued: #define volatile volatile And finally if macro replacement is also a keyword identical to the replaced one but decorated with leading/trailing underscores: #define inline __inline #define inline __inline__ #define inline _inline // in MSVC compatibility mode Warning -Wreserved-id-macro is off by default, it could help catching things like: #undef __cplusplus llvm-svn: 224512
* Parse: Don't parse after the eof has been consumedDavid Majnemer2014-12-183-1/+22
| | | | | | | | | | | | | | ParseCXXNonStaticMemberInitializer stashes away all the tokens for the initializer and an additional EOF token to denote where the initializer ends. However, it is possible for ParseLexedMemberInitializer to get its hands on the "real" EOF token; since the two tokens are indistinguishable, we end up consuming the EOF and descend into madness. Instead, make it possible to tell which EOF token we are looking at. This fixes PR21872. llvm-svn: 224505
* Fix for PR21915: assert on multidimensional VLA in function arguments.Alexey Bataev2014-12-183-22/+59
| | | | | | | Fixed assertion on type checking for arguments and parameters on function call if arguments are pointers to VLA Differential Revision: http://reviews.llvm.org/D6655 llvm-svn: 224504
* Change -save-temps to emit unoptimized bitcode files.Bob Wilson2014-12-1814-62/+140
| | | | | | | | | | | | | | | | | | | It is often convenient to use -save-temps to collect the intermediate results of a compilation, e.g., when triaging a bug report. Besides the temporary files for preprocessed source and assembly code, this adds the unoptimized bitcode files as well. This adds a new BackendJobAction, which is mostly mechanical, to run after the CompileJobAction. When not using -save-temps, the BackendJobAction is combined into one job with the CompileJobAction, similar to the way the integrated assembler is handled. I've implemented this entirely as a driver change, so under the hood, it is just using -disable-llvm-optzns to get the unoptimized bitcode. Based in part on a patch by Steven Wu. rdar://problem/18909437 llvm-svn: 224503
* Update for llvm front end change and use the TargetOptions structEric Christopher2014-12-182-5/+1
| | | | | | for ABI. llvm-svn: 224493
* Make sure that arm-linux-gnu is still the apcs-gnu ABI when weEric Christopher2014-12-183-13/+16
| | | | | | | | | | | | use clang -cc1 matching the front end and backend. Fix up a couple of tests that were testing aapcs for arm-linux-gnu. The test that removes the aapcs abi calling convention removes them because the default triple matches what the backend uses for the calling convention there and so it doesn't need to be explicitly stated - see the code in TargetInfo.cpp. llvm-svn: 224491
* Reinstate aapcs as the default arm abi.Eric Christopher2014-12-182-8/+9
| | | | llvm-svn: 224490
* CGDebugInfo: Use DIBuilder API for self-referencing DICompositeTypesDuncan P. N. Exon Smith2014-12-182-9/+25
| | | | | | | | | | | Use new `DIBuilder` API from LLVM r224482 to mutate `DICompositeType`s, rather than changing them directly. This allows `DIBuilder` to track otherwise orphaned cycles when `CollectContainingType()` creates a self-reference. Fixes PR21941. llvm-svn: 224483
* Fix diagnostic for static methods referencing fields from using declsReid Kleckner2014-12-182-2/+12
| | | | | | | | | | | | Previously we thought the instance member was a function, not a field, and we'd say something silly like: t.cpp:4:27: error: call to non-static member function without an object argument static int f() { return n; } ^ Noticed in PR21923. llvm-svn: 224480
* [Objective-C]. Modern property getters have side-effects.Fariborz Jahanian2014-12-184-2/+20
| | | | | | | | So, place warning about property getter should not be used for side-effect under its own group so warning can be turned off. rdar://19137815 llvm-svn: 224479
* Fix a function that only calls itself. The const_cast needs to remove theRichard Trieu2014-12-181-1/+1
| | | | | | const so that the other overloaded function will be called. llvm-svn: 224478
* InstrProf: Simplify/reduce state in CoverageMapping (NFC)Justin Bogner2014-12-171-38/+2
| | | | | | | | This state object makes things harder to reason about and isn't really useful, since we can just emit the mappings before the state changes rather than holding on to it. llvm-svn: 224476
* Revert "Put static local variables of inline functions in the function comdat."Rafael Espindola2014-12-172-7/+8
| | | | | | | | | This reverts commit r224369. Thanks to Reid Kleckner for pointing out that we need a bigger gun to fix this case. llvm-svn: 224475
* Don't assume friended C++ method decls have qualifiersReid Kleckner2014-12-172-3/+56
| | | | | | | | | | | There are a few cases where unqualified lookup can find C++ methods. Unfortunately, none of them seem to have illegal access paths, so I can't excercise the diagnostic source range code that I am changing here. Fixes PR21851, which was a crash on valid. llvm-svn: 224471
* Adding a -Wunused-value warning for expressions with side effects used in an ↵Aaron Ballman2014-12-1723-47/+191
| | | | | | unevaluated expression context, such as sizeof(), or decltype(). Also adds a similar warning when the expression passed to typeid() *is* evaluated, since it is equally likely that the user would expect the expression operand to be unevaluated in that case. llvm-svn: 224465
* [sanitizer] allow -fsanitize-coverage=N w/ -fsanitize=leak, clang partKostya Serebryany2014-12-172-2/+3
| | | | llvm-svn: 224462
* [c++1z] Fixes for generalized non-type template argument support: check forRichard Smith2014-12-172-42/+83
| | | | | | | | exact type match for deduced template arguments, and be sure to produce correct canonical TemplateArgument representations to enable correct redeclaration matching. llvm-svn: 224456
* Destroy the diagnostic client first in ~DiagnosticEngineReid Kleckner2014-12-173-0/+13
| | | | | | | | | | | | Add a comment and a test to ~DiagnosticEngine about the ordering requirements on the teardown of DiagnosticConsumer. This could also be accomplished by rearranging the fields of ~DiagnosticEngine, but I felt that this was a better, more explicit solution. This fixes PR21911, an issue that occurred after the unique_ptr migration in r222193. llvm-svn: 224454
* This test does not pass for -target i686-pc-windows-gnu (-mingw32)Yaron Keren2014-12-171-0/+1
| | | | | | | when clang is built with mingw-w64 4.9.1 or according to http://llvm.org/PR20995 , mingw-w64 4.7.2 as well. llvm-svn: 224453
* Don't build invalid AST nodes during recoveryReid Kleckner2014-12-172-2/+13
| | | | | | | | | | | | | | A DependentScopeDeclRefExpr should always have a nested name specifier. During template instantiation, if we found that the named context was incomplete, we would previously build a DependentScopeDeclRefExpr with an empty qualifier. This error recovery path has been asserting for some time. The other error codepaths use ExprError, so we can do the same. Fixes PR21864. llvm-svn: 224451
* Support constant evaluation for member calls on std::initializer_listRichard Smith2014-12-172-0/+6
| | | | | | temporaries. llvm-svn: 224449
* Revert "DebugInfo: Generalize debug info location handling"David Blaikie2014-12-1717-101/+195
| | | | | | | | | Fails an ASan bootstrap - I'll try to reproduce locally & sort that out before recommitting. This reverts commit r224385. llvm-svn: 224441
* Basic: clean up bleeding whitespaceSaleem Abdulrasool2014-12-171-2/+2
| | | | | | Whitespace cleanup. NFC. llvm-svn: 224439
* CodeGen: implement __emit intrinsicSaleem Abdulrasool2014-12-174-0/+49
| | | | | | | | | | | | | | | For MSVC compatibility, add the `__emit' builtin. This is used in the Windows SDK headers, and must therefore be implemented as a builtin rather than an intrinsic. The `__emit' builtin provides a mechanism to emit a 16-bit opcode instruction into the stream. The value must be a compile time constant expression. No guarantees are made about the CPU and memory states after the execution of the instruction. Due to the unchecked nature of the builtin, only support this on Windows on ARM. llvm-svn: 224438
* Revert r224433, r224371 is good enough for now.Joerg Sonnenberger2014-12-171-2/+1
| | | | llvm-svn: 224435
* Rangify for loop, NFC.Yaron Keren2014-12-171-4/+2
| | | | llvm-svn: 224434
* Disable the keyword-as-macro warning for now until the noise level isJoerg Sonnenberger2014-12-171-1/+2
| | | | | | reduced. llvm-svn: 224433
* s/ScheduleKind/SchedKind/ in \param. [-Wdocumentation]NAKAMURA Takumi2014-12-171-1/+1
| | | | llvm-svn: 224431
* Exclude printLineState() in -Asserts. [-Wunused-function]NAKAMURA Takumi2014-12-171-0/+2
| | | | llvm-svn: 224430
* [mips] Always clobber $1 for MIPS inline asm.Toma Tabacu2014-12-175-10/+9
| | | | | | | | | | | | | | | | | | | | Summary: Because GCC doesn't use $1 for code generation, inline assembly code can use $1 without having to add it to the clobbers list. LLVM, on the other hand, does not shy away from using $1, and this can cause conflicts with inline assembly which assumes GCC-like code generation. A solution to this problem is to make Clang automatically clobber $1 for all MIPS inline assembly. This is not the optimal solution, but it seems like a necessary compromise, for now. Reviewers: dsanders Reviewed By: dsanders Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6638 llvm-svn: 224428
* Teach compile_commands.json test that windows-gnu is the new name for mingw32.Yaron Keren2014-12-171-1/+1
| | | | llvm-svn: 224426
* Teach lit.cfg to recognize -windows-gnu in addition to -mingw32.Yaron Keren2014-12-171-2/+2
| | | | llvm-svn: 224421
* clang-format: Fix incorrect calculation of token lenghts.Daniel Jasper2014-12-172-1/+2
| | | | | | This led, e.g. to break JavaScript regex literals too early. llvm-svn: 224419
* Sema: Don't dyn_cast a null pointer in CheckUsingDeclQualifierDavid Majnemer2014-12-172-1/+6
| | | | | | | | | This code was written with the intent that a pointer could be null but we dyn_cast'd it anyway. Change the dyn_cast to a dyn_cast_or_null. This fixes PR21933. llvm-svn: 224411
* Parse: Consume tokens more carefully in CheckForLParenAfterColonColonDavid Majnemer2014-12-172-28/+38
| | | | | | | | | We would consume the lparen even if it wasn't followed by an identifier or a star-identifier pair. This fixes PR21815. llvm-svn: 224403
* Add missing testcase from r224388.Richard Smith2014-12-171-0/+19
| | | | llvm-svn: 224401
* [CallGraph] Make sure the edges are not missed due to re-declarationsAnna Zaks2014-12-172-14/+22
| | | | | | | | | | | | | | A patch by Daniel DeFreez! We were previously dropping edges on re-declarations. Store the canonical declarations in the graph to ensure that different references to the same function end up reflected with the same call graph node. (Note, this might lead to performance fluctuation because call graph is used to determine the function analysis order.) llvm-svn: 224398
* PR21909: Don't try (and crash) to generate debug info for explicit ↵David Blaikie2014-12-162-1/+10
| | | | | | instantiations of explicit specializations. llvm-svn: 224394
* DR1684: a constexpr member function need not be a member of a literal class ↵Richard Smith2014-12-169-612/+1197
| | | | | | type. llvm-svn: 224388
* Try typo correction on all initialization arguments and be lessKaelyn Takata2014-12-162-7/+9
| | | | | | | | | pessimistic about when to do so. This also fixes PR21905 as the initialization argument was no longer viewed as being type dependent due to the TypoExpr being type-cast. llvm-svn: 224386
* DebugInfo: Generalize debug info location handlingDavid Blaikie2014-12-1617-195/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a more scalable (fixed in mostly one place, rather than many places that will need constant improvement/maintenance) solution to several commits I've made recently to increase source fidelity for subexpressions. This resetting had to be done at the DebugLoc level (not the SourceLocation level) to preserve scoping information (if the resetting was done with CGDebugInfo::EmitLocation, it would've caused the tail end of an expression's codegen to end up in a potentially different scope than the start, even though it was at the same source location). The drawback to this is that it might leave CGDebugInfo out of sync. Ideally CGDebugInfo shouldn't have a duplicate sense of the current SourceLocation, but for now it seems it does... - I don't think I'm going to tackle removing that just now. I expect this'll probably cause some more buildbot fallout & I'll investigate that as it comes up. Also these sort of improvements might be starting to show a weakness/bug in LLVM's line table handling: we don't correctly emit is_stmt for statements, we just put it on every line table entry. This means one statement split over multiple lines appears as multiple 'statements' and two statements on one line (without column info) are treated as one statement. I don't think we have any IR representation of statements that would help us distinguish these cases and identify the beginning of each statement - so that might be something we need to add (possibly to the lexical scope chain - a scope for each statement). This does cause some problems for GDB and possibly other DWARF consumers. llvm-svn: 224385
* Look at whether TransformTypos returned a different Expr instead of looking ↵Nick Lewycky2014-12-162-1/+15
| | | | | | | | at the number of uncorrected typos before and after. Correcting one typo may produce an expression with another TypoExpr in it, leading to matching counts even though a typo was corrected. Fixes PR21925! llvm-svn: 224380
* Fix handling of invalid -O options.Rafael Espindola2014-12-163-8/+11
| | | | | | | | We were checking the value after truncating it to a bitfield. Thanks to Yunzhong Gao for noticing it. llvm-svn: 224378
* Fix typo in comment. NFC.Nick Lewycky2014-12-161-1/+1
| | | | llvm-svn: 224377
* Add a new flag, -fspell-checking-limit=<number> to control how many times ↵Nick Lewycky2014-12-1611-463/+389
| | | | | | | | we'll do spell checking. Note that spell checking will change the produced AST, so we don't automatically change this value when someone sets -ferror-limit=. With this, merge test typo-correction-pt2.cpp into typo-correction.cpp. Remove Sema::UnqualifiedTyposCorrected, a cache of corrected typos. It would only cache typo corrections that didn't provide ValidateCandidate of which there were few left, and it had a bug when we had the same identifier spelled wrong twice. See the last two tests in typo-correction.cpp for cases this fires. llvm-svn: 224375
* Move -Wkeyword-macro into -pedantic, remove -Wreserved-id-macro.Nico Weber2014-12-165-71/+21
| | | | | | | | | | | | | | | | | | | As discussed on the post-commit review thread for r224012, -Wkeyword-macro fires mostly on headers trying to set up portable defines and doesn't find much bad stuff in practice. But [macro.names]p2 does disallow defining or undefining keywords, override and final, and alignas, so keep the warning but move it into -pedantic. -Wreserved-id-macro warns on #define __need_size_t which is more or less public api for glibc headers. Since this warning isn't motivated by a standard, remove it. (See also r223114 for a previous follow-up to r224012.) llvm-svn: 224371
* Put static local variables of inline functions in the function comdat.Rafael Espindola2014-12-162-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | The variable (and the GV) is only ever used if the function is. Putting it in the function's comdat make it easier for the linker to discard them. The motivating example is struct S { static const int x; }; // const int S::x = 42; inline const int *f() { static const int y = S::x; return &y; } const int *g() { return f(); } With S::x commented out, _ZZ1fvE1y is a variable with a guard variable that is initialized by f. With S::x present, _ZZ1fvE1y is a constant. llvm-svn: 224369
OpenPOWER on IntegriCloud