1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

43 Commits

Author SHA1 Message Date
Adrian Prantl
076a6683eb Remove \brief commands from doxygen comments.
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.

Patch produced by

  for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done

Differential Revision: https://reviews.llvm.org/D46290

llvm-svn: 331272
2018-05-01 15:54:18 +00:00
NAKAMURA Takumi
877a8ab806 Revert r291503, "Lift the 10-type limit for AlignedCharArrayUnion", and followings.
r291503, "Lift the 10-type limit for AlignedCharArrayUnion"
  r291514, "Fix MSVC build of AlignedCharArrayUnion"
  r291515, "Revert the attempt to optimize the constexpr functions. MSVC does not handle this yet"
  r291519, "Try once again to fix the MSVC build of AlignedCharArrayUnion"

They has been failing on i686-linux.

llvm-svn: 291875
2017-01-13 01:13:10 +00:00
Reid Kleckner
8cff07fe72 Try once again to fix the MSVC build of AlignedCharArrayUnion
It was complaining about ambiguity between llvm::detail and
llvm::support::detail:
  error C2872: 'detail': ambiguous symbol
  note: could be 'llvm::detail'
  note: or       'llvm::support::detail'

Standardize on llvm::support::detail to hide these symbols further.

llvm-svn: 291519
2017-01-10 01:05:33 +00:00
Reid Kleckner
76cc76d15b Revert the attempt to optimize the constexpr functions. MSVC does not handle this yet
llvm-svn: 291515
2017-01-10 00:29:05 +00:00
Reid Kleckner
f2ab1ce169 Fix MSVC build of AlignedCharArrayUnion
Use constexpr recursion for alignof like we do for sizeof. Seems to work
with Clang and MSVC. Also, don't recurse twice to avoid slowdowns in
compilers that don't memoize constexpr results (Clang).

llvm-svn: 291514
2017-01-10 00:26:56 +00:00
Sean Callanan
f0c5814829 Lift the 10-type limit for AlignedCharArrayUnion
This patch uses C++11 parameter packs and constexpr functions
to allow AlignedCharArrayUnion to hold an arbitrary number of
types.

Differential Revision: https://reviews.llvm.org/D28429

llvm-svn: 291503
2017-01-09 23:23:25 +00:00
Mehdi Amini
d9082699df Improve documentation on MSVC workaround for AlignedCharArray (NFC)
The comment only mentioned "old version of MSVC".

Differential Revision: https://reviews.llvm.org/D27312

llvm-svn: 288417
2016-12-01 20:54:29 +00:00
Benjamin Kramer
7a00eb9834 [Support] Put back the MSVC hack for AlignedCharArray.
MSVC 2015 still errors when passing an alignas'd object by value as an
argument.

llvm-svn: 284738
2016-10-20 15:53:04 +00:00
Benjamin Kramer
b471938ca6 [Support] Remove llvm::alignOf now that all uses are gone.
Also clean up the legacy hacks for AlignedCharArray. I'm keeping
LLVM_ALIGNAS alive for a bit longer because GCC 4.8.0 (which we still
support apparently) shipped a buggy alignas(). All other supported
compilers have a working alignas.

llvm-svn: 284736
2016-10-20 15:36:38 +00:00
Hubert Tong
5f48e8fe2e TrailingObjects::FixedSizeStorage constexpr fixes + tests
Summary:
This change fixes issues with `LLVM_CONSTEXPR` functions and
`TrailingObjects::FixedSizeStorage`. In particular, some of the
functions marked `LLVM_CONSTEXPR` used by `FixedSizeStorage` were not
implemented such that they evaluate successfully as part of a constant
expression despite constant arguments.

This change also implements a more traditional template-meta path to
accommodate MSVC, and adds unit tests for `FixedSizeStorage`.

Drive-by fix: the access control for members of `TrailingObjectsImpl` is
tightened.

Reviewers: faisalv, rsmith, aaron.ballman

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D22668

llvm-svn: 277270
2016-07-30 14:01:00 +00:00
Eugene Zelenko
966902f532 Fix Clang-tidy modernize-use-nullptr and modernize-use-override warnings; other minor fixes.
Differential revision: reviews.llvm.org/D16568

llvm-svn: 258831
2016-01-26 18:48:36 +00:00
NAKAMURA Takumi
cc6d93ab4f AlignOf.h: Satisfy both g++-4.7 and msc18.
llvm-svn: 258623
2016-01-23 13:52:09 +00:00
NAKAMURA Takumi
b5bfd9266e AlignOf.h: Appease g++-4.7 for now. Will fix later.
llvm-svn: 258600
2016-01-23 02:22:36 +00:00
Nico Weber
85ea6e2ccc Make InstProfWriter compile again after 258544 with MSVC.
\src\llvm-rw\include\llvm/Support/AlignOf.h(254) :
    error C2872: 'detail' : ambiguous symbol
        could be 'llvm::detail'
        or       'llvm::support::detail'

