projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[IR] Give catchret an optional 'return value' operand
[oota-llvm.git]
/
include
/
llvm
/
IR
/
GlobalObject.h
diff --git
a/include/llvm/IR/GlobalObject.h
b/include/llvm/IR/GlobalObject.h
index 74cc18eeb1e7696bb6f4e770d95df7054a20493b..f0552410b61d972b0a2e6f0175bbde93f1e96b6a 100644
(file)
--- a/
include/llvm/IR/GlobalObject.h
+++ b/
include/llvm/IR/GlobalObject.h
@@
-1,4
+1,4
@@
-//===-- llvm/GlobalObject.h - Class to represent
a global object
*- C++ -*-===//
+//===-- llvm/GlobalObject.h - Class to represent
global objects -
*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
//
// The LLVM Compiler Infrastructure
//
@@
-20,30
+20,48
@@
#include "llvm/IR/GlobalValue.h"
namespace llvm {
#include "llvm/IR/GlobalValue.h"
namespace llvm {
-
+class Comdat;
class Module;
class GlobalObject : public GlobalValue {
class Module;
class GlobalObject : public GlobalValue {
- GlobalObject(const GlobalObject &)
LLVM_DELETED_FUNCTION
;
+ GlobalObject(const GlobalObject &)
= delete
;
protected:
protected:
- GlobalObject(Type *Ty, ValueTy VTy, Use *Ops, unsigned NumOps,
+ GlobalObject(
Pointer
Type *Ty, ValueTy VTy, Use *Ops, unsigned NumOps,
LinkageTypes Linkage, const Twine &Name)
LinkageTypes Linkage, const Twine &Name)
- : GlobalValue(Ty, VTy, Ops, NumOps, Linkage, Name) {
+ : GlobalValue(Ty, VTy, Ops, NumOps, Linkage, Name)
, ObjComdat(nullptr)
{
setGlobalValueSubClassData(0);
}
std::string Section; // Section to emit this into, empty means default
setGlobalValueSubClassData(0);
}
std::string Section; // Section to emit this into, empty means default
+ Comdat *ObjComdat;
+ static const unsigned AlignmentBits = 5;
+ static const unsigned GlobalObjectSubClassDataBits =
+ GlobalValueSubClassDataBits - AlignmentBits;
+
+private:
+ static const unsigned AlignmentMask = (1 << AlignmentBits) - 1;
+
public:
unsigned getAlignment() const {
public:
unsigned getAlignment() const {
- return (1u << getGlobalValueSubClassData()) >> 1;
+ unsigned Data = getGlobalValueSubClassData();
+ unsigned AlignmentData = Data & AlignmentMask;
+ return (1u << AlignmentData) >> 1;
}
void setAlignment(unsigned Align);
}
void setAlignment(unsigned Align);
+ unsigned getGlobalObjectSubClassData() const;
+ void setGlobalObjectSubClassData(unsigned Val);
+
bool hasSection() const { return !StringRef(getSection()).empty(); }
const char *getSection() const { return Section.c_str(); }
void setSection(StringRef S);
bool hasSection() const { return !StringRef(getSection()).empty(); }
const char *getSection() const { return Section.c_str(); }
void setSection(StringRef S);
+ bool hasComdat() const { return getComdat() != nullptr; }
+ const Comdat *getComdat() const { return ObjComdat; }
+ Comdat *getComdat() { return ObjComdat; }
+ void setComdat(Comdat *C) { ObjComdat = C; }
+
void copyAttributesFrom(const GlobalValue *Src) override;
// Methods for support type inquiry through isa, cast, and dyn_cast:
void copyAttributesFrom(const GlobalValue *Src) override;
// Methods for support type inquiry through isa, cast, and dyn_cast: