summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] Fix test for r182677.Jordan Rose2013-05-241-24/+24
| | | | llvm-svn: 182678
* [analyzer] Treat analyzer-synthesized function bodies like implicit bodies.Jordan Rose2013-05-242-92/+111
| | | | | | | | | | | | | | | | When generating path notes, implicit function bodies are shown at the call site, so that, say, copying a POD type in C++ doesn't jump you to a header file. This is especially important when the synthesized function itself calls another function (or block), in which case we should try to jump the user around as little as possible. By checking whether a called function has a body in the AST, we can tell if the analyzer synthesized the body, and if we should therefore collapse the call down to the call site like a true implicitly-defined function. <rdar://problem/13978414> llvm-svn: 182677
* [analyzer; new edges] Properly set location after exiting an inlined call.Jordan Rose2013-05-241-87/+303
| | | | | | | | | | | | | | | | | The new edge algorithm would keep track of the previous location in each location context, so that it could draw arrows coming in and out of each inlined call. However, it tried to access the location of the call before it was actually set (at the CallEnter node). This only affected unterminated calls at the end of a path; calls with visible exit nodes already had a valid location. This patch ditches the location context map, since we're processing the nodes in order anyway, and just unconditionally updates the PrevLoc variable after popping out of an inlined call. <rdar://problem/13983470> llvm-svn: 182676
* PR16091: Error when attempting to emit debug info for undeduced auto return ↵David Blaikie2013-05-241-0/+7
| | | | | | | | | | | | types Perhaps we should just suppress this, rather than erroring, but since we have the infrastructure for it I figured I'd use it - if this is determined to be not the right thing we should probably remove that infrastructure entirely. I guess it's lying around from the early days of implementing debug info support. llvm-svn: 182673
* [PATCH] Generate cold attribute for functions marked __atribute__((cold))Diego Novillo2013-05-241-1/+1
| | | | | | | | | | | | | This removes a FIXME in CodeGenModule::SetLLVMFunctionAttributesForDefinition. When a function is declared cold we can now generate the IR attribute in addition to marking the function to be optimized for size. I tried adding a separate CHECK in the existing test, but it was failing. I suppose CHECK matches one line exactly once? This would be a problem if the attributes are listed in a different order, though they seem to be sorted. llvm-svn: 182666
* [ms-inline asm] Don't diagnose an empty lookup for inline assmebly. This happenChad Rosier2013-05-241-0/+8
| | | | | | | | | | | | | for labels in inline assembly that aren't in the lookup tables. E.g., __asm { a: jmp a } rdar://13983623 llvm-svn: 182659
* Fix printing CXXTemporaryObjectExpr with default args.Rafael Espindola2013-05-241-0/+5
| | | | | | Patch by Will Wilson. llvm-svn: 182651
* Suffixing #pragma comment(lib) library names with .lib if necessary. This ↵Aaron Ballman2013-05-242-2/+8
| | | | | | matches MSVC behavior, as well as allows us to properly link libraries such as the ones provided by the MSDN examples. llvm-svn: 182647
* Add -lrt to sanitizer link arguments.Evgeniy Stepanov2013-05-241-0/+4
| | | | | | | | Sanitizer runtime intercepts functions from librt. Not doing this will fail if the librt dependency is not present at program startup (ex. comes from a dlopen()ed library). llvm-svn: 182645
* User correct case for 'FileCheck'.Argyrios Kyrtzidis2013-05-241-1/+1
| | | | llvm-svn: 182632
* [modules] If we hit a failure while loading a PCH/module, abort parsing ↵Argyrios Kyrtzidis2013-05-241-0/+26
| | | | | | | | | | instead of trying to continue in an invalid state. Also don't let libclang create a PCH with such an error. Fixes rdar://13953768 llvm-svn: 182629
* Fix crash-on-invalid if list-initialization works, but we bail out whenRichard Smith2013-05-231-0/+10
| | | | | | building the resulting expression because it invokes a deleted constructor. llvm-svn: 182624
* Fix assert on temporary std::initializer_list.Richard Smith2013-05-231-0/+10
| | | | llvm-svn: 182615
* [analyzer; alternate edges] Add a new test case file to regression test the ↵Ted Kremenek2013-05-231-0/+9280
| | | | | | | | new arrows algorithm. This essentially combines the tests in plist-output.m and plist-alternate-output.m. llvm-svn: 182612
* Fix bitcode desynchronization when loading a PCH containing a class templateRichard Smith2013-05-232-0/+4
| | | | | | | | | | | specialization with modules enabled. Just don't merge them at all for now; we'll revisit this when support for template merging is added. In passing, make Decl::dump() a little safer to use with PCH/modules, by making it not deserialize any additional declarations. From a debugger you can call decls_begin() or similar first if you want to dump all child decls. llvm-svn: 182544
* PR14772: Support constant expression evaluation for _Atomic types.Richard Smith2013-05-231-0/+25
| | | | | | | | | * Treat _Atomic(T) as a literal type if T is a literal type. * Evaluate expressions of this type properly. * Fix a lurking bug where we built completely bogus ASTs for converting to _Atomic types in C++ in some cases, caught by the tests for this change. llvm-svn: 182541
* Adding in parsing and the start of semantic support for __sptr and __uptr ↵Aaron Ballman2013-05-224-3/+62
| | | | | | | | | | pointer type qualifiers. This patch also fixes the correlated __ptr32 and __ptr64 pointer qualifiers so that they are truly type attributes instead of declaration attributes. For more information about __sptr and __uptr, see MSDN: http://msdn.microsoft.com/en-us/library/aa983399.aspx Patch reviewed by Richard Smith. llvm-svn: 182535
* Bugfix for r181629:Adrian Prantl2013-05-221-1/+2
| | | | | | | | | - The return type should be a pointer to the class type. - Make the condition more specific. rdar://problem/13359718 llvm-svn: 182504
* [analyzer] Don't crash if a block doesn't have a type signature.Jordan Rose2013-05-221-0/+22
| | | | | | | | | | | Currently, blocks instantiated in templates lose their "signature as written"; it's not clear if this is intentional. Change the analyzer's use of BlockDecl::getSignatureAsWritten to check whether or not the signature is actually there. <rdar://problem/13954714> llvm-svn: 182497
* [NVPTX] Add entire list of supported builtinsJustin Holewinski2013-05-221-0/+9
| | | | llvm-svn: 182468
* [analyzer] Do not assert on reports ending in calls within macros.Anna Zaks2013-05-222-12/+698
| | | | | | | | | The crash is triggered by the newly added option (-analyzer-config report-in-main-source-file=true) introduced in r182058. Note, ideally, we’d like to report the issue within the main source file here as well. For now, just do not crash. llvm-svn: 182445
* Fix crash-on-invalid: only use TransformAddressOfOperand when transforming theRichard Smith2013-05-211-0/+10
| | | | | | operand of a unary address-of expression, not for *all* expressions! llvm-svn: 182436
* PR16090: C++1y: treat undeduced 'auto' as a literal type, so that constexprRichard Smith2013-05-211-0/+7
| | | | | | function templates can use it as a return type. llvm-svn: 182433
* PR16094: I should have known Obj-C init-capture disambiguation couldn't beRichard Smith2013-05-211-3/+13
| | | | | | | | | | | | | | | | | | | | | *that* easy... Try a bit harder to disambiguate. This is mostly straightforward, but for =-style initializers, we actually need to know where an expression ends: [foo = bar baz] is a message send, whereas [foo = bar + baz] is a lambda-introducer. Handle this by parsing the expression eagerly, and replacing it with an annotation token. By chance, we use the *exact same* parsing rules in both cases (except that we need to assume we're inside a message send for the parse, to turn off various forms of inapplicable error recovery). llvm-svn: 182432
* Objective-C arc: don't count use of __weakFariborz Jahanian2013-05-211-0/+15
| | | | | | | variables when they are used in such unevaluated contexts as __typeof, etc. // rdar://13942025 llvm-svn: 182423
* Refactor places which perform contextual implicit conversions to go through aRichard Smith2013-05-214-16/+31
| | | | | | | | | | | | | common function. The C++1y contextual implicit conversion rules themselves are not yet implemented, however. This also fixes a subtle bug where template instantiation context notes were dropped for diagnostics coming from conversions for integral constant expressions -- we were implicitly slicing a SemaDiagnosticBuilder into a DiagnosticBuilder when producing these diagnostics, and losing their context notes in the process. llvm-svn: 182406
* Let clang-format move the cursor appropriately.Daniel Jasper2013-05-211-0/+6
| | | | | | | | | With this patch, clang-format will try to keep the cursor at the original code position in editor integrations (implemented for emacs and vim). This means, after formatting, clang-format will try to keep the cursor on the same character of the same token. llvm-svn: 182373
* In -ast-dump, only dump comments when dumping the actual Decl to which theyRichard Smith2013-05-211-0/+16
| | | | | | | | attach, rather than merging all comments on the declaration chain. This gives a more faithful dump, and has the side benefit of unbreaking uses of dump() from within AST deserialization (where the redeclaration chain may not be sane). llvm-svn: 182350
* doc. parsing. HeaderDoc documentaton allows use ofFariborz Jahanian2013-05-201-0/+6
| | | | | | | @class command on an @interface declaration. Turn off the warning for this case. // rdar://13927330 llvm-svn: 182334
* PR14606: Debug Info for namespace aliases/DW_TAG_imported_moduleDavid Blaikie2013-05-201-11/+17
| | | | | | | | | This resolves the last of the PR14606 failures in the GDB 7.5 test suite. (but there are still unresolved issues in the imported_decl case - we need to implement optional/lazy decls for functions & variables like we already do for types) llvm-svn: 182329
* Warn on and drop dllimport attrs from variable definitionsReid Kleckner2013-05-201-0/+5
| | | | | | | AsmPrinter::EmitLinkage() does not handle dllimport linkage. The LLVM verifier should also be fixed to reject this. llvm-svn: 182320
* Objective-C [qoi]: When an class conforms to multipleFariborz Jahanian2013-05-201-0/+48
| | | | | | | | protocols that declare the same property of incompatible types, issue a warning when class implementation synthesizes the property. // rdar://13075400 llvm-svn: 182316
* [ms-cxxabi] Look up operator delete() at every virtual dtor declaration.Peter Collingbourne2013-05-201-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While the C++ standard requires that this lookup take place only at the definition point of a virtual destructor (C++11 [class.dtor]p12), the Microsoft ABI may require the compiler to emit a deleting destructor for any virtual destructor declared in the TU, including ones without a body, requiring an operator delete() lookup for every virtual destructor declaration. The result of the lookup should be the same no matter which declaration is used (except in weird corner cases). This change will cause us to reject some valid TUs in Microsoft ABI mode, e.g.: struct A { void operator delete(void *); }; struct B { void operator delete(void *); }; struct C : A, B { virtual ~C(); }; As Richard points out, every virtual function declared in a TU (including this virtual destructor) is odr-used, so it must be defined in any program which declares it, or the program is ill formed, no diagnostic required. Because we know that any definition of this destructor will cause the lookup to fail, the compiler can choose to issue a diagnostic here. Differential Revision: http://llvm-reviews.chandlerc.com/D822 llvm-svn: 182270
* Add arm_neon.h to the builtin intrinsics module map.Douglas Gregor2013-05-201-0/+6
| | | | | | Fixes <rdar://problem/13933913>. llvm-svn: 182268
* Implement __declspec(selectany) under -fms-extensionsReid Kleckner2013-05-202-0/+38
| | | | | | | | | | | | | | | | selectany only applies to externally visible global variables. It has the effect of making the data weak_odr. The MSDN docs suggest that unused definitions can only be dropped at linktime, so Clang uses weak instead of linkonce. MSVC optimizes away references to constant selectany data, so it must assume that there is only one definition, hence weak_odr. Reviewers: espindola Differential Revision: http://llvm-reviews.chandlerc.com/D814 llvm-svn: 182266
* Fix broken testDouglas Gregor2013-05-201-1/+1
| | | | llvm-svn: 182264
* Add -Wincomplete-module, which detects when a header is included from a ↵Douglas Gregor2013-05-204-0/+12
| | | | | | module but isn't itself part of a module. llvm-svn: 182263
* Revert "Revert "Debug Info: Using declarations/DW_TAG_imported_declaration ↵David Blaikie2013-05-201-13/+43
| | | | | | | | | | | | | | | | | | | | | of variables, types, and functions."" This reverts commit r181947 (git d2990ce56a16050cac0d7937ec9919ff54c6df62 ) This addresses one of the two issues identified in r181947, ensuring that types imported via using declarations only result in a declaration being emitted for the type, not a definition. The second issue (emitting using declarations that are unused) is hopefully an acceptable increase as the real fix for this would be a bit difficult (probably at best we could record which using directives were involved in lookups - but may not have been the result of the lookup). This also ensures that DW_TAG_imported_declarations (& directives) are not emitted in line-tables-only mode as well as ensuring that typedefs only require/emit declarations (rather than definitions) for referenced types. llvm-svn: 182231
* OpenBSD/sparc64 uses long long for int64_t and intmax_t.Jakob Stoklund Olesen2013-05-191-0/+6
| | | | | | Other operating systems, including FreeBSD and NetBSD, use long. llvm-svn: 182215
* Tests and status for core issues 1-50.Richard Smith2013-05-192-0/+515
| | | | llvm-svn: 182207
* Clang-format: allow -style="{yaml/json}" on command lineAlexander Kornienko2013-05-191-0/+23
| | | | | | | | | | | | | | Summary: + improved handling of default style and predefined styles. Reviewers: djasper, klimek Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D813 llvm-svn: 182205
* Fix a logic bug in the handling of -fmath-errno in the driver. We wouldChandler Carruth2013-05-181-8/+26
| | | | | | | | | | | | | | | | | | | | | | | | imply -fno-math-errno if the user passed -fno-fast-math OR -ffast-math, regardless of in which order and regardless of the tool chain default. I've fixed this to follow the logic: 1) If the last dominating flag is -fno-math-errno, -ffast-math, or -Ofast, then do not use math-errno. 2) If the last dominating flag is an explicit -fmath-errno, do use math-errno. 3) Otherwise, use the toolchain default. This, for example, allows the flag sequence '-ffast-math ... -fno-fast-math' with no mention of '-fmath-errno' or '-fno-math-errno' to preserve the toolchain default. Most notably, this should prevent users trying to disable fast-math optimizations on Darwin and BSD platforms from simultaneously enabling (pointless) -fmath-errno. I've enhanced the tests (after more reorganization) to cover this and other weird permutations of flags and targets. llvm-svn: 182203
* Slight reorganization of the fast-math tests which test for errnoChandler Carruth2013-05-181-10/+6
| | | | | | | setting. Consolidate the collection of tests that enable -fmath-errno and share a single CHECK line for simplicity. llvm-svn: 182202
* Handle local enum types too.Rafael Espindola2013-05-181-0/+11
| | | | | | Thanks to John McCall for pointing this out. llvm-svn: 182182
* ObjC Debug Info: Emit the correct method names for accessors forAdrian Prantl2013-05-171-0/+35
| | | | | | | | properties declared in a protocol. rdar://problem/13798000 llvm-svn: 182176
* Thread safety analysis: add two new attributes to the thread safety analysis:DeLesley Hutchins2013-05-172-5/+122
| | | | | | | assert_exclusive_lock and assert_shared_lock. These attributes are used to mark functions that dynamically check (i.e. assert) that a lock is held. llvm-svn: 182170
* Use the awesome CHECK-DAG!Rafael Espindola2013-05-171-8/+7
| | | | llvm-svn: 182167
* [analyzer] Address Jordan's review comments for r182058Anna Zaks2013-05-171-4/+4
| | | | llvm-svn: 182156
* libclang: add a function to check whether a member function is pure virtualDmitri Gribenko2013-05-171-0/+7
| | | | | | Patch by Seth Fowler. llvm-svn: 182139
* Objective-C parsing. Error recovery when category implementationFariborz Jahanian2013-05-171-0/+8
| | | | | | declaration is illegally protocol qualified. // rdar://13920026 llvm-svn: 182136
OpenPOWER on IntegriCloud