summaryrefslogtreecommitdiff
path: root/include/llvm/Support/Compiler.h
Commit message (Collapse)AuthorAge
* 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
* Compiler.h: Leave LLVM_BUILTIN_UNREACHABLE undefined if it is unavailable in ↵NAKAMURA Takumi2013-01-03
| | | | | | | | | | 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-02
| | | | 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-02
| | | | | | | | | | | 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-30
| | | | | | | | | | | | | | 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-30
| | | | | | | | | | | 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-30
| | | | | | | | | | | | | | | | 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-25
| | | | 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-18
| | | | 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-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-04
| | | | | | | | | | | | | | | | 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-29
| | | | | | 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-29
| | | | | | 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-21
| | | | 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-15
| | | | | | | | | | | | 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-20
| | | | 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-07
| | | | 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-02
| | | | | | | | | | | | | 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-09
| | | | | | 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-15
| | | | | | | | 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-15
| | | | | | | 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-01
| | | | | | 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-14
| | | | | | | | | | 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-14
| | | | | | | | | 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-14
| | | | 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-14
| | | | | | | | 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
* Support/Path: Deprecate PathV1::isAbsolute.Michael J. Spencer2010-12-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122086 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove deprecated macro names. Hopefully this will unbreak theDuncan Sands2010-10-25
| | | | | | | | | smooshlab build. The breakage seems to be due to a collision between LLVM's ATTRIBUTE_UNUSED and gcc's which was previously hidden due to header files being included in a lucky order. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117260 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the remaining attribute macros to systematic names based on the attributeChandler Carruth2010-10-23
| | | | | | | name and prefixed with 'LLVM_'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117203 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch attribute macros to use 'LLVM_' as a prefix. We retain the old namesChandler Carruth2010-10-23
| | | | | | | until other LLVM projects using these are cleaned up. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117200 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a comment about ATTRIBUTE_UNUSED to avoid further confusion over when toChandler Carruth2010-10-20
| | | | | | | use it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116920 91177308-0d34-0410-b5e6-96231b3b80d8
* Support: Add __forceinline to Compiler.h on MSVC.Michael J. Spencer2010-10-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115595 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove LLVM_GLOBAL_VISIBILITY, which is unused, and was not working properly.Duncan Sands2010-09-15
| | | | | | | | | | | | | | The problem was that the test for whether a compiler supports it or not was inaccurate, but has to be accurate: LLVM_LOCAL_VISIBILITY is an optimization and not needed for correctness, so wrongly thinking a compiler doesn't support it is not a big deal, but LLVM_GLOBAL_VISIBILITY is for correctness, and not an optimization: getting it wrong is fatal: it needs to be set based on a configure test not testing the gcc version. Since dragonegg has moved to a different scheme, and it was the only user of LLVM_GLOBAL_VISIBILITY, just remove this macro. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113959 91177308-0d34-0410-b5e6-96231b3b80d8
* Define LLVM_GLOBAL_VISIBILITY to be __declspec(dllexport) onDuncan Sands2010-09-01
| | | | | | | windows systems. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112700 91177308-0d34-0410-b5e6-96231b3b80d8
* I got tired of VISIBILITY_HIDDEN colliding with the gcc enum. Rename itDuncan Sands2010-05-11
| | | | | | | | to LLVM_LIBRARY_VISIBILITY and introduce LLVM_GLOBAL_VISIBILITY, which is the opposite, for future use by dragonegg. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103495 91177308-0d34-0410-b5e6-96231b3b80d8
* don't use always_inline with gcc 3.4, it has some unimplemented featuresChris Lattner2010-03-03
| | | | | | | | and is too old to really care about the performance of the generated compiler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97662 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an "ATTRIBUTE_UNUSED" macro (and use it). It's for variables which areBill Wendling2009-12-28
| | | | | | | | mainly used in debugging and/or assert situations. It should make the compiler and the static analyzer stop nagging us about them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92181 91177308-0d34-0410-b5e6-96231b3b80d8
* add an ALWAYS_INLINE macro, which does the obvious thing.Chris Lattner2009-12-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91416 91177308-0d34-0410-b5e6-96231b3b80d8
* Following a suggestion of Daniel Dunbar, stop people passing the nameDuncan Sands2009-11-17
| | | | | | | | as the isSigned bool to CreateIntCast by having this resolve to a call to a private method, rather than by using a gcc attribute. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89067 91177308-0d34-0410-b5e6-96231b3b80d8