Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: src/IceInstX8664.cpp

Issue 1838753002: Subzero: Remove IceString. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceInstMIPS32.cpp ('k') | src/IceInstX86Base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInstX8664.cpp
diff --git a/src/IceInstX8664.cpp b/src/IceInstX8664.cpp
index bbcb0804f681f4d27f76294eea59b2a9753d5deb..ec2d140613fb6b5d5a8372d87f9ddaa9a8c2ccdf 100644
--- a/src/IceInstX8664.cpp
+++ b/src/IceInstX8664.cpp
@@ -138,12 +138,11 @@ void TargetX8664Traits::X86OperandMem::emit(const Cfg *Func) const {
CR->emitWithoutPrefix(Target, UseNonsfi ? "@GOTOFF" : "");
assert(!UseNonsfi);
if (Base == nullptr && Index == nullptr) {
- if (CR->getName() != "") { // rip-relative addressing.
- if (NeedSandboxing) {
- Str << "(%rip)";
- } else {
- Str << "(%eip)";
- }
+ // rip-relative addressing.
+ if (NeedSandboxing) {
+ Str << "(%rip)";
+ } else {
+ Str << "(%eip)";
}
}
} else {
@@ -167,8 +166,8 @@ void TargetX8664Traits::X86OperandMem::emit(const Cfg *Func) const {
assert(Base->getRegNum() == RegX8664::Encoded_Reg_rsp ||
Base->getRegNum() == RegX8664::Encoded_Reg_rbp ||
getType() == IceType_void);
- B = B->asType(IceType_i32, X8664::Traits::getGprForType(
- IceType_i32, Base->getRegNum()));
+ B = B->asType(Func, IceType_i32, X8664::Traits::getGprForType(
+ IceType_i32, Base->getRegNum()));
}
}
@@ -267,13 +266,11 @@ TargetX8664Traits::Address TargetX8664Traits::X86OperandMem::toAsmAddress(
Disp += static_cast<int32_t>(CI->getValue());
} else if (const auto *CR =
llvm::dyn_cast<ConstantRelocatable>(getOffset())) {
- if (CR->getName() != "") {
- const auto FixupKind =
- (getBase() != nullptr || getIndex() != nullptr) ? FK_Abs : FK_PcRel;
- const RelocOffsetT DispAdjustment = FixupKind == FK_PcRel ? 4 : 0;
- Fixup = Asm->createFixup(FixupKind, CR);
- Fixup->set_addend(-DispAdjustment);
- }
+ const auto FixupKind =
+ (getBase() != nullptr || getIndex() != nullptr) ? FK_Abs : FK_PcRel;
+ const RelocOffsetT DispAdjustment = FixupKind == FK_PcRel ? 4 : 0;
+ Fixup = Asm->createFixup(FixupKind, CR);
+ Fixup->set_addend(-DispAdjustment);
Disp = CR->getOffset();
} else {
llvm_unreachable("Unexpected offset type");
« no previous file with comments | « src/IceInstMIPS32.cpp ('k') | src/IceInstX86Base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698