search for: alignof

Displaying 20 results from an estimated 137 matches for "alignof".

2019 Oct 17
2
Static assert fails when compiler for i386
...der below testcase. $cat test.cpp #include <vector> #include<type_traits> typedef int _int4 __attribute__((vector_size(16))); typedef union{ int data[4]; struct {int x, y, z, w;}; _int4 vec; } int4; typedef int4 int3; int main() { static_assert(std::alignment_of<int4>::value <= alignof(max_align_t), "over aligned!"); } $clang++ -m32 error: static_assert failed due to requirement 'std::alignment_of<int4>::value <= alignof(max_align_t)' "over aligned it goes smooth when compile for x86_64. Following changes fixes this. diff --git a/clang/lib/Header...
2010 Oct 29
1
[LLVMdev] LLVM program compile error w/ gcc 4.5 but not 4.4
...de/llvm/Pass.h:366, from /waflhome/trapni/local/include/llvm/PassManager.h:20, from /waflhome/trapni/local/include/llvm/Support/StandardPasses.h:22, from /waflhome/trapni/local/src/flow/src/Runner.cpp:19: /waflhome/trapni/local/include/llvm/Support/AlignOf.h:57:24: error: expected unqualified-id before 'alignof' In file included from /waflhome/trapni/local/include/llvm/ADT/StringMap.h:18:0, from /waflhome/trapni/local/include/llvm/PassRegistry.h:20, from /waflhome/trapni/local/include/llvm/PassSupport.h:25,...
2009 Sep 22
2
[LLVMdev] DebugFactory
...bugInfoBuilder that I am missing quite badly, and which is not available in the current DIFactory, is the ability to specify structure offsets abstractly. The DebugFactory requires that you pass in structure offset information as ints, whereas DebugInfoBuilder had "offsetOf" and "alignOf" methods, similar to the "sizeOf" trick, that would create the constants for you in a way that didn't require your front end to know the sizes of things. So far I've been able to avoid having any references to target machines in my frontend, but now that I am trying to fl...
2019 Jun 18
3
Retiring VS2015 Support
...of Visual Studio. With the release of VS2019, what do people think of retiring VS2015 support before the next major llvm/clang release? As well as simplifying C++14 migration (admittedly only a little), this should also let us remove a number of hacks (e.g. the alignas/AlignedCharArray hack in AlignOf.h), as well as re-enabling a number of warnings in HandleLLVMOptions.cmake. I haven't noticed any build bots still referring to VS2015 (at least not by name). Simon.
2014 May 15
3
[LLVMdev] 3.4 branch gcc 4.9 build error
...included from /tmp/llvm/include/llvm/ADT/APFloat.h:20: In file included from /tmp/llvm/include/llvm/ADT/APInt.h:19: In file included from /tmp/llvm/include/llvm/ADT/ArrayRef.h:14: In file included from /tmp/llvm/include/llvm/ADT/SmallVector.h:17: In file included from /tmp/llvm/include/llvm/Support/AlignOf.h:19: /usr/lib64/[...]/c++/4.9.0/cstddef:51:11: error: no member named 'max_align_t' in the global namespace using ::max_align_t; ~~^ 1 error generated. As the fixes got merged to the release_34 branch, I went to check the local configure options and noticed I was passing -...
2008 Sep 21
3
[LLVMdev] Has anyone sucessfully compile the llvm code using visual
...;MachineModuleInfo.cpp 3>c:\Documents and Settings\Administrator\llvm\include\llvm/Intrinsics.h(39) : fatal error C1083: Cannot open include file: 'llvm/Intrinsics.gen': No such file or directory 3>InlineAlways.cpp 2>c:\Documents and Settings\Administrator\llvm\include\llvm/Support/AlignOf.h(26) : warning C4624: 'llvm::AlignmentCalcImpl<T>' : destructor could not be generated because a base class destructor is inaccessible 2> with 2> [ 2> T=llvm::MachineInstr 2> ] 2> c:\Documents and Settings\Administrator\llvm\inclu...
2009 Sep 22
3
[LLVMdev] DebugFactory
...>> quite badly, and which is not available in the current DIFactory, is the >> ability to specify structure offsets abstractly. The DebugFactory >> requires that you pass in structure offset information as ints, whereas >> DebugInfoBuilder had "offsetOf" and "alignOf" methods, similar to the >> "sizeOf" trick, that would create the constants for you in a way that >> didn't require your front end to know the sizes of things. So far I've >> been able to avoid having any references to target machines in my >> frontend...
2009 Sep 22
0
[LLVMdev] DebugFactory
...hat I am missing > quite badly, and which is not available in the current DIFactory, is the > ability to specify structure offsets abstractly. The DebugFactory > requires that you pass in structure offset information as ints, whereas > DebugInfoBuilder had "offsetOf" and "alignOf" methods, similar to the > "sizeOf" trick, that would create the constants for you in a way that > didn't require your front end to know the sizes of things. So far I've > been able to avoid having any references to target machines in my > frontend, but now that I...
2014 Sep 24
2
[LLVMdev] Runtime alignment
For the size of a type to be calculated at runtime, there is a known trick with gep. Is there any similar trick for determining the alignment of a type at runtime for target-independent IR? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140924/887f8612/attachment.html>
2014 Dec 25
0
[PATCH v2 1/2] virtio_ring: document alignment requirements
Host needs to know vring element alignment requirements: simply doing alignof on structures doesn't work reliably: on some platforms gcc has alignof(uint32_t) == 2. Add macros for alignment as specified in virtio 1.0 cs01, export them to userspace as well. Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- include/uapi/linux/virtio_ring.h | 7 +++++++ 1 f...
2014 Dec 25
0
[PATCH v2 1/2] virtio_ring: document alignment requirements
Host needs to know vring element alignment requirements: simply doing alignof on structures doesn't work reliably: on some platforms gcc has alignof(uint32_t) == 2. Add macros for alignment as specified in virtio 1.0 cs01, export them to userspace as well. Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- include/uapi/linux/virtio_ring.h | 7 +++++++ 1 f...
2008 May 20
1
[LLVMdev] LLVM on small MCUs?
...However, these architectures share: - 8-bit loads, stores, and arithmetic ops. - Harvard architecture What sizes and alignments you choosing for the machine-dependent types? avr-gcc for example has: sizeof(short)=2 sizeof(int)=2 sizeof(long)=4 sizeof(long long)=8 sizeof(int *)=2 sizeof(enum)=2 alignof(anything)=1 For any architecture where sizeof(int) > sizeof(register) it is desirable avoid whenever possible being forced to perform int-sized computations, which tend to be extremely inefficient, by C's promote to integer tendencies. I think this is what is being discussed in "ch...
2015 Nov 02
2
Representing X86 long double in Debug Info
...ts wide, but I don’t understand the mechanics well enough to > decide whether the TypeInfo is wrong here or if we should work around it in > CGDebugInfo. > I think TypeInfo usually describes the answer that sizeof() is supposed to give. sizeof() is typically a multiple of alignment, so if alignof() is 128, sizeof must be 128. Other common alignments are 32 and 64, which makes sizeof() 96 and 128 respectively. In practice, sizeof(long double) is never 80. Maybe CGDebugInfo should ask TargetInfo::getLongDoubleFormat() what model is in use and generate dwarf accordingly. It's a bit of a h...
2014 May 15
2
[LLVMdev] 3.4 branch gcc 4.9 build error
.../ADT/APFloat.h:20: >> In file included from /tmp/llvm/include/llvm/ADT/APInt.h:19: >> In file included from /tmp/llvm/include/llvm/ADT/ArrayRef.h:14: >> In file included from /tmp/llvm/include/llvm/ADT/SmallVector.h:17: >> In file included from /tmp/llvm/include/llvm/Support/AlignOf.h:19: >> /usr/lib64/[...]/c++/4.9.0/cstddef:51:11: error: >> no member named 'max_align_t' in the global namespace >> using ::max_align_t; >> ~~^ >> 1 error generated. >> > Is this trunk or the 3.4 branch? > >> As the fixes...
2016 Feb 24
0
How to resolve debug info forward types
...hen, once the final value of the temporary is known (and you GOTTA do this step otherwise you get an assert): DICompositeType *result = m_DIBuilder->createStructType( m_DICompileUnit, name, file, loc.m_Line, sizeOf(actual) * 8, alignOf(actual) * 8, 0, nullptr, elts); it = m_TmpStructDI.find(name); if (it != m_TmpStructDI.end()) { MDNode *node = /* the result from createReplaceableCompositeType earlier */ llvm::TempMDNode fwd_decl(node); m_DIBuilder->replaceTemporary(std::m...
2016 Jan 05
0
R, AIX 64-bit builds - trying to understand root cause for message: "Error: Line starting 'Package: tools ...' is malformed!"
...ifferent code before asking for > assistence. > > +2139 #ifdef HAVE_STDALIGN_H > +2140 # include <stdalign.h> > +2141 #endif > +2142 > +2143 #include <stdint.h> > +2144 > +2145 long double *R_allocLD(size_t nelem) > +2146 { > +2147 #if __alignof_is_defined > +2148 // This is C11: picky compilers may warn. > +2149 size_t ld_align = alignof(long double); > +2150 #elif __GNUC__ > +2151 // This is C99, but do not rely on it. > +2152 size_t ld_align = offsetof(struct { char __a; long double > __b; },...
2009 Sep 22
0
[LLVMdev] DebugFactory
...badly, and which is not available in the current DIFactory, is the > >> ability to specify structure offsets abstractly. The DebugFactory > >> requires that you pass in structure offset information as ints, whereas > >> DebugInfoBuilder had "offsetOf" and "alignOf" methods, similar to the > >> "sizeOf" trick, that would create the constants for you in a way that > >> didn't require your front end to know the sizes of things. So far I've > >> been able to avoid having any references to target machines in my &g...
2009 Sep 23
1
[LLVMdev] DebugFactory
...able in the current DIFactory, is >> >> the >> >> ability to specify structure offsets abstractly. The DebugFactory >> >> requires that you pass in structure offset information as ints, whereas >> >> DebugInfoBuilder had "offsetOf" and "alignOf" methods, similar to the >> >> "sizeOf" trick, that would create the constants for you in a way that >> >> didn't require your front end to know the sizes of things. So far I've >> >> been able to avoid having any references to target machi...
2016 Feb 24
3
How to resolve debug info forward types
Before metadata was separated from values, I could create a debug info forward declaration and eventually resolve it using LLVMReplaceAllUsesWith in core.h. Now, I can't figure out how to resolve it. I can find no function that seems to do this. My one wild guess that giving the forward decl and the resolving decl the same UniqueId might do it is not working. I am currently using 3.6.1, but
2016 Jan 15
2
[cfe-dev] RFC: Enforcing pointer type alignment in Clang
...gned. While casting the result of "&a.b" to "A::B *" in the expression "A::B *p = &a.b" is fine (well, becomes more _explicitly_ fine with your suggested modification to the standard text), once you've done that, the new type _does_ require an alignment of alignof(int), and thus, the value of "p" is misaligned for its type. And so, you can no longer dereference it nor access members. That seems all fine and sensible to me. If you need to give a name "p" to the value, you can still do like this: typedef struct A::B __attribute__((aligne...