llvm-svn: 258553
2016-01-22 21:13:04 +00:00
Chandler Carruth
fdea2f9ee2 [ADT] Teach alignment helpers to work correctly for abstract classes.
This is necessary to use them as part of pointer traits and is generally
useful. I've added unit test coverage to isolate and ensure this works
correctly.

I'll watch the build bots to try to see if any compilers can't tolerate
this bit of magic (and much credit goes to Richard Smith for coming up
with this magical production!) but give a shout if you see issues.

llvm-svn: 256553
2015-12-29 09:52:41 +00:00
James Y Knight
f3c63ab09b Fix alignment issues in LLVM.
Adds static_asserts to ensure alignment of concatenated objects is
correct, and fixes them where they are not.

Also changes the definition of AlignOf to use constexpr, except on
MSVC, to avoid enum comparison warnings from GCC.

(There's not too much of this in llvm itself, most of the fun is in
clang).

This seems to make LLVM actually work without Bus Error on 32bit
sparc.

Differential Revision: http://reviews.llvm.org/D10271

llvm-svn: 239872
2015-06-17 01:21:20 +00:00
Douglas Katzman
f678b80916 Update obsolete comments, fix typo, delete trailing space.
llvm-svn: 237378
2015-05-14 18:07:04 +00:00
Yaron Keren
372925e7ab Recommit r235219, it's need for out-of-tree users of AlignOf.h.
llvm-svn: 235522
2015-04-22 16:43:56 +00:00
Yaron Keren
b8b0518eaa Revert r235219, it's not needed after r235450.
llvm-svn: 235480
2015-04-22 05:06:57 +00:00
Aaron Ballman
c32277bfbc Suppressing the C4324 warnings generated by MSVC. This is the only declarative instance that would generate the warning, but it accounted for about 525+ warnings due to template instantiations. This is a marginal-value warning which we may decide to disable more broadly, but since this header is in Support and may be used out of tree, it's a low burden for us to be warning-free in this case.
llvm-svn: 235219
2015-04-17 19:35:44 +00:00
Benjamin Kramer
ae20520543 [alignof] Put back the hack for old versions of GCC.
This works around a bug (PR56859) that is fixed in all versions of GCC I tested
with but was present in 4.8.0. Using 4.8.0 is of course a terrible idea, but looks
like we can't drop it just yet.

llvm-svn: 233916
2015-04-02 13:31:50 +00:00
Benjamin Kramer
6923c15ed3 [support] Add a macro wrapper for alignas and simplify some code.
We wrap __attribute((aligned)) for GCC 4.7 and __declspec(align) for
MSVC. The latter behaves weird in some contexts so this should be used
carefully.

llvm-svn: 233910
2015-04-02 11:32:48 +00:00
Richard Smith
79e98116f7 Extend llvm::AlignedCharArrayUnion to support up to 10 arguments, as required by Clang's APValue.
llvm-svn: 198844
2014-01-09 03:28:55 +00:00
Manuel Klimek
ce57d67e96 Incrase the number of parameters for AlignedCharArrayUnion.
We need this to correctly fix ASTMatchers/ASTTypeTraits.h in clang.

llvm-svn: 171965
2013-01-09 10:39:16 +00:00
Chandler Carruth
fab9a81b1d Remove the declspecs from small alignments that we can force with
a union. These don't actually work for by-value function arguments, and
MSVC warns if they exist even while (we hope) it aligns the argument
correctly due to the other union member.

This means MSVC will miss out on optimizations based on the alignment of
the buffer, but really, there aren't that many for x86 and MSVC is
likely not doing a great job of optimizing LLVM and Clang anyways.

llvm-svn: 171328
2012-12-31 22:18:01 +00:00
Michael J. Spencer
d221e06c0a [AlignOf] Add AlignedCharArray and refactor AlignedCharArrayUnion.
This adds AlignedCharArray<Alignment, Size>. A templated struct that contains
a member named buffer of type char[Size] that is aligned to Alignment.

llvm-svn: 171319
2012-12-31 19:54:45 +00:00
Rafael Espindola
7aaf7247d3 xlc supports __attribute__((aligned(x))), use it.
Patch by Kai.

llvm-svn: 167087
2012-10-31 00:54:26 +00:00
David Blaikie
c05c0c5f06 Fix up erroneous alignas usage while making this portable to GCC 4.7
Review by Chandler Carruth.

llvm-svn: 163944
2012-09-14 22:26:11 +00:00
Chandler Carruth
0ca7784fb1 Try to appease MSVC even more elaborately in the alignment hacking space.
MSVC doesn't support passing by-value parameters with alignment of
16-bytes or higher apparantly. What is deeply confusing is that it seems
to *sometimes* (but not always) apply this to any type whose alignment
is set using __declspec(align(...)). This caused lots of errors when we switch
SmallVector over to use the automatically aligned character array
utilities as they used __declspec(align(...)) heavily.

