Skip to content

Commit

Permalink
[ExecutionEngine] Fix compile errors in OProfileJITEventListener.
Browse files Browse the repository at this point in the history
Allows LLVM to build with LLVM_USE_OPROFILE=True.

Patch by Mark Dewing. Thanks Mark!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290908 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
lhames committed Jan 3, 2017
1 parent 26b44dd commit b7c9e93
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp
Original file line number Diff line number Diff line change
@@ -88,15 +88,15 @@ void OProfileJITEventListener::NotifyObjectEmitted(
// Use symbol info to iterate functions in the object.
for (const std::pair<SymbolRef, uint64_t> &P : computeSymbolSizes(DebugObj)) {
SymbolRef Sym = P.first;
if (Sym.getType() != SymbolRef::ST_Function)
if (!Sym.getType() || *Sym.getType() != SymbolRef::ST_Function)
continue;

ErrorOr<StringRef> NameOrErr = Sym.getName();
if (NameOrErr.getError())
Expected<StringRef> NameOrErr = Sym.getName();
if (!NameOrErr)
continue;
StringRef Name = *NameOrErr;
ErrorOr<uint64_t> AddrOrErr = Sym.getAddress();
if (AddrOrErr.getError())
Expected<uint64_t> AddrOrErr = Sym.getAddress();
if (!AddrOrErr)
continue;
uint64_t Addr = *AddrOrErr;
uint64_t Size = P.second;
@@ -128,9 +128,9 @@ void OProfileJITEventListener::NotifyFreeingObject(const ObjectFile &Obj) {
for (symbol_iterator I = DebugObj.symbol_begin(),
E = DebugObj.symbol_end();
I != E; ++I) {
if (I->getType() == SymbolRef::ST_Function) {
ErrorOr<uint64_t> AddrOrErr = I->getAddress();
if (AddrOrErr.getError())
if (I->getType() && *I->getType() == SymbolRef::ST_Function) {
Expected<uint64_t> AddrOrErr = I->getAddress();
if (!AddrOrErr)
continue;
uint64_t Addr = *AddrOrErr;

0 comments on commit b7c9e93

Please sign in to comment.