summaryrefslogtreecommitdiffstats
path: root/llvm/include
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
commitfc184734009df551eb36e80396875cc9a2ec4acf (patch)
tree1243a1f280d31e97aadc96ab2a083a8b76639eda /llvm/include
parent4a841a86bd8ad8f9af8320bcbb1beeedb5c443c1 (diff)
downloadbcm5719-llvm-fc184734009df551eb36e80396875cc9a2ec4acf.tar.gz
bcm5719-llvm-fc184734009df551eb36e80396875cc9a2ec4acf.zip
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". llvm-svn: 193569
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/MC/MCAssembler.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/include/llvm/MC/MCAssembler.h b/llvm/include/llvm/MC/MCAssembler.h
index 38a70f0adf0..8735a55ce04 100644
--- a/llvm/include/llvm/MC/MCAssembler.h
+++ b/llvm/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();
OpenPOWER on IntegriCloud