diff options
| author | Jay Foad <jay.foad@gmail.com> | 2011-08-01 12:20:36 +0000 |
|---|---|---|
| committer | Jay Foad <jay.foad@gmail.com> | 2011-08-01 12:20:36 +0000 |
| commit | 97c14a6b39569f71d95b9d705d1e26a8bbe368f5 (patch) | |
| tree | 3b66e1e475743e9887e40585e073ccb1b221090b | |
| parent | 0b099a432b2b25d2ccbfc4afe56323db4d7c617b (diff) | |
| download | bcm5719-llvm-97c14a6b39569f71d95b9d705d1e26a8bbe368f5.tar.gz bcm5719-llvm-97c14a6b39569f71d95b9d705d1e26a8bbe368f5.zip | |
The operands of a GlobalAlias are always Constants. Simplify things
accordingly.
llvm-svn: 136608
| -rw-r--r-- | llvm/include/llvm/GlobalAlias.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/include/llvm/GlobalAlias.h b/llvm/include/llvm/GlobalAlias.h index 33561b9dcec..5a814bf1029 100644 --- a/llvm/include/llvm/GlobalAlias.h +++ b/llvm/include/llvm/GlobalAlias.h @@ -23,7 +23,6 @@ namespace llvm { class Module; -class Constant; template<typename ValueSubClass, typename ItemParentClass> class SymbolTableListTraits; @@ -45,7 +44,7 @@ public: Constant* Aliasee = 0, Module *Parent = 0); /// Provide fast operand accessors - DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); + DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Constant); /// removeFromParent - This method unlinks 'this' from the containing module, /// but does not delete it. @@ -60,10 +59,10 @@ public: /// set/getAliasee - These methods retrive and set alias target. void setAliasee(Constant *GV); const Constant *getAliasee() const { - return cast_or_null<Constant>(getOperand(0)); + return getOperand(0); } Constant *getAliasee() { - return cast_or_null<Constant>(getOperand(0)); + return getOperand(0); } /// getAliasedGlobal() - Aliasee can be either global or bitcast of /// global. This method retrives the global for both aliasee flavours. @@ -88,7 +87,7 @@ struct OperandTraits<GlobalAlias> : public FixedNumOperandTraits<GlobalAlias, 1> { }; -DEFINE_TRANSPARENT_OPERAND_ACCESSORS(GlobalAlias, Value) +DEFINE_TRANSPARENT_CASTED_OPERAND_ACCESSORS(GlobalAlias, Constant) } // End llvm namespace |

