diff --git a/include/llvm/MC/MCSymbol.h b/include/llvm/MC/MCSymbol.h index 122e897a92d..37a2755328f 100644 --- a/include/llvm/MC/MCSymbol.h +++ b/include/llvm/MC/MCSymbol.h @@ -63,9 +63,16 @@ namespace llvm { /// @name Symbol Type /// @{ + /// isDefined - Check if this symbol is defined (i.e., it has an address). + /// + /// Defined symbols are either absolute or in some section. + bool isDefined() const { + return Section != 0; + } + /// isUndefined - Check if this symbol undefined (i.e., implicitly defined). bool isUndefined() const { - return Section == 0; + return !isDefined(); } /// isAbsolute - Check if this this is an absolute symbol.