From e1f62b247c1096b501951ac7253658334c038b65 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Wed, 26 Aug 2009 00:10:55 +0000 Subject: [PATCH] llvm-mc: Add MCSection::isDefined() git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80057 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/MC/MCSymbol.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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.