diff options
author | Chris Lattner <sabre@nondot.org> | 2010-02-11 21:27:18 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-02-11 21:27:18 +0000 |
commit | ddeceae839fc93673455ecca23839b84b606af98 (patch) | |
tree | 888fc52f6aa194c9ff665bfa745d663ec417e724 /llvm/lib/MC/MCAsmStreamer.cpp | |
parent | e8ac42ad5c46c7d368457689a668aa9488f6ebc3 (diff) | |
download | bcm5719-llvm-ddeceae839fc93673455ecca23839b84b606af98.tar.gz bcm5719-llvm-ddeceae839fc93673455ecca23839b84b606af98.zip |
make getFixupKindInfo return a const reference, allowing
the tables to be const. Teach MCCodeEmitter to handle
the target-indep kinds so that we don't crash on them.
llvm-svn: 95924
Diffstat (limited to 'llvm/lib/MC/MCAsmStreamer.cpp')
-rw-r--r-- | llvm/lib/MC/MCAsmStreamer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/MC/MCAsmStreamer.cpp b/llvm/lib/MC/MCAsmStreamer.cpp index 828377f42cc..2a8f168f931 100644 --- a/llvm/lib/MC/MCAsmStreamer.cpp +++ b/llvm/lib/MC/MCAsmStreamer.cpp @@ -552,7 +552,7 @@ void MCAsmStreamer::AddEncodingComment(const MCInst &Inst) { for (unsigned i = 0, e = Fixups.size(); i != e; ++i) { MCFixup &F = Fixups[i]; - MCFixupKindInfo &Info = Emitter->getFixupKindInfo(F.getKind()); + const MCFixupKindInfo &Info = Emitter->getFixupKindInfo(F.getKind()); for (unsigned j = 0; j != Info.TargetSize; ++j) { unsigned Index = F.getOffset() * 8 + Info.TargetOffset + j; assert(Index < Code.size() * 8 && "Invalid offset in fixup!"); @@ -599,7 +599,7 @@ void MCAsmStreamer::AddEncodingComment(const MCInst &Inst) { for (unsigned i = 0, e = Fixups.size(); i != e; ++i) { MCFixup &F = Fixups[i]; - MCFixupKindInfo &Info = Emitter->getFixupKindInfo(F.getKind()); + const MCFixupKindInfo &Info = Emitter->getFixupKindInfo(F.getKind()); OS << " fixup " << char('A' + i) << " - " << "offset: " << F.getOffset() << ", value: " << *F.getValue() << ", kind: " << Info.Name << "\n"; } |