Fix build with -DLLVM_USE_INTEL_JITEVENTS=ON -DLLVM_USE_OPROFILE=ON.

Is anyone using those?

llvm-svn: 241372
This commit is contained in:
Rafael Espindola 2015-07-03 21:47:00 +00:00
parent c0ad64543b
commit a4b2733c86
3 changed files with 14 additions and 9 deletions

View File

@ -118,9 +118,10 @@ void IntelJITEventListener::NotifyObjectEmitted(
if (!Name) if (!Name)
continue; continue;
uint64_t Addr; ErrorOr<uint64_t> AddrOrErr = Sym.getAddress();
if (Sym.getAddress(Addr)) if (AddrOrErr.getError())
continue; continue;
uint64_t Addr = *AddrOrErr;
uint64_t Size = P.second; uint64_t Size = P.second;
// Record this address in a local vector // Record this address in a local vector

View File

@ -89,12 +89,14 @@ void OProfileJITEventListener::NotifyObjectEmitted(
for (const std::pair<SymbolRef, uint64_t> &P : computeSymbolSizes(DebugObj)) { for (const std::pair<SymbolRef, uint64_t> &P : computeSymbolSizes(DebugObj)) {
SymbolRef Sym = P.first; SymbolRef Sym = P.first;
if (Sym.getType() == SymbolRef::ST_Function) { if (Sym.getType() == SymbolRef::ST_Function) {
StringRef Name; ErrorOr<StringRef> NameOrErr = Sym.getName();
uint64_t Addr; if (NameOrErr.getError())
if (Sym.getName(Name))
continue; continue;
if (Sym.getAddress(Addr)) StringRef Name = *NameOrErr;
ErrorOr<uint64_t> AddrOrErr = Sym.getAddress();
if (AddrOrErr.getError())
continue; continue;
uint64_t Addr = *AddrOrErr;
uint64_t Size = P.second; uint64_t Size = P.second;
if (Wrapper->op_write_native_code(Name.data(), Addr, (void*)Addr, Size) if (Wrapper->op_write_native_code(Name.data(), Addr, (void*)Addr, Size)
@ -126,8 +128,10 @@ void OProfileJITEventListener::NotifyFreeingObject(const ObjectFile &Obj) {
E = DebugObj.symbol_end(); E = DebugObj.symbol_end();
I != E; ++I) { I != E; ++I) {
if (I->getType() == SymbolRef::ST_Function) { if (I->getType() == SymbolRef::ST_Function) {
uint64_t Addr; ErrorOr<uint64_t> AddrOrErr = I->getAddress();
if (I->getAddress(Addr)) continue; if (AddrOrErr.getError())
continue;
uint64_t Addr = *AddrOrErr;
if (Wrapper->op_unload_native_code(Addr) == -1) { if (Wrapper->op_unload_native_code(Addr) == -1) {
DEBUG(dbgs() DEBUG(dbgs()

View File

@ -6,7 +6,7 @@ include_directories( ${LLVM_INTEL_JITEVENTS_INCDIR} )
set(LLVM_LINK_COMPONENTS set(LLVM_LINK_COMPONENTS
asmparser asmparser
bitreader bitreader
debuginfo DebugInfoDWARF
inteljitevents inteljitevents
interpreter interpreter
irreader irreader