//
// The LLVM Compiler Infrastructure
//
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
class GlobalVariable : public GlobalValue {
friend class SymbolTableListTraits<GlobalVariable, Module>;
+ void *operator new(size_t, unsigned); // Do not implement
void operator=(const GlobalVariable &); // Do not implement
GlobalVariable(const GlobalVariable &); // Do not implement
Use Initializer;
public:
+ // allocate space for exactly zero operands
+ void *operator new(size_t s) {
+ return User::operator new(s, 0);
+ }
/// GlobalVariable ctor - If a parent module is specified, the global is
/// automatically inserted into the end of the specified modules global list.
GlobalVariable(const Type *Ty, bool isConstant, LinkageTypes Linkage,
Constant *Initializer = 0, const std::string &Name = "",
- Module *Parent = 0, bool ThreadLocal = false);
+ Module *Parent = 0, bool ThreadLocal = false,
+ unsigned AddressSpace = 0);
/// GlobalVariable ctor - This creates a global and inserts it before the
/// specified other global.
GlobalVariable(const Type *Ty, bool isConstant, LinkageTypes Linkage,
Constant *Initializer, const std::string &Name,
- GlobalVariable *InsertBefore, bool ThreadLocal = false);
+ GlobalVariable *InsertBefore, bool ThreadLocal = false,
+ unsigned AddressSpace = 0);
/// isDeclaration - Is this global variable lacking an initializer? If so,
/// the global variable is defined in some other translation unit, and is thus
}
}
- // getNext/Prev - Return the next or previous global variable in the list.
- GlobalVariable *getNext() { return Next; }
- const GlobalVariable *getNext() const { return Next; }
- GlobalVariable *getPrev() { return Prev; }
- const GlobalVariable *getPrev() const { return Prev; }
-
/// If the value is a global constant, its value is immutable throughout the
/// runtime execution of the program. Assigning a value into the constant
/// leads to undefined behavior.
static inline bool classof(const Value *V) {
return V->getValueID() == Value::GlobalVariableVal;
}
+private:
+ // getNext/Prev - Return the next or previous global variable in the list.
+ GlobalVariable *getNext() { return Next; }
+ const GlobalVariable *getNext() const { return Next; }
+ GlobalVariable *getPrev() { return Prev; }
+ const GlobalVariable *getPrev() const { return Prev; }
};
} // End llvm namespace