aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/MC
diff options
context:
space:
mode:
authorJoerg Sonnenberger <joerg@bec.de>2013-10-29 01:06:17 +0000
committerJoerg Sonnenberger <joerg@bec.de>2013-10-29 01:06:17 +0000
commit72580780a98cb8b0019b7ec4ed88e3f3328b9969 (patch)
tree6d102a4a9edc24e52c439ea4420dbd1606770fe3 /include/llvm/MC
parent8ef9cebb68d6305e197c3e0b8369aa3c57570bbf (diff)
downloadexternal_llvm-72580780a98cb8b0019b7ec4ed88e3f3328b9969.zip
external_llvm-72580780a98cb8b0019b7ec4ed88e3f3328b9969.tar.gz
external_llvm-72580780a98cb8b0019b7ec4ed88e3f3328b9969.tar.bz2
Move the STT_FILE symbols out of the normal symbol table processing for
ELF. They can overlap with the other symbols, e.g. if a source file "foo.c" contains a function "foo" with a static variable "c". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193569 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/MC')
-rw-r--r--include/llvm/MC/MCAssembler.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/llvm/MC/MCAssembler.h b/include/llvm/MC/MCAssembler.h
index 38a70f0..8735a55 100644
--- a/include/llvm/MC/MCAssembler.h
+++ b/include/llvm/MC/MCAssembler.h
@@ -19,6 +19,7 @@
#include "llvm/MC/MCInst.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/DataTypes.h"
+#include <algorithm>
#include <vector> // FIXME: Shouldn't be needed.
namespace llvm {
@@ -816,6 +817,9 @@ public:
typedef SymbolDataListType::const_iterator const_symbol_iterator;
typedef SymbolDataListType::iterator symbol_iterator;
+ typedef std::vector<std::string> FileNameVectorType;
+ typedef FileNameVectorType::const_iterator const_file_name_iterator;
+
typedef std::vector<IndirectSymbolData>::const_iterator
const_indirect_symbol_iterator;
typedef std::vector<IndirectSymbolData>::iterator indirect_symbol_iterator;
@@ -859,6 +863,9 @@ private:
/// The list of linker options to propagate into the object file.
std::vector<std::vector<std::string> > LinkerOptions;
+ /// List of declared file names
+ FileNameVectorType FileNames;
+
/// The set of function symbols for which a .thumb_func directive has
/// been seen.
//
@@ -1152,6 +1159,20 @@ public:
return *Entry;
}
+ const_file_name_iterator file_names_begin() const {
+ return FileNames.begin();
+ }
+
+ const_file_name_iterator file_names_end() const {
+ return FileNames.end();
+ }
+
+ void addFileName(StringRef FileName) {
+ if (std::find(file_names_begin(), file_names_end(), FileName) ==
+ file_names_end())
+ FileNames.push_back(FileName);
+ }
+
/// @}
void dump();