As a pretty horrible but effective work-around, we instead cherry pick
the smallest alignment sizes with specific types that happen to have the
correct alignment, and then fall back to the attribute solution past
them. This should resolve the MSVC build errors folks have been hitting.
Sorry for that. In good news, it will do this without introducing other
UB I hope. =]

Thanks to Timur Iskhodzhanov for helping me test this!

llvm-svn: 162549
2012-08-24 09:53:43 +00:00
Chandler Carruth
c90bc7f318 Flatten the aligned-char-array utility template to be a directly
templated union at the request of Richard Smith. This makes it
substantially easier to type. =]

llvm-svn: 162072
2012-08-17 01:47:25 +00:00
Chandler Carruth
4aeccfe390 Just remove generic support for C++11 alignas -- GCC is already
advertising complete support w/o alignas implemented, and its
implementation of alignas in the latest versions is so convoluted as to
be unusable.

llvm-svn: 159125
2012-06-25 05:20:13 +00:00
Chandler Carruth
6f8cc37074 Remove 'static' from inline functions defined in header files.
There is a pretty staggering amount of this in LLVM's header files, this
is not all of the instances I'm afraid. These include all of the
functions that (in my build) are used by a non-static inline (or
external) function. Specifically, these issues were caught by the new
'-Winternal-linkage-in-inline' warning.

I'll try to just clean up the remainder of the clearly redundant "static
inline" cases on functions (not methods!) defined within headers if
I can do so in a reliable way.

There were even several cases of a missing 'inline' altogether, or my
personal favorite "static bool inline". Go figure. ;]

llvm-svn: 158800
2012-06-20 08:39:33 +00:00
Chandler Carruth
7b9797e637 Add support to the alignment support header for conjuring a character
array of a suitable size and alignment for any of a number of different
types to be stored into the character array.

The mechanisms for producing an explicitly aligned type are fairly
complex because this operation is poorly supported on all compilers.
We've spent a fairly significant amount of time experimenting with
different implementations inside of Google, and the one using explicitly
expanded templates has been the most robust.

Credit goes to Nick Lewycky for writing the first 20 versions or so of
this logic we had inside of Google. I based this on the only one to
actually survive. In case anyone is worried, yes we are both explicitly
re-contributing and re-licensing it for LLVM. =]

Once the issues with actually specifying the alignment are finished, it
turns out that most compilers don't in turn align anything the way they
are instructed. Testing of this logic against both Clang and GCC
indicate that the alignment constraints are largely ignored by both
compilers! I've come up with and used a work-around by wrapping each
alignment-hinted type directly in a struct, and using that struct to
align the character array through a union. This elaborate hackery is
terrifying, but I've included testing that caught a terrifying number of
bugs in every other technique I've tried.

All of this in order to implement a poor C++98 programmers emulation of
C++11 unrestricted unions in classes such as SmallDenseMap.

llvm-svn: 158597
2012-06-16 08:52:57 +00:00
Michael J. Spencer
cda94ff1f3 Fix spelling.
llvm-svn: 121156
2010-12-07 18:11:54 +00:00
Chris Lattner
ee8dea6453 Rename alignof -> alignOf to avoid irritating C++'0x compilers,
PR8423, patch by nobled.

llvm-svn: 117774
2010-10-30 05:14:01 +00:00
Misha Brukman
7ee4196e74 Removed trailing whitespace.
llvm-svn: 65196
2009-02-20 22:51:36 +00:00
Evan Cheng
d9353009b7 Fix more -Wshorten-64-to-32 warnings.
llvm-svn: 50659
2008-05-05 18:30:58 +00:00
Ted Kremenek
fd04109260 Add more alignment enums.
llvm-svn: 50363
2008-04-28 17:58:20 +00:00
Ted Kremenek
f06b7ac532 Added "Profile" method to APFloat for use with FoldingSet.
Added member template "Add" to FoldingSetNodeID that allows "adding" arbitrary
objects to a profile via dispatch to FoldingSetTrait<T>::Profile().

Removed FoldingSetNodeID::AddAPFloat and FoldingSetNodeID::APInt, as their
functionality is now replaced using the above mentioned member template.

llvm-svn: 46957
2008-02-11 17:24:50 +00:00
Chris Lattner
e0b1ee937a Don't attribute in file headers anymore. See llvmdev for the
discussion of this change.  Boy are my fingers tired. ;-)

llvm-svn: 45411
2007-12-29 19:59:42 +00:00
Ted Kremenek
bf43a92ef5 Removed inclusion of cassert, which is no longer needed.
llvm-svn: 43099
2007-10-17 22:12:14 +00:00
Ted Kremenek
a9c650d43e Added template function alignof() which provides a clean
function-based interface to getting the alignment of a type.

llvm-svn: 43096
2007-10-17 22:08:55 +00:00
Ted Kremenek
d82172cc2c Added llvm::AlignOf, a template class whose purpose is to portably
compute the minimum memory alignment of arbitrary types.

llvm-svn: 43086
2007-10-17 20:56:47 +00:00