Object/COFF: Add COFFSymbolRef::isAbsolute().
authorRui Ueyama <ruiu@google.com>
Tue, 26 May 2015 20:25:30 +0000 (20:25 +0000)
committerRui Ueyama <ruiu@google.com>
Tue, 26 May 2015 20:25:30 +0000 (20:25 +0000)
COFFSymbolRef has many predicates, like isCommon() or
isExternal(), but this predicate was missing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238247 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Object/COFF.h

index 9664c3b03c95ba6cb40a6be492f0170de0c36378..b28cec4864473b0078ed2d0a6c899e2edf57f5c0 100644 (file)
@@ -314,6 +314,10 @@ public:
     return (getType() & 0xF0) >> COFF::SCT_COMPLEX_TYPE_SHIFT;
   }
 
     return (getType() & 0xF0) >> COFF::SCT_COMPLEX_TYPE_SHIFT;
   }
 
+  bool isAbsolute() const {
+    return getSectionNumber() == -1;
+  }
+
   bool isExternal() const {
     return getStorageClass() == COFF::IMAGE_SYM_CLASS_EXTERNAL;
   }
   bool isExternal() const {
     return getStorageClass() == COFF::IMAGE_SYM_CLASS_EXTERNAL;
   }