summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-06-01 01:52:18 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-06-01 01:52:18 +0000
commit26410148124b074a997a293e69ac0c01c62ce6e9 (patch)
treea23ef952a2e7a09741d8382d7eb04d2a57aafa48 /llvm
parentcc91cc1f3a531fafcfcc939b2146b17c5d6c2d48 (diff)
downloadbcm5719-llvm-26410148124b074a997a293e69ac0c01c62ce6e9.tar.gz
bcm5719-llvm-26410148124b074a997a293e69ac0c01c62ce6e9.zip
Rename HasData to IsRegistered.
There is no MCSectionData, so the old name is now meaningless. Also remove some asserts/checks that were there just because the information they used was in MCSectionData. llvm-svn: 238708
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/MC/MCAssembler.h4
-rw-r--r--llvm/include/llvm/MC/MCSymbol.h16
-rw-r--r--llvm/lib/MC/MCObjectStreamer.cpp4
-rw-r--r--llvm/lib/MC/WinCOFFObjectWriter.cpp2
4 files changed, 7 insertions, 19 deletions
diff --git a/llvm/include/llvm/MC/MCAssembler.h b/llvm/include/llvm/MC/MCAssembler.h
index 6b6e0dc19c9..d335db92d0c 100644
--- a/llvm/include/llvm/MC/MCAssembler.h
+++ b/llvm/include/llvm/MC/MCAssembler.h
@@ -911,11 +911,11 @@ public:
}
void registerSymbol(const MCSymbol &Symbol, bool *Created = nullptr) {
- bool New = !Symbol.hasData();
+ bool New = !Symbol.isRegistered();
if (Created)
*Created = New;
if (New) {
- Symbol.initializeData();
+ Symbol.setIsRegistered(true);
Symbols.push_back(&Symbol);
}
}
diff --git a/llvm/include/llvm/MC/MCSymbol.h b/llvm/include/llvm/MC/MCSymbol.h
index 355ed85deb5..3194ed1863b 100644
--- a/llvm/include/llvm/MC/MCSymbol.h
+++ b/llvm/include/llvm/MC/MCSymbol.h
@@ -63,7 +63,7 @@ class MCSymbol {
/// IsUsed - True if this symbol has been used.
mutable unsigned IsUsed : 1;
- mutable bool HasData : 1;
+ mutable bool IsRegistered : 1;
/// Index field, for use by the object file implementation.
mutable uint32_t Index = 0;
@@ -99,7 +99,7 @@ private: // MCContext creates and uniques these.
friend class MCContext;
MCSymbol(const StringMapEntry<bool> *Name, bool isTemporary)
: Name(Name), Section(nullptr), Value(nullptr), IsTemporary(isTemporary),
- IsRedefinable(false), IsUsed(false), HasData(false) {
+ IsRedefinable(false), IsUsed(false), IsRegistered(false) {
Offset = 0;
}
@@ -115,14 +115,8 @@ public:
/// getName - Get the symbol name.
StringRef getName() const { return Name ? Name->first() : ""; }
- bool hasData() const { return HasData; }
-
- /// Initialize symbol data.
- ///
- /// Nothing really to do here, but this is enables an assertion that \a
- /// MCAssembler::getOrCreateSymbolData() has actually been called before
- /// anyone calls \a getData().
- void initializeData() const { HasData = true; }
+ bool isRegistered() const { return IsRegistered; }
+ void setIsRegistered(bool Value) const { IsRegistered = Value; }
/// \name Accessors
/// @{
@@ -201,13 +195,11 @@ public:
/// Get the (implementation defined) index.
uint32_t getIndex() const {
- assert(HasData && "Uninitialized symbol data");
return Index;
}
/// Set the (implementation defined) index.
void setIndex(uint32_t Value) const {
- assert(HasData && "Uninitialized symbol data");
Index = Value;
}
diff --git a/llvm/lib/MC/MCObjectStreamer.cpp b/llvm/lib/MC/MCObjectStreamer.cpp
index a17e9ea01d5..6de02bcb02d 100644
--- a/llvm/lib/MC/MCObjectStreamer.cpp
+++ b/llvm/lib/MC/MCObjectStreamer.cpp
@@ -57,10 +57,6 @@ void MCObjectStreamer::flushPendingLabels(MCFragment *F, uint64_t FOffset) {
bool MCObjectStreamer::emitAbsoluteSymbolDiff(const MCSymbol *Hi,
const MCSymbol *Lo,
unsigned Size) {
- // Must have symbol data.
- if (!Hi->hasData() || !Lo->hasData())
- return false;
-
// Must both be assigned to the same (valid) fragment.
if (!Hi->getFragment() || Hi->getFragment() != Lo->getFragment())
return false;
diff --git a/llvm/lib/MC/WinCOFFObjectWriter.cpp b/llvm/lib/MC/WinCOFFObjectWriter.cpp
index a202fcd0f48..d1453fdaad9 100644
--- a/llvm/lib/MC/WinCOFFObjectWriter.cpp
+++ b/llvm/lib/MC/WinCOFFObjectWriter.cpp
@@ -706,7 +706,7 @@ void WinCOFFObjectWriter::RecordRelocation(
const MCSymbol &Symbol = Target.getSymA()->getSymbol();
const MCSymbol &A = Symbol;
- if (!A.hasData())
+ if (!A.isRegistered())
Asm.getContext().reportFatalError(Fixup.getLoc(),
Twine("symbol '") + A.getName() +
"' can not be undefined");
OpenPOWER on IntegriCloud