Object: Abstract out the determination of function line symbols
authorDavid Majnemer <david.majnemer@gmail.com>
Thu, 20 Mar 2014 06:28:55 +0000 (06:28 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Thu, 20 Mar 2014 06:28:55 +0000 (06:28 +0000)
No functionality change.

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

include/llvm/Object/COFF.h
tools/obj2yaml/coff2yaml.cpp

index 0f24c1b8e51eeab9b7122c7d07ee1a47cf77bcb8..31b7d6ea174fcbf59f6d637dc5d75e31ff09ecc8 100644 (file)
@@ -210,6 +210,10 @@ struct coff_symbol {
            !COFF::isReservedSectionNumber(SectionNumber);
   }
 
+  bool isFunctionLineInfo() const {
+    return StorageClass == COFF::IMAGE_SYM_CLASS_FUNCTION;
+  }
+
   bool isWeakExternal() const {
     return StorageClass == COFF::IMAGE_SYM_CLASS_WEAK_EXTERNAL ||
            (StorageClass == COFF::IMAGE_SYM_CLASS_EXTERNAL &&
index b003029407ca71d25473845ef2f3e2483761c489..1542506e5f9b8be83d7555aa985e7ea244c527b1 100644 (file)
@@ -157,7 +157,7 @@ void COFFDumper::dumpSymbols(unsigned NumSymbols) {
             reinterpret_cast<const object::coff_aux_function_definition *>(
                 AuxData.data());
         dumpFunctionDefinition(&Sym, ObjFD);
-      } else if (Symbol->StorageClass == COFF::IMAGE_SYM_CLASS_FUNCTION) {
+      } else if (Symbol->isFunctionLineInfo()) {
         // This symbol describes function line number information.
         assert(Symbol->NumberOfAuxSymbols == 1 &&
                "Exepected a single aux symbol to describe this section!");