summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/COFFObjectFile.cpp
diff options
context:
space:
mode:
authorDavid Meyer <pdox@google.com>2012-02-28 23:47:53 +0000
committerDavid Meyer <pdox@google.com>2012-02-28 23:47:53 +0000
commit1df4b84db412a72dd43b473d1291baf21fd3f8d1 (patch)
treed210c64af472199d842082553cdf6341c01a4de9 /llvm/lib/Object/COFFObjectFile.cpp
parentfcbfdee5dfb456e31a4e20d392ab23273aa59c07 (diff)
downloadbcm5719-llvm-1df4b84db412a72dd43b473d1291baf21fd3f8d1.tar.gz
bcm5719-llvm-1df4b84db412a72dd43b473d1291baf21fd3f8d1.zip
In the ObjectFile interface, replace isInternal(), isAbsolute(), isGlobal(), and isWeak(), with a bitset of flags.
llvm-svn: 151670
Diffstat (limited to 'llvm/lib/Object/COFFObjectFile.cpp')
-rw-r--r--llvm/lib/Object/COFFObjectFile.cpp37
1 files changed, 15 insertions, 22 deletions
diff --git a/llvm/lib/Object/COFFObjectFile.cpp b/llvm/lib/Object/COFFObjectFile.cpp
index a2dad41818e..bf278785e68 100644
--- a/llvm/lib/Object/COFFObjectFile.cpp
+++ b/llvm/lib/Object/COFFObjectFile.cpp
@@ -159,17 +159,23 @@ error_code COFFObjectFile::getSymbolType(DataRefImpl Symb,
return object_error::success;
}
-error_code COFFObjectFile::isSymbolGlobal(DataRefImpl Symb,
- bool &Result) const {
+error_code COFFObjectFile::getSymbolFlags(DataRefImpl Symb,
+ uint32_t &Result) const {
const coff_symbol *symb = toSymb(Symb);
- Result = (symb->StorageClass == COFF::IMAGE_SYM_CLASS_EXTERNAL);
- return object_error::success;
-}
+ Result = SymbolRef::SF_None;
+
+ // TODO: Set SF_FormatSpecific.
+
+ // TODO: This are certainly too restrictive.
+ if (symb->StorageClass == COFF::IMAGE_SYM_CLASS_EXTERNAL)
+ Result |= SymbolRef::SF_Global;
+
+ if (symb->StorageClass == COFF::IMAGE_SYM_CLASS_WEAK_EXTERNAL)
+ Result |= SymbolRef::SF_Weak;
+
+ if (symb->SectionNumber == COFF::IMAGE_SYM_ABSOLUTE)
+ Result |= SymbolRef::SF_Absolute;
-error_code COFFObjectFile::isSymbolWeak(DataRefImpl Symb,
- bool &Result) const {
- const coff_symbol *symb = toSymb(Symb);
- Result = (symb->StorageClass == COFF::IMAGE_SYM_CLASS_WEAK_EXTERNAL);
return object_error::success;
}
@@ -262,19 +268,6 @@ error_code COFFObjectFile::getSymbolNMTypeChar(DataRefImpl Symb,
return object_error::success;
}
-error_code COFFObjectFile::isSymbolInternal(DataRefImpl Symb,
- bool &Result) const {
- Result = false;
- return object_error::success;
-}
-
-error_code COFFObjectFile::isSymbolAbsolute(DataRefImpl Symb,
- bool &Result) const {
- const coff_symbol *symb = toSymb(Symb);
- Result = symb->SectionNumber == COFF::IMAGE_SYM_ABSOLUTE;
- return object_error::success;
-}
-
error_code COFFObjectFile::getSymbolSection(DataRefImpl Symb,
section_iterator &Result) const {
const coff_symbol *symb = toSymb(Symb);
OpenPOWER on IntegriCloud