summaryrefslogtreecommitdiff
path: root/include/llvm/Support/Compiler.h
Commit message (Collapse)AuthorAge
* Add a LLVM_NOEXCEPT to Compiler.h.Rafael Espindola2014-06-10
| | | | | | This will be needed for the switch to std::error_code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210581 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[C++11] Do not check __GXX_EXPERIMENTAL_CXX0X__."Rui Ueyama2014-03-27
| | | | | | | This reverts commit r204964 because it disabled "= delete", "constexpr" and "explicit" on GCC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204973 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Do not check __GXX_EXPERIMENTAL_CXX0X__.Rui Ueyama2014-03-27
| | | | | | | | Summary: Checking the experimental flag for C++0x is no longer needed. Differential Revision: http://llvm-reviews.chandlerc.com/D3206 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204964 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replace LLVM_STATIC_ASSERT with static_assert, we now haveChandler Carruth2014-03-02
| | | | | | access to it on all host toolchains. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202642 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Clarify in the Compiler.h support macros and comments (andChandler Carruth2014-03-02
| | | | | | | assert it with an #error) that we require MSVC 2012; MSVC 2010 will no longer suffice. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202631 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Remove LLVM_FINAL and LLVM_OVERRIDE macros now that all their uses ↵Craig Topper2014-03-02
| | | | | | are gone. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202629 91177308-0d34-0410-b5e6-96231b3b80d8
* Add back LLVM_FINAL macro. lld still needs it.Craig Topper2014-03-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202619 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch all uses of LLVM_FINAL to just use 'final', and remove the macro.Craig Topper2014-03-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202618 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Switch all uses of the llvm_move macro to use std::moveChandler Carruth2014-03-02
| | | | | | directly, and remove the macro. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202612 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Expand and eliminate the LLVM_ENUM_INT_TYPE() macroAlp Toker2014-03-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202607 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Remove LLVM_HAS_CXX11_STDLIB now that it is just on.Chandler Carruth2014-03-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202587 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Remove LLVM_HAS_CXX11_TYPETRAITS now that it is a constant dueChandler Carruth2014-03-01
| | | | | | | | | to the build being C++11. There is clearly still plenty of simplification than can be done here by using standard type traits instead of rolling our own in many places. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202586 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Now that we're not using it, remove theChandler Carruth2014-03-01
| | | | | | LLVM_HAS_RVALUE_REFERENCES macro. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202585 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Remove the R-value reference #if usage from the ADT and SupportChandler Carruth2014-03-01
| | | | | | libraries. It is now always 1 in LLVM builds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202580 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Force the other C++11 standard library detection macros to beChandler Carruth2014-03-01
| | | | | | | on unconditionally. Continuing to break down the C++98 support, hopefully without breaking anything. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202579 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Turn off compiler-based detection of R-value references, relyingChandler Carruth2014-03-01
| | | | | | | | on the fact that we now build in C++11 mode with modern compilers. This should flush out any issues. If the build bots are happy with this, I'll GC all the code for coping without R-value references. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202574 91177308-0d34-0410-b5e6-96231b3b80d8
* Unconditionally include msan_interface.h when building with MSan.Evgeniy Stepanov2014-02-20
| | | | | | | | Any version of Clang that does not provide this header is way too old to bootstrap with MSan. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201776 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable override and final C++ keyword in gcc 4.6.Logan Chien2014-02-19
| | | | | | | | | | According to http://gcc.gnu.org/projects/cxx0x.html, override and final keyword was added in gcc 4.7. Thus, we should not use these keywords in gcc 4.6 even when __GXX_EXPERIMENTAL_CXX0X__ is available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201679 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a LLVM_DUMP_METHOD macro.Nico Weber2014-01-03
| | | | | | | | | | | | | | | | The motivation is to mark dump methods as used in debug builds so that they can be called from lldb, but to not do so in release builds so that they can be dead-stripped. There's lots of potential follow-up work suggested in the thread "Should dump methods be LLVM_ATTRIBUTE_USED only in debug builds?" on cfe-dev, but everyone seems to agreen on this subset. Macro name chosen by fair coin toss. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198456 91177308-0d34-0410-b5e6-96231b3b80d8
* MSVC 2010 build fixAlp Toker2014-01-03
| | | | | | | | | | | | Back out the part of r198399 that enabled LLVM_FINAL/LLVM_OVERRIDE on VS 2010. DwarfUnit.h legitimately uses them on destructors which unfortunately triggers Compiler Error C3665 (override specifier not allowed on a destructor/finalizer) prior to MSVC 2012: virtual ~DwarfCompileUnit() LLVM_OVERRIDE; git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198401 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable LLVM_FINAL, LLVM_OVERRIDE and LLVM_HAS_VARIADIC_TEMPLATES with more ↵Alp Toker2014-01-03
| | | | | | | | | | | | | | gcc and MSVC versions The 'sealed' definition of LLVM_FINAL can be dropped once VS 2010 is decommissioned. Some of this is speculative so will keep an eye on the waterfall -- ping me if you see failures. Incremental work towards C++11 migration. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198399 91177308-0d34-0410-b5e6-96231b3b80d8
* Support LLVM_STATIC_ASSERT() in clang pre-C++11 modeAlp Toker2014-01-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198292 91177308-0d34-0410-b5e6-96231b3b80d8
* Silence g++ 4.9 build issueAlp Toker2013-12-31
| | | | | | | | | lib/Support/ThreadLocal.cpp:53:15: error: typedef 'SIZE_TOO_BIG' locally defined but not used [-Werror=unused-local-typedefs] typedef int SIZE_TOO_BIG[sizeof(pthread_key_t) <= sizeof(data) ? 1 : -1]; Done the C++11 way, switching on and using LLVM_STATIC_ASSERT() instead of LLVM_ATTRIBUTE_UNUSED. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198255 91177308-0d34-0410-b5e6-96231b3b80d8
* Make LLVM_MSC_PREREQ() compatible with all MSVC versionsAlp Toker2013-12-29
| | | | | | | | | The defined() preprocessor expansion wasn't working out on the lld builder. Also update the documentation to cover another Visual Studio release versioning convention. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198158 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix parens fail in r198142Alp Toker2013-12-29
| | | | | | Probable cause of the lld build failure on VS 2012. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198154 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable deleted functions and explicit conversions in MSVC 2013Alp Toker2013-12-29
| | | | | | | Also prospectively enable static_assert as the documentation suggests it's been available since MSVC 2010. Let's see if the build servers agree. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198142 91177308-0d34-0410-b5e6-96231b3b80d8
* Define LLVM_MSC_PREREQ() macro to simplify _MSC_VER checksAlp Toker2013-12-29
| | | | | | | | | Includes documentation mapping MSC version numbers to the more familiar Visual Studio releases. Cleanup only to simplify upcoming C++11 / MSVC 2013 changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198141 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the MSVC 2010 buildAlp Toker2013-12-25
| | | | | | C++11-style forward declared enums weren't supported until MSVC 2012. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197992 91177308-0d34-0410-b5e6-96231b3b80d8
* Define LLVM_HAS_STRONG_ENUMSAlp Toker2013-12-22
| | | | | | | This is needed to guard an upcoming feature in clang until the C++11 transition is complete, at which point it can be removed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197895 91177308-0d34-0410-b5e6-96231b3b80d8
* Compiler.h: Disable initializer list usage with clang-clReid Kleckner2013-12-05
| | | | | | | | | Most people are using MSVC 2012, which lacks the <initializer_list> header. MSVC 2013 shipped with that header, but it has not yet been tested. If clang works with the 2013 header, then we can enable this by checking the value of _MSC_VER. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196448 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't universally enable initialiser lists on GCC. Thanks for catching this ↵Pete Cooper2013-11-11
| | | | | | Chandler git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194365 91177308-0d34-0410-b5e6-96231b3b80d8
* Add LLVM_HAS_INITIALIZER_LISTS for upcoming C++11 support. Use it in ArrayRefPete Cooper2013-11-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194362 91177308-0d34-0410-b5e6-96231b3b80d8
* Explicitly request unsigned enum types when desiredReid Kleckner2013-09-23
| | | | | | | | | | | | | | | | | | | | | The underlying type of all plain enums in MSVC is 'int', even if the enumerator contains large 32-bit unsigned values or values greater than UINT_MAX. The only way to get a large or unsigned enum type is to request it explicitly with the C++11 strong enum types feature. However, since LLVM isn't C++11 yet, I had to add a conditional LLVM_ENUM_INT_TYPE to Compiler.h to control its usage. The motivating true positive for this change is compiling PointerIntPair with MSVC for win64. The PointerIntMask value is supposed to be pointer sized value of all ones with some low zeros. Instead, it's truncated to 32-bits! We are only saved later because it is sign extended back in the AND with int64_t, and we happen to want all ones. This silences lots of -Wmicrosoft warnings during a clang self-host targeting Windows. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191241 91177308-0d34-0410-b5e6-96231b3b80d8
* Add definition of __warn_unused_result__ attribute. It will be used in theJakub Staszak2013-08-19
| | | | | | | futher commits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188689 91177308-0d34-0410-b5e6-96231b3b80d8
* Reland "Use Clang's __has_* macros in Compiler.h ..." with fixesReid Kleckner2013-07-08
| | | | | | | | | | | | | | | This reverts r185841 and relands r185831 without using __has_attribute(const). Clang prior to r161767 (between 3.1 and 3.2) does not accept __has_attribute(const) due to rdar://10253857. __const and __const__ are both keyword aliases of const, so they don't work either. I was able to repro the buildbot failure using clang 3.1 and this patch fixes it. Various important versions of XCode use clang 2.9-ish, so this workaround is necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185850 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert: "Use Clang's __has_* macros in Compiler.h to test for features"Quentin Colombet2013-07-08
| | | | | | | This reverts r185831 and 185833. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185841 91177308-0d34-0410-b5e6-96231b3b80d8
* Attempt to fix Compiler.h for some self-hosting botsReid Kleckner2013-07-08
| | | | | | | I tested r185831 by self-hosting clang with a recent clang, and got no warnings. I haven't been able to reproduce the problem locally. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185833 91177308-0d34-0410-b5e6-96231b3b80d8
* Use Clang's __has_* macros in Compiler.h to test for featuresReid Kleckner2013-07-08
| | | | | | | | | | | | | | | | | | When targetting Windows, clang does not define __GNUC__, and as a result we don't use our attributes with it. This leads to warnings about unused functions that are already annotated with LLVM_ATTRIBUTE_UNUSED. Rather than testing for __clang__, we can use its __has_attribute and __has_builtin macros directlty. While I'm here, conditionally define and use __GNUC_PREREQ for gcc version checks. Spelling the check out with three comparisons is verbose and error prone. Reviewers: aaron.ballman Differential Revision: http://llvm-reviews.chandlerc.com/D1080 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185831 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce LLVM_STATIC_ASSERT macro, which expands to C/C++'s static_assert ↵Argyrios Kyrtzidis2013-03-22
| | | | | | on compilers which support it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177699 91177308-0d34-0410-b5e6-96231b3b80d8
* Make Optional<T>'s operator bool 'explicit' in C++11David Blaikie2013-02-21
| | | | | | | Provides a general way to add 'explicit' for conversion operators (a no-op when compiling as C++98). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175723 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix MSan annotations inclusion guard.Evgeniy Stepanov2013-02-13
| | | | | | | #cmakedefine does not behave the way I though it was. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175050 91177308-0d34-0410-b5e6-96231b3b80d8
* [Support][Compiler] Add LLVM_HAS_VARIADIC_TEMPLATES.Michael J. Spencer2013-02-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174913 91177308-0d34-0410-b5e6-96231b3b80d8
* More MSan/ASan annotations.Evgeniy Stepanov2013-02-04
| | | | | | | | | | | | | | | This change lets us bootstrap LLVM/Clang under ASan and MSan. It contains fixes for 2 issues: - X86JIT reads return address from stack, which MSan does not know is initialized. - bugpoint tests run binaries with RLIMIT_AS. This does not work with certain Sanitizers. We are no longer including config.h in Compiler.h with this change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174306 91177308-0d34-0410-b5e6-96231b3b80d8
* [Support] Add LLVM_IS_UNALIGNED_ACCESS_FAST.Michael J. Spencer2013-02-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174271 91177308-0d34-0410-b5e6-96231b3b80d8
* Annotate BumpPtrAllocator for MemorySanitizer.Evgeniy Stepanov2013-01-31
| | | | | | | | This change adds MemorySanitizer annotations to BumpPtrAllocator to improve report quality. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174051 91177308-0d34-0410-b5e6-96231b3b80d8
* Support/Compiler.h: MSC1600, aka VS2010, is not C++11-ready.NAKAMURA Takumi2013-01-21
| | | | | | | LLVM_HAS_CXX11_TYPETRAITS -- std::is_constructible LLVM_HAS_CXX11_STDLIB -- std::unique_ptr git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172997 91177308-0d34-0410-b5e6-96231b3b80d8
* [Support] Port ErrorOr<T> from lld to C++03.Michael J. Spencer2013-01-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172991 91177308-0d34-0410-b5e6-96231b3b80d8
* [Support] Update MSVC compiler support in Compiler.h.Michael J. Spencer2013-01-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172644 91177308-0d34-0410-b5e6-96231b3b80d8
* [Support] Add LLVM_CONSTEXPR.Michael J. Spencer2013-01-15
| | | | | | Marks a decl as constexpr if the compiler supports it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172508 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new portability macro LLVM_FUNCTION_NAME, that expands to __func__, ifDmitri Gribenko2013-01-11
| | | | | | | supported. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172156 91177308-0d34-0410-b5e6-96231b3b80d8