mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-12-19 11:23:32 +00:00
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239872 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include "llvm/ADT/iterator.h"
|
||||
#include "llvm/ADT/iterator_range.h"
|
||||
#include "llvm/IR/Value.h"
|
||||
#include "llvm/Support/AlignOf.h"
|
||||
#include "llvm/Support/ErrorHandling.h"
|
||||
|
||||
namespace llvm {
|
||||
@@ -226,6 +227,11 @@ public:
|
||||
return isa<Instruction>(V) || isa<Constant>(V);
|
||||
}
|
||||
};
|
||||
// Either Use objects, or a Use pointer can be prepended to User.
|
||||
static_assert(AlignOf<Use>::Alignment >= AlignOf<User>::Alignment,
|
||||
"Alignment sufficient after objects prepended to User");
|
||||
static_assert(AlignOf<Use *>::Alignment >= AlignOf<User>::Alignment,
|
||||
"Alignment sufficient after objects prepended to User");
|
||||
|
||||
template<> struct simplify_type<User::op_iterator> {
|
||||
typedef Value* SimpleType;
|
||||
|
||||
Reference in New Issue
Block a user