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

Unified Diff: src/IceFixups.cpp

Issue 1017373002: Subzero: Assemble calls to constant addresses. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: move test back Created 5 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/IceFixups.h ('k') | src/IceInstX8632.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceFixups.cpp
diff --git a/src/IceFixups.cpp b/src/IceFixups.cpp
index 52bb0dd1c1de4fad4be4e5d588aaed33a8a667f1..05559c56fe8462ccc877be426dd4bf3bfa1ccf12 100644
--- a/src/IceFixups.cpp
+++ b/src/IceFixups.cpp
@@ -17,7 +17,11 @@
namespace Ice {
+const Constant *AssemblerFixup::NullSymbol = nullptr;
+
RelocOffsetT AssemblerFixup::offset() const {
+ if (isNullSymbol())
+ return 0;
if (const auto CR = llvm::dyn_cast<ConstantRelocatable>(value_))
return CR->getOffset();
return 0;
@@ -27,6 +31,7 @@ IceString AssemblerFixup::symbol(const GlobalContext *Ctx) const {
std::string Buffer;
llvm::raw_string_ostream Str(Buffer);
const Constant *C = value_;
+ assert(!isNullSymbol());
if (const auto CR = llvm::dyn_cast<ConstantRelocatable>(C)) {
if (CR->getSuppressMangling())
Str << CR->getName();
@@ -43,6 +48,9 @@ IceString AssemblerFixup::symbol(const GlobalContext *Ctx) const {
void AssemblerFixup::emit(GlobalContext *Ctx) const {
Ostream &Str = Ctx->getStrEmit();
+ // TODO(jvoung): Not yet clear how to emit a relocation against
+ // the null symbol.
+ assert(!isNullSymbol());
Str << symbol(Ctx);
RelocOffsetT Offset = offset();
if (Offset)
« no previous file with comments | « src/IceFixups.h ('k') | src/IceInstX8632.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698