summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Preprocessor: improve ACLE 6.4.1, 6.4.2 supportSaleem Abdulrasool2014-06-151-7/+42
| | | | | | | | | | | | | | | | | | This improves conformance with ACLE 6.4.1. Define additional macros that indicate support for the ARM and Thumb instruction set architecture. This includes the following set of macros: __ARM_ARCH __ARM_ARCH_ISA_ARM __ARM_ARCH_ISA_THUMB __ARM_32BIT_STATE These help identify the environment that the code is intended to execute on. Adjust the handling for ACLE 6.4.2 to be more correct. We would define the profile as a free-standing token rather than a quoted single character. llvm-svn: 210991
* One of our buildbot for FreeBSD does not support std::to_string.Sylvestre Ledru2014-06-141-6/+8
| | | | | | Use stringstream instead to convert int to string llvm-svn: 210972
* List the function/method name in the index page of scan-buildSylvestre Ledru2014-06-141-0/+4
| | | | llvm-svn: 210971
* With the option '-analyzer-config stable-report-filename=true',Sylvestre Ledru2014-06-142-16/+76
| | | | | | | | instead of report-XXXXXX.html, scan-build/clang analyzer generate report-<filename>-<function, method name>-<function position>-<id>.html. (id = i++ for several issues found in the same function/method) llvm-svn: 210970
* Fix a crash in Retain Count checker error reportingAnna Zaks2014-06-132-5/+22
| | | | | | | | | Fixes a crash in Retain Count checker error reporting logic by handing the allocation statement retrieval from a BlockEdge program point. Also added a simple CFG dump routine for debugging. llvm-svn: 210960
* A non-trivial array-fill expression isn't necessarily a CXXConstructExpr. ItRichard Smith2014-06-131-6/+24
| | | | | | | could be an InitListExpr that runs constructors in C++11 onwards. Fixes a recent regression (introduced in r210091). llvm-svn: 210954
* Add support for the /EP argument to clang-clHans Wennborg2014-06-132-1/+8
| | | | | | | | | | This maps the /EP argument to both -E and -P. Patch by Ehsan Akhgari! Differential Reviion: http://reviews.llvm.org/D4133 llvm-svn: 210935
* Atomics: emit "cmpxchg weak" where possibleTim Northover2014-06-131-26/+60
| | | | | | | | | | | | | | | | | | Most builtins date from before the "cmpxchg weak" was a gleam in the C++ committee's eye, so fortunately not much needs to change. But a few of them *do* acknowledge that failure is possible. For these, we'll emit the usual cartesian product of cmpxchg operations if we can't statically determine weakness. CodeGen can sort it out later if the function gets inlined. The only other non-trivial aspect of this is (I think) that we emit the scalar expression for "IsWeak" once, at the beginning, and propagate its value through the successive blocks. There's not much in it, but it's slightly more consistent with the existing handling of FailureOrder. llvm-svn: 210932
* [PPC64LE] Run some existing Altivec tests on powerpc64le as wellBill Schmidt2014-06-131-1/+1
| | | | | | | | | | | There are several Altivec tests that formerly ran only on big-endian targets (and in some cases only on 32-bit targets). It is useful to verify these on little-endian targets as well. While testing these, I discovered a typo in <altivec.h>. This is also fixed by this patch. llvm-svn: 210928
* Adds a Pragma spelling for attributes to tablegen and makes use of it for loopTyler Nowicki2014-06-132-16/+3
| | | | | | | | | hint attributes. Includes tests for pragma printing and for attribute order which is incorrectly reversed by ParsedAttributes. Reviewed by Aaron Ballman llvm-svn: 210925
* Remove top-level Clang -fsanitize= flags for optional ASan features.Alexey Samsonov2014-06-133-23/+2
| | | | | | | | | | | | | Init-order and use-after-return modes can currently be enabled by runtime flags. use-after-scope mode is not really working at the moment. The only problem I see is that users won't be able to disable extra instrumentation for init-order and use-after-scope by a top-level Clang flag. But this instrumentation was implicitly enabled for quite a while and we didn't hear from users hurt by it. llvm-svn: 210924
* Update for llvm api change.Rafael Espindola2014-06-132-13/+15
| | | | llvm-svn: 210921
* First commit. Modified FIXME comment.Tyler Nowicki2014-06-131-2/+2
| | | | llvm-svn: 210918
* IR-change: cmpxchg operations now return { iN, i1 }.Tim Northover2014-06-133-13/+16
| | | | | | | | This is a minimal fix for clang. I'll soon add support for generating weak variants when requested, but that's not really necessary for the LLVM change in isolation. llvm-svn: 210907
* Do not store duplicate parents when memoization data is available.Samuel Benzaquen2014-06-131-14/+25
| | | | | | | | | | | | | | Summary: Do not store duplicate parents when memoization data is available. This does not solve the duplication problem, but ameliorates it. Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D4124 llvm-svn: 210902
* clang-format: [JS] Understand named function literals.Daniel Jasper2014-06-131-0/+5
| | | | | | | | | | | | | | | | | | | Before: return {a: function SomeFunction(){// ... return 1; } } ; After: return { a: function SomeFunction() { // ... return 1; } }; llvm-svn: 210887
* MS ABI: Fix inheritance model calculation in CRTPDavid Majnemer2014-06-133-3/+11
| | | | | | | | | | | | | | | | | CRTP-like patterns involve a class which inherits from another class using itself as a template parameter. However, the base class itself may try to create a pointer-to-member which involves the derived class. This is problematic because we may not have finished parsing the most derived classes' base specifiers yet. It turns out that MSVC simply uses the unspecified inheritance model instead of doing anything fancy. This fixes PR19987. llvm-svn: 210886
* Use dwarf-2 by default on OpenBSD and FreeBSD.Brad Smith2014-06-131-4/+8
| | | | | | | The Tools.cpp part of the patch partially based on a patch from FreeBSD's LLVM tree. llvm-svn: 210883
* Extend AST dump to include 'used' and 'referenced' flags, and put 'invalid' ↵Richard Smith2014-06-131-3/+6
| | | | | | flag in the right place. llvm-svn: 210872
* Recover from missing 'typename' in sizeof(T::InnerType)Reid Kleckner2014-06-124-37/+99
| | | | | | | | | | | | | | | | | | | | | | Summary: 'sizeof' is a UnaryExprOrTypeTrait, and it can contain either a type or an expression. This change threads a RecoveryTSI parameter through the layers between TransformUnaryExprOrTypeTrait the point at which we look up the type. If lookup finds a single type result after instantiation, we now build TypeSourceInfo for it just like a normal transformation would. This fixes the last error in the hello world ATL app that I've been working with, and it now links and runs with clang. Please try it and file bugs! Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4108 llvm-svn: 210855
* Check the access of operator delete from the destructor contextReid Kleckner2014-06-121-1/+3
| | | | | | | | | | | | Previously we would do the access check from the context of MarkVTableUsed. Also update this test to C++11, since that is typically used with the MS C++ ABI. Fixes PR20005. llvm-svn: 210850
* Prefix another use of error_code.Rafael Espindola2014-06-121-1/+1
| | | | llvm-svn: 210832
* Objective-C ARC. Blocks that strongly capture themselvesFariborz Jahanian2014-06-121-3/+20
| | | | | | | | | | | to call themselves will get the warning: "Capturing <itself> strongly in this block is likely to lead to a retain cycle". Cut down on the amount of noise by noticing that user at some point sets the captured variable to null in order to release it (and break the cycle). // rdar://16944538 llvm-svn: 210823
* Refer to error_code with the std prefix.Rafael Espindola2014-06-123-41/+43
| | | | llvm-svn: 210817
* MS ABI: Fix forming pointers to members of a base classReid Kleckner2014-06-121-30/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously we would calculate the inheritance model of a class when requiring a pointer to member type of that class to be complete. The inheritance model is used to figure out how many fields are used by the member pointer. However, once we require a pointer to member of a derived class type to be complete, we can form pointers to members of bases without calculating the inheritance model for those bases. This was causing crashes on this simple test case: struct A { void f(); void f(int); }; struct B : public A {}; void g() { void (B::*a)() = &B::f; } Now we calculate the inheritance models of all base classes when completing a member pointer type. Fixes PR2007. llvm-svn: 210813
* Permit -Wswitch coverage for enumerations.Saleem Abdulrasool2014-06-122-2/+2
| | | | | | | | Thanks to David Blakie and Richard Smith for pointing out that we can retain the -Wswitch coverage while avoiding the warning from GCC by pushing the unreachable outside of the switch! llvm-svn: 210812
* Basic: fix warnings from GCCSaleem Abdulrasool2014-06-122-0/+2
| | | | | | | | | | | | tools/clang/lib/Basic/DiagnosticIDs.cpp: In function ‘clang::DiagnosticIDs::Level toLevel(clang::diag::Severity)’: tools/clang/lib/Basic/DiagnosticIDs.cpp:382:1: warning: control reaches end of non-void function [-Wreturn-type] tools/clang/lib/Format/Format.cpp: In member function ‘virtual std::string clang::format::ParseErrorCategory::message(int) const’: tools/clang/lib/Format/Format.cpp:282:1: warning: control reaches end of non-void function [-Wreturn-type] Add a default cases that asserts that we handle the severity, parse error. llvm-svn: 210804
* Include system_error directly.Rafael Espindola2014-06-1211-12/+11
| | | | llvm-svn: 210802
* Objective-C. Use isObjCRetainableType in my lastFariborz Jahanian2014-06-121-5/+3
| | | | | | patch. NFC. llvm-svn: 210795
* Explicitly initialize all fields to avoid -Wmissing-field-initializers warning.Eli Bendersky2014-06-121-5/+6
| | | | llvm-svn: 210791
* Replace llvm::error_code with std::error_code.Rafael Espindola2014-06-1221-57/+56
| | | | llvm-svn: 210780
* DiagnosticsEngine: update severity setters to new terminologyAlp Toker2014-06-125-21/+18
| | | | llvm-svn: 210764
* Complete the switch from mappings to declarative diagnostic severitiesAlp Toker2014-06-128-80/+84
| | | | | | | | | This begins to address cognitive dissonance caused by treating the Note diagnostic level as a severity in the diagnostic engine. No change in functionality. llvm-svn: 210758
* Use StringRef to simplify code. No functional change.Craig Topper2014-06-123-24/+20
| | | | llvm-svn: 210751
* Use ArrayRef in some function parameters instead of a pointer and count. No ↵Craig Topper2014-06-123-25/+19
| | | | | | functional change. llvm-svn: 210750
* Add a std:: prefix in cases where ADL would have failed on windows.Rafael Espindola2014-06-121-8/+8
| | | | | | This is in preparation for removing make_error_code from the llvm namespace. llvm-svn: 210745
* Fix typo.Rafael Espindola2014-06-121-2/+2
| | | | | | Thanks to Alp Toker for noticing. llvm-svn: 210744
* Give clang-format its own error category.Rafael Espindola2014-06-121-6/+29
| | | | | | | | | The posix errno values are probably to the best thing to use for describing parse errors. This should also fix the mingw build. llvm-svn: 210739
* Driver: use more range-based for loopsSaleem Abdulrasool2014-06-121-145/+67
| | | | | | | Mechanical change converting some of the simpler for loops into range-based for loops. NFC. llvm-svn: 210738
* Use generic_category from the std namespace.Rafael Espindola2014-06-121-1/+1
| | | | llvm-svn: 210736
* Errno should use generic_category.Rafael Espindola2014-06-121-1/+1
| | | | | | Sorry, no testcase, just noticed while trying to remove llvm's system_error.h llvm-svn: 210727
* PR19966: don't crash/assert when __underlying_type is applied to an incompleteRichard Smith2014-06-121-1/+12
| | | | | | | enumeration type. I've also filed a LWG issue pointing out that this should be ill-formed. llvm-svn: 210723
* Don't inherit dllimport to inline move assignment operatorsHans Wennborg2014-06-111-2/+15
| | | | | | | | | | | | | | Current MSVC versions don't have move assignment operators, so we can't rely on them being available in the dll. If we have the definition, we can just use that directly. This breaks pointer equality, but should work fine otherwise. When there is an MSVC version that supports move assignment, we can key this off the -fmsc-ver option. http://reviews.llvm.org/D4105 llvm-svn: 210715
* Don't slice SemaDiagnosticBuilderReid Kleckner2014-06-111-3/+2
| | | | | | | I wasn't able to figure out how to emit this diagnostic from a SFINAE context, so I don't have a test. llvm-svn: 210713
* Fix the VS2012 build.Hans Wennborg2014-06-111-5/+7
| | | | | | It didn't handle the in-class member initializer and compound literal. llvm-svn: 210707
* Objective-C. Accept '__attribute__((__ns_returns_retained__))' Fariborz Jahanian2014-06-111-1/+12
| | | | | | | for function/methods returning block in MRR mode as well. // rdar://17259812 llvm-svn: 210706
* Add missing "non-constant" diagnostic for a member call on a temporary ofRichard Smith2014-06-111-0/+1
| | | | | | non-literal class type. llvm-svn: 210696
* clang-cl: accept the /C option with /P (PR19978)Hans Wennborg2014-06-111-3/+7
| | | | | | (It's also allowed with /EP, but we haven't implemented that option yet.) llvm-svn: 210695
* Objective-C. More tests for both bridging attributes andFariborz Jahanian2014-06-111-1/+1
| | | | | | | a fix to make it work when CFStructs have no definition. // rdar://17238954. llvm-svn: 210690
* Use std::error_code instead of llvm::error_code.Rafael Espindola2014-06-113-18/+18
| | | | | | This is an update for a llvm api change. llvm-svn: 210688
OpenPOWER on IntegriCloud