diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-04-29 12:46:50 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-04-29 12:46:50 +0000 |
commit | 1c5f439f417f7d60e399886e769fa59283a0913b (patch) | |
tree | 49c6e0b371c4dfcc2876f7c0f4199cdcf9adc3b2 /include/llvm | |
parent | 65baf804ba6ac8284c0e0f63c42cfb3b85aa89b0 (diff) | |
download | llvm-1c5f439f417f7d60e399886e769fa59283a0913b.tar.gz llvm-1c5f439f417f7d60e399886e769fa59283a0913b.tar.bz2 llvm-1c5f439f417f7d60e399886e769fa59283a0913b.tar.xz |
Centralize the handling of the thumb bit.
This patch centralizes the handling of the thumb bit around
MCStreamer::isThumbFunc and makes isThumbFunc handle aliases.
This fixes a corner case, but the main advantage is having just one
way to check if a MCSymbol is thumb or not. This should still be
refactored to be ARM only, but at least now it is just one predicate
that has to be refactored instead of 3 (isThumbFunc,
ELF_Other_ThumbFunc, and SF_ThumbFunc).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207522 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/MC/MCAssembler.h | 6 | ||||
-rw-r--r-- | include/llvm/MC/MCELFSymbolFlags.h | 8 |
2 files changed, 4 insertions, 10 deletions
diff --git a/include/llvm/MC/MCAssembler.h b/include/llvm/MC/MCAssembler.h index e71775a8c1..be13b3681e 100644 --- a/include/llvm/MC/MCAssembler.h +++ b/include/llvm/MC/MCAssembler.h @@ -902,7 +902,7 @@ private: // here. Maybe when the relocation stuff moves to target specific, // this can go with it? The streamer would need some target specific // refactoring too. - SmallPtrSet<const MCSymbol*, 64> ThumbFuncs; + mutable SmallPtrSet<const MCSymbol*, 64> ThumbFuncs; /// \brief The bundle alignment size currently set in the assembler. /// @@ -995,9 +995,7 @@ public: const MCAsmLayout &Layout) const; /// Check whether a given symbol has been flagged with .thumb_func. - bool isThumbFunc(const MCSymbol *Func) const { - return ThumbFuncs.count(Func); - } + bool isThumbFunc(const MCSymbol *Func) const; /// Flag a function symbol as the target of a .thumb_func directive. void setIsThumbFunc(const MCSymbol *Func) { ThumbFuncs.insert(Func); } diff --git a/include/llvm/MC/MCELFSymbolFlags.h b/include/llvm/MC/MCELFSymbolFlags.h index 5b82a58f40..2f1f561221 100644 --- a/include/llvm/MC/MCELFSymbolFlags.h +++ b/include/llvm/MC/MCELFSymbolFlags.h @@ -24,9 +24,7 @@ namespace llvm { ELF_STT_Shift = 0, // Shift value for STT_* flags. ELF_STB_Shift = 4, // Shift value for STB_* flags. ELF_STV_Shift = 8, // Shift value for STV_* flags. - ELF_STO_Shift = 10, // Shift value for STO_* flags. - ELF_Other_Shift = 16 // Shift value for llvm local flags, - // not part of the final object file + ELF_STO_Shift = 10 // Shift value for STO_* flags. }; enum ELFSymbolFlags { @@ -49,9 +47,7 @@ namespace llvm { ELF_STV_Default = (ELF::STV_DEFAULT << ELF_STV_Shift), ELF_STV_Internal = (ELF::STV_INTERNAL << ELF_STV_Shift), ELF_STV_Hidden = (ELF::STV_HIDDEN << ELF_STV_Shift), - ELF_STV_Protected = (ELF::STV_PROTECTED << ELF_STV_Shift), - - ELF_Other_ThumbFunc = (1 << ELF_Other_Shift) + ELF_STV_Protected = (ELF::STV_PROTECTED << ELF_STV_Shift) }; } // end namespace llvm |