aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/MC/MCSymbol.h
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2015-04-01 18:49:24 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-04-01 18:49:26 +0000
commit3fa16bd6062e23bcdb82ed4dd965674792e6b761 (patch)
tree9348fc507292f7e8715d22d64ce5a32131b4f875 /include/llvm/MC/MCSymbol.h
parentbeed47390a60f6f0c77532b3d3f76bb47ef49423 (diff)
parentebe69fe11e48d322045d5949c83283927a0d790b (diff)
downloadexternal_llvm-3fa16bd6062e23bcdb82ed4dd965674792e6b761.zip
external_llvm-3fa16bd6062e23bcdb82ed4dd965674792e6b761.tar.gz
external_llvm-3fa16bd6062e23bcdb82ed4dd965674792e6b761.tar.bz2
Merge "Update aosp/master LLVM for rebase to r230699."
Diffstat (limited to 'include/llvm/MC/MCSymbol.h')
-rw-r--r--include/llvm/MC/MCSymbol.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/include/llvm/MC/MCSymbol.h b/include/llvm/MC/MCSymbol.h
index 0b3c3ce..53443b0 100644
--- a/include/llvm/MC/MCSymbol.h
+++ b/include/llvm/MC/MCSymbol.h
@@ -53,6 +53,9 @@ namespace llvm {
/// "Lfoo" or ".foo".
unsigned IsTemporary : 1;
+ /// \brief True if this symbol can be redefined.
+ unsigned IsRedefinable : 1;
+
/// IsUsed - True if this symbol has been used.
mutable unsigned IsUsed : 1;
@@ -61,10 +64,10 @@ namespace llvm {
friend class MCContext;
MCSymbol(StringRef name, bool isTemporary)
: Name(name), Section(nullptr), Value(nullptr),
- IsTemporary(isTemporary), IsUsed(false) {}
+ IsTemporary(isTemporary), IsRedefinable(false), IsUsed(false) {}
- MCSymbol(const MCSymbol&) LLVM_DELETED_FUNCTION;
- void operator=(const MCSymbol&) LLVM_DELETED_FUNCTION;
+ MCSymbol(const MCSymbol&) = delete;
+ void operator=(const MCSymbol&) = delete;
public:
/// getName - Get the symbol name.
StringRef getName() const { return Name; }
@@ -79,6 +82,19 @@ namespace llvm {
bool isUsed() const { return IsUsed; }
void setUsed(bool Value) const { IsUsed = Value; }
+ /// \brief Check if this symbol is redefinable.
+ bool isRedefinable() const { return IsRedefinable; }
+ /// \brief Mark this symbol as redefinable.
+ void setRedefinable(bool Value) { IsRedefinable = Value; }
+ /// \brief Prepare this symbol to be redefined.
+ void redefineIfPossible() {
+ if (IsRedefinable) {
+ Value = nullptr;
+ Section = nullptr;
+ IsRedefinable = false;
+ }
+ }
+
/// @}
/// @name Associated Sections
/// @{