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

Unified Diff: src/PNaClTranslator.cpp

Issue 737513008: Subzero: Simplify the constant pools. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Better fix for the int8/uint8 tests Created 6 years, 1 month 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/IceTargetLoweringX8632.cpp ('k') | src/assembler_ia32.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/PNaClTranslator.cpp
diff --git a/src/PNaClTranslator.cpp b/src/PNaClTranslator.cpp
index 0f4feacafe5d2768bd8edae99a2ab2f6c5a65087..042b7fe723dac940836273f2f9da7e288db680cb 100644
--- a/src/PNaClTranslator.cpp
+++ b/src/PNaClTranslator.cpp
@@ -325,8 +325,8 @@ public:
SuppressMangling = false;
}
const Ice::RelocOffsetT Offset = 0;
- C = getTranslator().getContext()->getConstantSym(
- getIcePointerType(), Offset, Name, SuppressMangling);
+ C = getTranslator().getContext()->getConstantSym(Offset, Name,
+ SuppressMangling);
ValueIDConstants[ID] = C;
return C;
}
@@ -1440,7 +1440,7 @@ private:
const auto *C = dyn_cast<Ice::ConstantInteger32>(Index);
if (C == nullptr)
return VectorIndexNotConstant;
- if (C->getValue() >= typeNumElements(VecType))
+ if (static_cast<size_t>(C->getValue()) >= typeNumElements(VecType))
return VectorIndexNotInRange;
if (Index->getType() != Ice::IceType_i32)
return VectorIndexNotI32;
@@ -2496,16 +2496,14 @@ void ConstantsParser::ProcessRecord() {
FuncParser->setNextConstantID(nullptr);
return;
}
- if (IntegerType *IType = dyn_cast<IntegerType>(
+ if (auto IType = dyn_cast<IntegerType>(
Context->convertToLLVMType(NextConstantType))) {
APInt Value(IType->getBitWidth(), NaClDecodeSignRotatedValue(Values[0]));
- Ice::Constant *C = (NextConstantType == Ice::IceType_i64)
- ? getContext()->getConstantInt64(
- NextConstantType, Value.getSExtValue())
- : getContext()->getConstantInt32(
- NextConstantType, Value.getSExtValue());
- FuncParser->setNextConstantID(C);
- return;
+ if (Ice::Constant *C = getContext()->getConstantInt(
+ NextConstantType, Value.getSExtValue())) {
+ FuncParser->setNextConstantID(C);
+ return;
+ }
}
std::string Buffer;
raw_string_ostream StrBuf(Buffer);
« no previous file with comments | « src/IceTargetLoweringX8632.cpp ('k') | src/assembler_ia32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698