Commit f5fdd236 by Jim Stichnoth

Subzero: Update for LLVM 3.9 (trunk).

The purpose is to allow pnacl-sz to be built within an LLVM checkout (version 3.9 or later), and not require the complex PNaCl build environment. Within an LLVM checkout, one would do something like the following: cd projects git clone https://chromium.googlesource.com/native_client/pnacl-subzero # change to LLVM build directory cmake -G "Ninja" <path_to_llvm_source_dir> ninja A follow-on CL will add in the PNaCl bitcode reader source files that are needed for compiling and linking. BUG= none R=jpp@chromium.org Review URL: https://codereview.chromium.org/1961743002 .
parent 38dcb59d
...@@ -35,4 +35,11 @@ else() ...@@ -35,4 +35,11 @@ else()
add_compile_options(-Wno-undefined-var-template) add_compile_options(-Wno-undefined-var-template)
endif() endif()
# Define PNACL_LLVM for LLVM_VERSION <= 3.7
if((NOT LLVM_VERSION_MAJOR GREATER 3) AND (NOT LLVM_VERSION_MINOR GREATER 7))
add_definitions(
-DPNACL_LLVM
)
endif()
target_link_libraries(pnacl-sz pthread) target_link_libraries(pnacl-sz pthread)
...@@ -29,3 +29,5 @@ else ...@@ -29,3 +29,5 @@ else
-DALLOW_WASM=0 -DPNACL_BROWSER_TRANSLATOR=0 -DALLOW_WASM=0 -DPNACL_BROWSER_TRANSLATOR=0
CXX.Flags += -Wno-undefined-var-template CXX.Flags += -Wno-undefined-var-template
endif endif
CPP.Defines += -DPNACL_LLVM
...@@ -110,6 +110,8 @@ ifdef SZTARGET ...@@ -110,6 +110,8 @@ ifdef SZTARGET
BASE_CXX_DEFINES += -DSZTARGET=$(SZTARGET) BASE_CXX_DEFINES += -DSZTARGET=$(SZTARGET)
endif endif
BASE_CXX_DEFINES += -DPNACL_LLVM
CXX_DEFINES := $(BASE_CXX_DEFINES) -DPNACL_BROWSER_TRANSLATOR=0 CXX_DEFINES := $(BASE_CXX_DEFINES) -DPNACL_BROWSER_TRANSLATOR=0
ifdef NOASSERT ifdef NOASSERT
......
...@@ -260,6 +260,14 @@ template <template <typename> class AT> class BitVectorTmpl { ...@@ -260,6 +260,14 @@ template <template <typename> class AT> class BitVectorTmpl {
unsigned Capacity; // Size of allocated memory in BitWord. unsigned Capacity; // Size of allocated memory in BitWord.
Allocator Alloc; Allocator Alloc;
uint64_t alignTo(uint64_t Value, uint64_t Align) {
#ifdef PNACL_LLVM
return llvm::RoundUpToAlignment(Value, Align);
#else // !PNACL_LLVM
return llvm::alignTo(Value, Align);
#endif // !PNACL_LLVM
}
public: public:
typedef unsigned size_type; typedef unsigned size_type;
// Encapsulation of a single bit. // Encapsulation of a single bit.
...@@ -469,7 +477,7 @@ public: ...@@ -469,7 +477,7 @@ public:
BitWord PrefixMask = ~0UL << (I % BITWORD_SIZE); BitWord PrefixMask = ~0UL << (I % BITWORD_SIZE);
Bits[I / BITWORD_SIZE] |= PrefixMask; Bits[I / BITWORD_SIZE] |= PrefixMask;
I = llvm::RoundUpToAlignment(I, BITWORD_SIZE); I = alignTo(I, BITWORD_SIZE);
for (; I + BITWORD_SIZE <= E; I += BITWORD_SIZE) for (; I + BITWORD_SIZE <= E; I += BITWORD_SIZE)
Bits[I / BITWORD_SIZE] = ~0UL; Bits[I / BITWORD_SIZE] = ~0UL;
...@@ -509,7 +517,7 @@ public: ...@@ -509,7 +517,7 @@ public:
BitWord PrefixMask = ~0UL << (I % BITWORD_SIZE); BitWord PrefixMask = ~0UL << (I % BITWORD_SIZE);
Bits[I / BITWORD_SIZE] &= ~PrefixMask; Bits[I / BITWORD_SIZE] &= ~PrefixMask;
I = llvm::RoundUpToAlignment(I, BITWORD_SIZE); I = alignTo(I, BITWORD_SIZE);
for (; I + BITWORD_SIZE <= E; I += BITWORD_SIZE) for (; I + BITWORD_SIZE <= E; I += BITWORD_SIZE)
Bits[I / BITWORD_SIZE] = 0UL; Bits[I / BITWORD_SIZE] = 0UL;
......
...@@ -1102,7 +1102,7 @@ void Cfg::materializeVectorShuffles() { ...@@ -1102,7 +1102,7 @@ void Cfg::materializeVectorShuffles() {
Instr.setDeleted(); Instr.setDeleted();
auto &LoweringContext = getTarget()->getContext(); auto &LoweringContext = getTarget()->getContext();
LoweringContext.setInsertPoint(Instr); LoweringContext.setInsertPoint(instToIterator(&Instr));
LoweringContext.insert(ShuffleVector); LoweringContext.insert(ShuffleVector);
} }
} }
......
...@@ -1342,7 +1342,7 @@ void CfgNode::emitIAS(Cfg *Func) const { ...@@ -1342,7 +1342,7 @@ void CfgNode::emitIAS(Cfg *Func) const {
I->emitIAS(Func); I->emitIAS(Func);
// Only update stats during the final pass. // Only update stats during the final pass.
if (Retrying) if (Retrying)
updateStats(Func, I); updateStats(Func, iteratorToInst(I));
} else { } else {
// Treat it as though there were an implicit bundle_lock and // Treat it as though there were an implicit bundle_lock and
// bundle_unlock wrapping the instruction. // bundle_unlock wrapping the instruction.
...@@ -1352,7 +1352,7 @@ void CfgNode::emitIAS(Cfg *Func) const { ...@@ -1352,7 +1352,7 @@ void CfgNode::emitIAS(Cfg *Func) const {
Helper.rollback(); Helper.rollback();
Helper.padToNextBundle(); Helper.padToNextBundle();
I->emitIAS(Func); I->emitIAS(Func);
updateStats(Func, I); updateStats(Func, iteratorToInst(I));
Helper.leaveBundleLockRegion(); Helper.leaveBundleLockRegion();
} }
} }
......
...@@ -163,6 +163,10 @@ template <> struct ToSetterParam<cl::list<Ice::VerboseItem>> { ...@@ -163,6 +163,10 @@ template <> struct ToSetterParam<cl::list<Ice::VerboseItem>> {
using ReturnType = Ice::VerboseMask; using ReturnType = Ice::VerboseMask;
}; };
template <> struct ToSetterParam<cl::list<std::string>> {
using ReturnType = std::vector<std::string>;
};
template <typename T> template <typename T>
typename ToSetterParam<T>::ReturnType toSetterParam(const T &Param) { typename ToSetterParam<T>::ReturnType toSetterParam(const T &Param) {
return Param; return Param;
...@@ -181,6 +185,12 @@ toSetterParam(const cl::list<Ice::VerboseItem> &Param) { ...@@ -181,6 +185,12 @@ toSetterParam(const cl::list<Ice::VerboseItem> &Param) {
return VMask; return VMask;
} }
template <>
ToSetterParam<cl::list<std::string>>::ReturnType
toSetterParam(const cl::list<std::string> &Param) {
return *&Param;
}
} // end of anonymous namespace } // end of anonymous namespace
void ClFlags::getParsedClFlags(ClFlags &OutFlags) { void ClFlags::getParsedClFlags(ClFlags &OutFlags) {
......
...@@ -36,6 +36,20 @@ ...@@ -36,6 +36,20 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
#ifndef PNACL_LLVM
namespace llvm {
// \brief Define the expected format of the file.
enum NaClFileFormat {
// LLVM IR source or bitcode file (as appropriate).
LLVMFormat,
// PNaCl bitcode file.
PNaClFormat,
// Autodetect if PNaCl or LLVM format.
AutodetectFileFormat
};
} // end of namespace llvm
#endif // !PNACL_LLVM
namespace Ice { namespace Ice {
// detail defines the type cl_type_traits, which is used to define the // detail defines the type cl_type_traits, which is used to define the
// getters/setters for the ClFlags class. It converts the cl_detail::*_flag // getters/setters for the ClFlags class. It converts the cl_detail::*_flag
......
...@@ -50,7 +50,12 @@ class TextDataStreamer : public llvm::DataStreamer { ...@@ -50,7 +50,12 @@ class TextDataStreamer : public llvm::DataStreamer {
public: public:
TextDataStreamer() = default; TextDataStreamer() = default;
~TextDataStreamer() final = default; ~TextDataStreamer() final = default;
static TextDataStreamer *create(const std::string &Filename, #ifdef PNACL_LLVM
using CreateType = TextDataStreamer *;
#else // !PNACL_LLVM
using CreateType = std::unique_ptr<TextDataStreamer>;
#endif // !PNACL_LLVM
static CreateType create(const std::string &Filename,
std::string *Err); std::string *Err);
size_t GetBytes(unsigned char *Buf, size_t Len) final; size_t GetBytes(unsigned char *Buf, size_t Len) final;
...@@ -59,8 +64,9 @@ private: ...@@ -59,8 +64,9 @@ private:
size_t Cursor = 0; size_t Cursor = 0;
}; };
TextDataStreamer *TextDataStreamer::create(const std::string &Filename, TextDataStreamer::CreateType TextDataStreamer::create(const std::string &Filename,
std::string *Err) { std::string *Err) {
#ifdef PNACL_LLVM
TextDataStreamer *Streamer = new TextDataStreamer(); TextDataStreamer *Streamer = new TextDataStreamer();
llvm::raw_string_ostream ErrStrm(*Err); llvm::raw_string_ostream ErrStrm(*Err);
if (std::error_code EC = llvm::readNaClRecordTextAndBuildBitcode( if (std::error_code EC = llvm::readNaClRecordTextAndBuildBitcode(
...@@ -72,6 +78,9 @@ TextDataStreamer *TextDataStreamer::create(const std::string &Filename, ...@@ -72,6 +78,9 @@ TextDataStreamer *TextDataStreamer::create(const std::string &Filename,
} }
ErrStrm.flush(); ErrStrm.flush();
return Streamer; return Streamer;
#else // !PNACL_LLVM
return CreateType();
#endif // !PNACL_LLVM
} }
size_t TextDataStreamer::GetBytes(unsigned char *Buf, size_t Len) { size_t TextDataStreamer::GetBytes(unsigned char *Buf, size_t Len) {
......
...@@ -86,8 +86,11 @@ void Compiler::run(const Ice::ClFlags &Flags, GlobalContext &Ctx, ...@@ -86,8 +86,11 @@ void Compiler::run(const Ice::ClFlags &Flags, GlobalContext &Ctx,
const bool WasmBuildOnRead = Flags.getBuildOnRead() && wasmInput(IRFilename); const bool WasmBuildOnRead = Flags.getBuildOnRead() && wasmInput(IRFilename);
if (BuildOnRead) { if (BuildOnRead) {
std::unique_ptr<PNaClTranslator> PTranslator(new PNaClTranslator(&Ctx)); std::unique_ptr<PNaClTranslator> PTranslator(new PNaClTranslator(&Ctx));
std::unique_ptr<llvm::StreamingMemoryObject> MemObj( #ifdef PNACL_LLVM
new llvm::StreamingMemoryObjectImpl(InputStream.release())); std::unique_ptr<llvm::StreamingMemoryObject> MemObj(new llvm::StreamingMemoryObjectImpl(InputStream.release()));
#else // !PNACL_LLVM
std::unique_ptr<llvm::StreamingMemoryObject> MemObj(new llvm::StreamingMemoryObject(std::move(InputStream)));
#endif // !PNACL_LLVM
PTranslator->translate(IRFilename, std::move(MemObj)); PTranslator->translate(IRFilename, std::move(MemObj));
Translator.reset(PTranslator.release()); Translator.reset(PTranslator.release());
} else if (WasmBuildOnRead) { } else if (WasmBuildOnRead) {
...@@ -120,6 +123,7 @@ void Compiler::run(const Ice::ClFlags &Flags, GlobalContext &Ctx, ...@@ -120,6 +123,7 @@ void Compiler::run(const Ice::ClFlags &Flags, GlobalContext &Ctx,
// Parse the input LLVM IR file into a module. // Parse the input LLVM IR file into a module.
llvm::SMDiagnostic Err; llvm::SMDiagnostic Err;
TimerMarker T1(Ice::TimerStack::TT_parse, &Ctx); TimerMarker T1(Ice::TimerStack::TT_parse, &Ctx);
#ifdef PNACL_LLVM
llvm::DiagnosticHandlerFunction DiagnosticHandler = llvm::DiagnosticHandlerFunction DiagnosticHandler =
Flags.getLLVMVerboseErrors() Flags.getLLVMVerboseErrors()
? redirectNaClDiagnosticToStream(llvm::errs()) ? redirectNaClDiagnosticToStream(llvm::errs())
...@@ -127,6 +131,12 @@ void Compiler::run(const Ice::ClFlags &Flags, GlobalContext &Ctx, ...@@ -127,6 +131,12 @@ void Compiler::run(const Ice::ClFlags &Flags, GlobalContext &Ctx,
std::unique_ptr<llvm::Module> Mod = std::unique_ptr<llvm::Module> Mod =
NaClParseIRFile(IRFilename, Flags.getInputFileFormat(), Err, NaClParseIRFile(IRFilename, Flags.getInputFileFormat(), Err,
llvm::getGlobalContext(), DiagnosticHandler); llvm::getGlobalContext(), DiagnosticHandler);
#else // !PNACL_LLVM
llvm::DiagnosticHandlerFunction DiagnosticHandler = nullptr;
llvm::LLVMContext Context;
std::unique_ptr<llvm::Module> Mod =
parseIRFile(IRFilename, Err, Context);
#endif // !PNACL_LLVM
if (!Mod) { if (!Mod) {
Err.print(Flags.getAppName().c_str(), llvm::errs()); Err.print(Flags.getAppName().c_str(), llvm::errs());
Ctx.getErrorStatus()->assign(EC_Bitcode); Ctx.getErrorStatus()->assign(EC_Bitcode);
......
...@@ -111,7 +111,7 @@ public: ...@@ -111,7 +111,7 @@ public:
// The initial definition/use of each arg is the entry node. // The initial definition/use of each arg is the entry node.
for (auto ArgI = F->arg_begin(), ArgE = F->arg_end(); ArgI != ArgE; for (auto ArgI = F->arg_begin(), ArgE = F->arg_end(); ArgI != ArgE;
++ArgI) { ++ArgI) {
Func->addArg(mapValueToIceVar(ArgI)); Func->addArg(mapValueToIceVar(&*ArgI));
} }
// Make an initial pass through the block list just to resolve the blocks // Make an initial pass through the block list just to resolve the blocks
...@@ -708,7 +708,7 @@ void LLVM2ICEGlobalsConverter::convertGlobalsToIce(Module *Mod) { ...@@ -708,7 +708,7 @@ void LLVM2ICEGlobalsConverter::convertGlobalsToIce(Module *Mod) {
E = Mod->global_end(); E = Mod->global_end();
I != E; ++I) { I != E; ++I) {
const GlobalVariable *GV = I; const GlobalVariable *GV = &*I;
Ice::GlobalDeclaration *Var = getConverter().getGlobalDeclaration(GV); Ice::GlobalDeclaration *Var = getConverter().getGlobalDeclaration(GV);
auto *VarDecl = cast<Ice::VariableDeclaration>(Var); auto *VarDecl = cast<Ice::VariableDeclaration>(Var);
...@@ -888,7 +888,7 @@ void Converter::installGlobalDeclarations(Module *Mod) { ...@@ -888,7 +888,7 @@ void Converter::installGlobalDeclarations(Module *Mod) {
for (Module::const_global_iterator I = Mod->global_begin(), for (Module::const_global_iterator I = Mod->global_begin(),
E = Mod->global_end(); E = Mod->global_end();
I != E; ++I) { I != E; ++I) {
const GlobalVariable *GV = I; const GlobalVariable *GV = &*I;
constexpr bool NoSuppressMangling = false; constexpr bool NoSuppressMangling = false;
auto *Var = VariableDeclaration::create( auto *Var = VariableDeclaration::create(
GlobalDeclarationsPool.get(), NoSuppressMangling, GV->getLinkage()); GlobalDeclarationsPool.get(), NoSuppressMangling, GV->getLinkage());
......
...@@ -1131,4 +1131,24 @@ private: ...@@ -1131,4 +1131,24 @@ private:
} // end of namespace llvm } // end of namespace llvm
namespace Ice {
inline InstList::iterator instToIterator(Inst *Instr) {
#ifdef PNACL_LLVM
return Instr;
#else // !PNACL_LLVM
return Instr->getIterator();
#endif // !PNACL_LLVM
}
inline Inst *iteratorToInst(InstList::iterator Iter) {
return &*Iter;
}
inline const Inst *iteratorToInst(InstList::const_iterator Iter) {
return &*Iter;
}
} // end of namespace Ice
#endif // SUBZERO_SRC_ICEINST_H #endif // SUBZERO_SRC_ICEINST_H
...@@ -338,7 +338,7 @@ void TargetLowering::genTargetHelperCalls() { ...@@ -338,7 +338,7 @@ void TargetLowering::genTargetHelperCalls() {
Context.init(Node); Context.init(Node);
while (!Context.atEnd()) { while (!Context.atEnd()) {
PostIncrLoweringContext _(Context); PostIncrLoweringContext _(Context);
genTargetHelperCallFor(Context.getCur()); genTargetHelperCallFor(iteratorToInst(Context.getCur()));
} }
} }
} }
...@@ -353,7 +353,7 @@ void TargetLowering::doAddressOpt() { ...@@ -353,7 +353,7 @@ void TargetLowering::doAddressOpt() {
} }
void TargetLowering::doNopInsertion(RandomNumberGenerator &RNG) { void TargetLowering::doNopInsertion(RandomNumberGenerator &RNG) {
Inst *I = Context.getCur(); Inst *I = iteratorToInst(Context.getCur());
bool ShouldSkip = llvm::isa<InstFakeUse>(I) || llvm::isa<InstFakeDef>(I) || bool ShouldSkip = llvm::isa<InstFakeUse>(I) || llvm::isa<InstFakeDef>(I) ||
llvm::isa<InstFakeKill>(I) || I->isRedundantAssign() || llvm::isa<InstFakeKill>(I) || I->isRedundantAssign() ||
I->isDeleted(); I->isDeleted();
...@@ -378,7 +378,7 @@ void TargetLowering::doNopInsertion(RandomNumberGenerator &RNG) { ...@@ -378,7 +378,7 @@ void TargetLowering::doNopInsertion(RandomNumberGenerator &RNG) {
// should delete any additional instructions it consumes. // should delete any additional instructions it consumes.
void TargetLowering::lower() { void TargetLowering::lower() {
assert(!Context.atEnd()); assert(!Context.atEnd());
Inst *Instr = Context.getCur(); Inst *Instr = iteratorToInst(Context.getCur());
Instr->deleteIfDead(); Instr->deleteIfDead();
if (!Instr->isDeleted() && !llvm::isa<InstFakeDef>(Instr) && if (!Instr->isDeleted() && !llvm::isa<InstFakeDef>(Instr) &&
!llvm::isa<InstFakeUse>(Instr)) { !llvm::isa<InstFakeUse>(Instr)) {
...@@ -473,7 +473,7 @@ void TargetLowering::lowerInst(CfgNode *Node, InstList::iterator Next, ...@@ -473,7 +473,7 @@ void TargetLowering::lowerInst(CfgNode *Node, InstList::iterator Next,
Context.setNext(Next); Context.setNext(Next);
Context.insert(Instr); Context.insert(Instr);
--Next; --Next;
assert(&*Next == Instr); assert(iteratorToInst(Next) == Instr);
Context.setCur(Next); Context.setCur(Next);
lower(); lower();
} }
......
...@@ -79,13 +79,13 @@ public: ...@@ -79,13 +79,13 @@ public:
Inst *getNextInst() const { Inst *getNextInst() const {
if (Next == End) if (Next == End)
return nullptr; return nullptr;
return Next; return iteratorToInst(Next);
} }
Inst *getNextInst(InstList::iterator &Iter) const { Inst *getNextInst(InstList::iterator &Iter) const {
advanceForward(Iter); advanceForward(Iter);
if (Iter == End) if (Iter == End)
return nullptr; return nullptr;
return Iter; return iteratorToInst(Iter);
} }
CfgNode *getNode() const { return Node; } CfgNode *getNode() const { return Node; }
bool atEnd() const { return Cur == End; } bool atEnd() const { return Cur == End; }
......
...@@ -842,7 +842,7 @@ void TargetARM32::findMaxStackOutArgsSize() { ...@@ -842,7 +842,7 @@ void TargetARM32::findMaxStackOutArgsSize() {
Context.init(Node); Context.init(Node);
while (!Context.atEnd()) { while (!Context.atEnd()) {
PostIncrLoweringContext PostIncrement(Context); PostIncrLoweringContext PostIncrement(Context);
Inst *CurInstr = Context.getCur(); Inst *CurInstr = iteratorToInst(Context.getCur());
if (auto *Call = llvm::dyn_cast<InstCall>(CurInstr)) { if (auto *Call = llvm::dyn_cast<InstCall>(CurInstr)) {
SizeT OutArgsSizeBytes = getCallStackArgumentsSizeBytes(Call); SizeT OutArgsSizeBytes = getCallStackArgumentsSizeBytes(Call);
MaxOutArgsSizeBytes = std::max(MaxOutArgsSizeBytes, OutArgsSizeBytes); MaxOutArgsSizeBytes = std::max(MaxOutArgsSizeBytes, OutArgsSizeBytes);
...@@ -933,7 +933,7 @@ void TargetARM32::materializeGotAddr(CfgNode *Node) { ...@@ -933,7 +933,7 @@ void TargetARM32::materializeGotAddr(CfgNode *Node) {
// The got addr needs to be materialized at the same point where DefGotPtr // The got addr needs to be materialized at the same point where DefGotPtr
// lives. // lives.
Context.setInsertPoint(DefGotPtr); Context.setInsertPoint(instToIterator(DefGotPtr));
assert(DefGotPtr->getSrcSize() == 1); assert(DefGotPtr->getSrcSize() == 1);
auto *T = llvm::cast<Variable>(DefGotPtr->getSrc(0)); auto *T = llvm::cast<Variable>(DefGotPtr->getSrc(0));
loadNamedConstantRelocatablePIC(Ctx->getGlobalString(GlobalOffsetTable), T, loadNamedConstantRelocatablePIC(Ctx->getGlobalString(GlobalOffsetTable), T,
...@@ -2039,7 +2039,7 @@ void TargetARM32::postLowerLegalization() { ...@@ -2039,7 +2039,7 @@ void TargetARM32::postLowerLegalization() {
PostLoweringLegalizer Legalizer(this); PostLoweringLegalizer Legalizer(this);
while (!Context.atEnd()) { while (!Context.atEnd()) {
PostIncrLoweringContext PostIncrement(Context); PostIncrLoweringContext PostIncrement(Context);
Inst *CurInstr = Context.getCur(); Inst *CurInstr = iteratorToInst(Context.getCur());
// Check if the previous TempBaseReg is clobbered, and reset if needed. // Check if the previous TempBaseReg is clobbered, and reset if needed.
Legalizer.resetTempBaseIfClobberedBy(CurInstr); Legalizer.resetTempBaseIfClobberedBy(CurInstr);
...@@ -5750,7 +5750,7 @@ OperandARM32Mem *TargetARM32::formAddressingMode(Type Ty, Cfg *Func, ...@@ -5750,7 +5750,7 @@ OperandARM32Mem *TargetARM32::formAddressingMode(Type Ty, Cfg *Func,
} }
void TargetARM32::doAddressOptLoad() { void TargetARM32::doAddressOptLoad() {
Inst *Instr = Context.getCur(); Inst *Instr = iteratorToInst(Context.getCur());
assert(llvm::isa<InstLoad>(Instr)); assert(llvm::isa<InstLoad>(Instr));
Variable *Dest = Instr->getDest(); Variable *Dest = Instr->getDest();
Operand *Addr = Instr->getSrc(0); Operand *Addr = Instr->getSrc(0);
...@@ -5912,7 +5912,7 @@ void TargetARM32::lowerStore(const InstStore *Instr) { ...@@ -5912,7 +5912,7 @@ void TargetARM32::lowerStore(const InstStore *Instr) {
} }
void TargetARM32::doAddressOptStore() { void TargetARM32::doAddressOptStore() {
Inst *Instr = Context.getCur(); Inst *Instr = iteratorToInst(Context.getCur());
assert(llvm::isa<InstStore>(Instr)); assert(llvm::isa<InstStore>(Instr));
Operand *Src = Instr->getSrc(0); Operand *Src = Instr->getSrc(0);
Operand *Addr = Instr->getSrc(1); Operand *Addr = Instr->getSrc(1);
......
...@@ -2970,6 +2970,9 @@ void FunctionValuesymtabParser::setBbName(NaClBcIndexSize_t Index, ...@@ -2970,6 +2970,9 @@ void FunctionValuesymtabParser::setBbName(NaClBcIndexSize_t Index,
} }
bool FunctionParser::ParseBlock(unsigned BlockID) { bool FunctionParser::ParseBlock(unsigned BlockID) {
#ifndef PNACL_LLVM
constexpr bool PNaClAllowLocalSymbolTables = true;
#endif // !PNACL_LLVM
switch (BlockID) { switch (BlockID) {
case naclbitc::CONSTANTS_BLOCK_ID: { case naclbitc::CONSTANTS_BLOCK_ID: {
ConstantsParser Parser(BlockID, this); ConstantsParser Parser(BlockID, this);
......
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifdef PNACL_LLVM
#ifdef SZTARGET #ifdef SZTARGET
#ifndef SUBZERO_TARGET #ifndef SUBZERO_TARGET
...@@ -29,3 +31,12 @@ SUBZERO_TARGET(SZTARGET) ...@@ -29,3 +31,12 @@ SUBZERO_TARGET(SZTARGET)
#include "llvm/Config/SZTargets.def" #include "llvm/Config/SZTargets.def"
#endif // !SZTARGET #endif // !SZTARGET
#else // !PNACL_LLVM
SUBZERO_TARGET(ARM32)
SUBZERO_TARGET(MIPS32)
SUBZERO_TARGET(X8632)
SUBZERO_TARGET(X8664)
#endif // !PNACL_LLVM
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment