aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Support/Compiler.h
Commit message (Collapse)AuthorAgeFilesLines
* Update aosp/master LLVM for rebase to r235153Pirama Arumuga Nainar2015-05-181-6/+47
| | | | | Change-Id: I9bf53792f9fc30570e81a8d80d296c681d005ea7 (cherry picked from commit 0c7f116bb6950ef819323d855415b2f2b0aad987)
* Update aosp/master LLVM for rebase to r230699.Stephen Hines2015-03-231-52/+39
| | | | Change-Id: I2b5be30509658cb8266be782de0ab24f9099f9b9
* Update aosp/master LLVM for rebase to r222494.Stephen Hines2014-12-021-23/+38
| | | | Change-Id: Ic787f5e0124df789bd26f3f24680f45e678eef2d
* Update LLVM for rebase to r212749.Stephen Hines2014-07-211-0/+6
| | | | | | | Includes a cherry-pick of: r212948 - fixes a small issue with atomic calls Change-Id: Ib97bd980b59f18142a69506400911a6009d9df18
* Update to LLVM 3.5a.Stephen Hines2014-04-241-98/+39
| | | | Change-Id: Ifadecab779f128e62e430c2b4f6ddd84953ed617
* Don't universally enable initialiser lists on GCC. Thanks for catching this ↵Pete Cooper2013-11-111-2/+1
| | | | | | 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-111-0/+9
| | | | 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-231-0/+12
| | | | | | | | | | | | | | | | | | | | | 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-191-0/+6
| | | | | | | 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-081-16/+40
| | | | | | | | | | | | | | | 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-081-38/+16
| | | | | | | 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-081-1/+1
| | | | | | | 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-081-16/+38
| | | | | | | | | | | | | | | | | | 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-221-0/+10
| | | | | | 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-211-0/+10
| | | | | | | 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-131-1/+1
| | | | | | | #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-111-0/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174913 91177308-0d34-0410-b5e6-96231b3b80d8
* More MSan/ASan annotations.Evgeniy Stepanov2013-02-041-4/+11
| | | | | | | | | | | | | | | 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-031-0/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174271 91177308-0d34-0410-b5e6-96231b3b80d8
* Annotate BumpPtrAllocator for MemorySanitizer.Evgeniy Stepanov2013-01-311-0/+18
| | | | | | | | 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-211-2/+2
| | | | | | | 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-201-0/+27
| | | | 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-161-2/+4
| | | | 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-151-0/+6
| | | | | | 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-111-0/+9
| | | | | | | supported. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172156 91177308-0d34-0410-b5e6-96231b3b80d8
* Compiler.h: Leave LLVM_BUILTIN_UNREACHABLE undefined if it is unavailable in ↵NAKAMURA Takumi2013-01-031-3/+3
| | | | | | | | | | host compiler. Users of LLVM_BUILTIN_UNREACHABLE should be responsible in the case when LLVM_BUILTIN_UNREACHABLE is undefined. Actually, (0, (p)) in LLVM_ASSUME_ALIGNED(p, a) caused thousands of warnings on g++-4.4. It was a motivation in this commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171455 91177308-0d34-0410-b5e6-96231b3b80d8
* Restrict __builtin_assume_aligned to gcc 4.7+Michael J. Spencer2013-01-021-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171408 91177308-0d34-0410-b5e6-96231b3b80d8
* [Support][Endian] Add support for specifying the alignment and native ↵Michael J. Spencer2013-01-021-2/+14
| | | | | | | | | | | unaligned types. * Add support for specifying the alignment to use. * Add the concept of native endianness. Used for unaligned native types. The native alignment and read/write simplification is based on a patch by Richard Smith. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171406 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch LLVM_USE_RVALUE_REFERENCES to LLVM_HAS_RVALUE_REFERENCES.Chandler Carruth2012-11-301-4/+4
| | | | | | | | | | | | | | Rationale: 1) This was the name in the comment block. ;] 2) It matches Clang's __has_feature naming convention. 3) It matches other compiler-feature-test conventions. Sorry for the noise. =] I've also switch the comment block to use a \brief tag and not duplicate the name. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168996 91177308-0d34-0410-b5e6-96231b3b80d8
* Separate out the tests for whether the compiler suports R-valueChandler Carruth2012-11-301-2/+14
| | | | | | | | | | | references from whether it supports an R-value reference *this. No version of GCC today supports the latter, which breaks GCC C++11 compiles of LLVM and Clang now. Also add doxygen comments clarifying what's going on here, and update the usage in Optional. I'll update the usages in Clang next. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168993 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new C++11 compatibility macro, LLVM_LVALUE_FUNCTION.Jordan Rose2012-11-301-0/+10
| | | | | | | | | | | | | | | | This expands to '&', and is intended to be used when an /optional/ rvalue override is available. Before: void foo() const { ... } After: void foo() const LLVM_LVALUE_FUNCTION { ... } void foo() && { ... } This is used to allow moving the contents of an Optional. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168963 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an extra slash so doxygen comments will be properly recognized.Craig Topper2012-11-251-13/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168554 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a typo. No functional change.Craig Topper2012-09-181-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164100 91177308-0d34-0410-b5e6-96231b3b80d8
* Add LLVM_OVERRIDE and LLVM_FINAL C++11 compatibility macros.Craig Topper2012-09-161-0/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164005 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure macros in the include subdirectory are not used without being defined.Bob Wilson2012-09-041-1/+1
| | | | | | | | | | | | | | | | Rationale: For each preprocessor macro, either the definedness is what's meaningful, or the value is what's meaningful, or both. If definedness is meaningful, we should use #ifdef. If the value is meaningful, we should use and #ifdef interchangeably for the same macro, seems ugly to me, even if undefined macros are zero if used. This also has the benefit that including an LLVM header doesn't prevent you from compiling with -Wundef -Werror. Patch by John Garvin! <rdar://problem/12189979> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163148 91177308-0d34-0410-b5e6-96231b3b80d8
* Explicitly cast an expression to bool before handing it off to __builtin_expect.Benjamin Kramer2012-08-291-2/+2
| | | | | | Avoids surprises when someone uses LLVM_(UN)LIKELY with an integer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162877 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace the BUILTIN_EXPECT macro with a less horrible ↵Benjamin Kramer2012-08-291-2/+4
| | | | | | LLVM_LIKELY/LLVM_UNLIKELY interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162873 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide a portability macro for __builtin_trap.David Blaikie2012-08-211-0/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162300 91177308-0d34-0410-b5e6-96231b3b80d8
* Add LLVM_DELETED_FUNCTION compatibility macro.Michael J. Spencer2012-08-151-0/+19
| | | | | | | | | | | | This should replace uses of: class A { A(const &A); // DO NOT IMPLEMENT public: ... }; git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161975 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix few warnings.Galina Kistanova2012-07-201-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160576 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix trivial typo in llvm_move.John McCall2012-05-071-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156288 91177308-0d34-0410-b5e6-96231b3b80d8
* Update SmallVector to support move semantics if the host does.John McCall2012-05-021-0/+19
| | | | | | | | | | | | | Note that support for rvalue references does not imply support for the full set of move-related STL operations. I've preserved support for an odd little thing in insert() where we're trying to support inserting a new element from an existing one. If we actually want to support that, there's a lot more we need to do: insert can call either grow or push_back, neither of which is safe against this particular use pattern. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155979 91177308-0d34-0410-b5e6-96231b3b80d8
* [Support] Drop verbose _ATTRIBUTE from LLVM_ATTRIBUTE_{READONLY,READNONE} macroDaniel Dunbar2012-03-091-9/+9
| | | | | | names. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152413 91177308-0d34-0410-b5e6-96231b3b80d8
* include/llvm/Support/Compiler.h: Invalidate LLVM_ATTRIBUTE_WEAK on cygming ↵NAKAMURA Takumi2011-11-151-1/+1
| | | | | | | | for now. It triggers generating insane executables with both binutils-2.19.1(msysgit) and 2.22.51.20111013(cygwin). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144621 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix linking for some users who already have tsan enabled code and are trying toNick Lewycky2011-11-151-0/+7
| | | | | | | link it against llvm code, by making our definitions weak. "Some users." git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144596 91177308-0d34-0410-b5e6-96231b3b80d8
* Support/Compiler: Add LLVM_EXTENSION for use where we want to hide pedantic ↵Daniel Dunbar2011-11-011-0/+8
| | | | | | diags. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143468 91177308-0d34-0410-b5e6-96231b3b80d8
* Version N of the llvm_unreachable patch: VC++ doesn't recognize that abort()John McCall2011-03-141-3/+1
| | | | | | | | | | doesn't return, so just go back to using the old runtime function instead of trying to use abort() when __builtin_unreachable (or an equivalent) isn't supported. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127629 91177308-0d34-0410-b5e6-96231b3b80d8
* Okay, some compilers complain if you provide the exception-specificationJohn McCall2011-03-141-5/+0
| | | | | | | | | where none was before. Just don't declare it and hope it's declared in every translation unit that needs it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127612 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the exception-specification of abort() when declaring it in C++.John McCall2011-03-141-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127610 91177308-0d34-0410-b5e6-96231b3b80d8
* Make llvm_unreachable evaluate to __builtin_unreachable() in -AssertsJohn McCall2011-03-141-0/+15
| | | | | | | | builds, which was the apparent consensus of PR8973 and llvmdev. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127608 91177308-0d34-0410-b5e6-96231b3b80d8