mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Split GlobalValue into GlobalValue and GlobalObject.
This allows code to statically accept a Function or a GlobalVariable, but not an alias. This is already a cleanup by itself IMHO, but the main reason for it is that it gives a lot more confidence that the refactoring to fix the design of GlobalAlias is correct. That will be a followup patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208716 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -31,6 +31,7 @@ class Constant;
|
||||
class DataLayout;
|
||||
class Function;
|
||||
class GlobalAlias;
|
||||
class GlobalObject;
|
||||
class GlobalValue;
|
||||
class GlobalVariable;
|
||||
class InlineAsm;
|
||||
@@ -526,8 +527,13 @@ template <> struct isa_impl<GlobalAlias, Value> {
|
||||
|
||||
template <> struct isa_impl<GlobalValue, Value> {
|
||||
static inline bool doit(const Value &Val) {
|
||||
return isa<GlobalVariable>(Val) || isa<Function>(Val) ||
|
||||
isa<GlobalAlias>(Val);
|
||||
return isa<GlobalObject>(Val) || isa<GlobalAlias>(Val);
|
||||
}
|
||||
};
|
||||
|
||||
template <> struct isa_impl<GlobalObject, Value> {
|
||||
static inline bool doit(const Value &Val) {
|
||||
return isa<GlobalVariable>(Val) || isa<Function>(Val);
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user