MC: clang-format MCContext. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237595 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jim Grosbach
2015-05-18 18:43:23 +00:00
parent 19696daa21
commit 7b81f734ee
2 changed files with 27 additions and 33 deletions

View File

@@ -47,8 +47,10 @@ namespace llvm {
class MCContext {
MCContext(const MCContext &) = delete;
MCContext &operator=(const MCContext &) = delete;
public:
typedef StringMap<MCSymbol *, BumpPtrAllocator &> SymbolTable;
private:
/// The SourceMgr for this object, if any.
const SourceMgr *SrcMgr;
@@ -280,9 +282,7 @@ namespace llvm {
/// want to, for example, iterate over all symbols. 'const' because we
/// still want any modifications to the table itself to use the MCContext
/// APIs.
const SymbolTable &getSymbols() const {
return Symbols;
}
const SymbolTable &getSymbols() const { return Symbols; }
/// @}
@@ -433,9 +433,7 @@ namespace llvm {
return true;
return false;
}
unsigned getDwarfCompileUnitID() {
return DwarfCompileUnitID;
}
unsigned getDwarfCompileUnitID() { return DwarfCompileUnitID; }
void setDwarfCompileUnitID(unsigned CUIndex) {
DwarfCompileUnitID = CUIndex;
}
@@ -502,18 +500,13 @@ namespace llvm {
char *getSecureLogFile() { return SecureLogFile; }
raw_ostream *getSecureLog() { return SecureLog; }
bool getSecureLogUsed() { return SecureLogUsed; }
void setSecureLog(raw_ostream *Value) {
SecureLog = Value;
}
void setSecureLogUsed(bool Value) {
SecureLogUsed = Value;
}
void setSecureLog(raw_ostream *Value) { SecureLog = Value; }
void setSecureLogUsed(bool Value) { SecureLogUsed = Value; }
void *allocate(unsigned Size, unsigned Align = 8) {
return Allocator.Allocate(Size, Align);
}
void deallocate(void *Ptr) {
}
void deallocate(void *Ptr) {}
// Unrecoverable error has occurred. Display the best diagnostic we can
// and bail via exit(1). For now, most MC backend errors are unrecoverable.

View File

@@ -275,7 +275,8 @@ void MCContext::renameELFSection(const MCSectionELF *Section, StringRef Name) {
ELFSectionKey{Section->getSectionName(), GroupName, UniqueID});
auto I = ELFUniquingMap.insert(std::make_pair(
ELFSectionKey{Name, GroupName, UniqueID},
Section)).first;
Section))
.first;
StringRef CachedName = I->first.SectionName;
const_cast<MCSectionELF *>(Section)->setSectionName(CachedName);
}