mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-15 07:33:18 +00:00
Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128086 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
026a42b170
commit
8bf0ecdbf6
@ -52,8 +52,8 @@ static void runAtExitHandlers() {
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
#include <fcntl.h>
|
||||
/* stat functions are redirecting to __xstat with a version number. On x86-64
|
||||
* linking with libc_nonshared.a and -Wl,--export-dynamic doesn't make 'stat'
|
||||
/* stat functions are redirecting to __xstat with a version number. On x86-64
|
||||
* linking with libc_nonshared.a and -Wl,--export-dynamic doesn't make 'stat'
|
||||
* available as an exported symbol, so we have to add it explicitly.
|
||||
*/
|
||||
namespace {
|
||||
@ -119,18 +119,18 @@ void *JIT::getPointerToNamedFunction(const std::string &Name,
|
||||
const char *NameStr = Name.c_str();
|
||||
// If this is an asm specifier, skip the sentinal.
|
||||
if (NameStr[0] == 1) ++NameStr;
|
||||
|
||||
|
||||
// If it's an external function, look it up in the process image...
|
||||
void *Ptr = sys::DynamicLibrary::SearchForAddressOfSymbol(NameStr);
|
||||
if (Ptr) return Ptr;
|
||||
|
||||
|
||||
// If it wasn't found and if it starts with an underscore ('_') character,
|
||||
// and has an asm specifier, try again without the underscore.
|
||||
if (Name[0] == 1 && NameStr[0] == '_') {
|
||||
Ptr = sys::DynamicLibrary::SearchForAddressOfSymbol(NameStr+1);
|
||||
if (Ptr) return Ptr;
|
||||
}
|
||||
|
||||
|
||||
// Darwin/PPC adds $LDBLStub suffixes to various symbols like printf. These
|
||||
// are references to hidden visibility symbols that dlsym cannot resolve.
|
||||
// If we have one of these, strip off $LDBLStub and try again.
|
||||
@ -147,7 +147,7 @@ void *JIT::getPointerToNamedFunction(const std::string &Name,
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/// If a LazyFunctionCreator is installed, use it to get/create the function.
|
||||
if (LazyFunctionCreator)
|
||||
if (void *RP = LazyFunctionCreator(Name))
|
||||
|
@ -34,7 +34,7 @@ using namespace llvm;
|
||||
JITDwarfEmitter::JITDwarfEmitter(JIT& theJit) : MMI(0), Jit(theJit) {}
|
||||
|
||||
|
||||
unsigned char* JITDwarfEmitter::EmitDwarfTable(MachineFunction& F,
|
||||
unsigned char* JITDwarfEmitter::EmitDwarfTable(MachineFunction& F,
|
||||
JITCodeEmitter& jce,
|
||||
unsigned char* StartFunction,
|
||||
unsigned char* EndFunction,
|
||||
@ -47,10 +47,10 @@ unsigned char* JITDwarfEmitter::EmitDwarfTable(MachineFunction& F,
|
||||
RI = TM.getRegisterInfo();
|
||||
TFI = TM.getFrameLowering();
|
||||
JCE = &jce;
|
||||
|
||||
|
||||
unsigned char* ExceptionTable = EmitExceptionTable(&F, StartFunction,
|
||||
EndFunction);
|
||||
|
||||
|
||||
unsigned char* Result = 0;
|
||||
|
||||
const std::vector<const Function *> Personalities = MMI->getPersonalities();
|
||||
@ -63,7 +63,7 @@ unsigned char* JITDwarfEmitter::EmitDwarfTable(MachineFunction& F,
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
void
|
||||
JITDwarfEmitter::EmitFrameMoves(intptr_t BaseLabelPtr,
|
||||
const std::vector<MachineMove> &Moves) const {
|
||||
unsigned PointerSize = TD->getPointerSize();
|
||||
@ -74,26 +74,26 @@ JITDwarfEmitter::EmitFrameMoves(intptr_t BaseLabelPtr,
|
||||
for (unsigned i = 0, N = Moves.size(); i < N; ++i) {
|
||||
const MachineMove &Move = Moves[i];
|
||||
MCSymbol *Label = Move.getLabel();
|
||||
|
||||
|
||||
// Throw out move if the label is invalid.
|
||||
if (Label && (*JCE->getLabelLocations())[Label] == 0)
|
||||
continue;
|
||||
|
||||
|
||||
intptr_t LabelPtr = 0;
|
||||
if (Label) LabelPtr = JCE->getLabelAddress(Label);
|
||||
|
||||
const MachineLocation &Dst = Move.getDestination();
|
||||
const MachineLocation &Src = Move.getSource();
|
||||
|
||||
|
||||
// Advance row if new location.
|
||||
if (BaseLabelPtr && Label && BaseLabel != Label) {
|
||||
JCE->emitByte(dwarf::DW_CFA_advance_loc4);
|
||||
JCE->emitInt32(LabelPtr - BaseLabelPtr);
|
||||
|
||||
BaseLabel = Label;
|
||||
|
||||
BaseLabel = Label;
|
||||
BaseLabelPtr = LabelPtr;
|
||||
}
|
||||
|
||||
|
||||
// If advancing cfa.
|
||||
if (Dst.isReg() && Dst.getReg() == MachineLocation::VirtualFP) {
|
||||
if (!Src.isReg()) {
|
||||
@ -103,7 +103,7 @@ JITDwarfEmitter::EmitFrameMoves(intptr_t BaseLabelPtr,
|
||||
JCE->emitByte(dwarf::DW_CFA_def_cfa);
|
||||
JCE->emitULEB128Bytes(RI->getDwarfRegNum(Src.getReg(), true));
|
||||
}
|
||||
|
||||
|
||||
JCE->emitULEB128Bytes(-Src.getOffset());
|
||||
} else {
|
||||
llvm_unreachable("Machine move not supported yet.");
|
||||
@ -119,7 +119,7 @@ JITDwarfEmitter::EmitFrameMoves(intptr_t BaseLabelPtr,
|
||||
} else {
|
||||
unsigned Reg = RI->getDwarfRegNum(Src.getReg(), true);
|
||||
int Offset = Dst.getOffset() / stackGrowth;
|
||||
|
||||
|
||||
if (Offset < 0) {
|
||||
JCE->emitByte(dwarf::DW_CFA_offset_extended_sf);
|
||||
JCE->emitULEB128Bytes(Reg);
|
||||
@ -382,7 +382,7 @@ unsigned char* JITDwarfEmitter::EmitExceptionTable(MachineFunction* MF,
|
||||
|
||||
unsigned TypeOffset = sizeof(int8_t) + // Call site format
|
||||
// Call-site table length
|
||||
MCAsmInfo::getULEB128Size(SizeSites) +
|
||||
MCAsmInfo::getULEB128Size(SizeSites) +
|
||||
SizeSites + SizeActions + SizeTypes;
|
||||
|
||||
// Begin the exception table.
|
||||
@ -452,7 +452,7 @@ unsigned char* JITDwarfEmitter::EmitExceptionTable(MachineFunction* MF,
|
||||
// Emit the type ids.
|
||||
for (unsigned M = TypeInfos.size(); M; --M) {
|
||||
const GlobalVariable *GV = TypeInfos[M - 1];
|
||||
|
||||
|
||||
if (GV) {
|
||||
if (TD->getPointerSize() == sizeof(int32_t))
|
||||
JCE->emitInt32((intptr_t)Jit.getOrEmitGlobalVariable(GV));
|
||||
@ -484,7 +484,7 @@ JITDwarfEmitter::EmitCommonEHFrame(const Function* Personality) const {
|
||||
unsigned PointerSize = TD->getPointerSize();
|
||||
int stackGrowth = stackGrowthDirection == TargetFrameLowering::StackGrowsUp ?
|
||||
PointerSize : -PointerSize;
|
||||
|
||||
|
||||
unsigned char* StartCommonPtr = (unsigned char*)JCE->getCurrentPCValue();
|
||||
// EH Common Frame header
|
||||
JCE->allocateSpace(4, 0);
|
||||
@ -499,13 +499,13 @@ JITDwarfEmitter::EmitCommonEHFrame(const Function* Personality) const {
|
||||
if (Personality) {
|
||||
// Augmentation Size: 3 small ULEBs of one byte each, and the personality
|
||||
// function which size is PointerSize.
|
||||
JCE->emitULEB128Bytes(3 + PointerSize);
|
||||
|
||||
JCE->emitULEB128Bytes(3 + PointerSize);
|
||||
|
||||
// We set the encoding of the personality as direct encoding because we use
|
||||
// the function pointer. The encoding is not relative because the current
|
||||
// PC value may be bigger than the personality function pointer.
|
||||
if (PointerSize == 4) {
|
||||
JCE->emitByte(dwarf::DW_EH_PE_sdata4);
|
||||
JCE->emitByte(dwarf::DW_EH_PE_sdata4);
|
||||
JCE->emitInt32(((intptr_t)Jit.getPointerToGlobal(Personality)));
|
||||
} else {
|
||||
JCE->emitByte(dwarf::DW_EH_PE_sdata8);
|
||||
@ -540,11 +540,11 @@ JITDwarfEmitter::EmitCommonEHFrame(const Function* Personality) const {
|
||||
unsigned char*
|
||||
JITDwarfEmitter::EmitEHFrame(const Function* Personality,
|
||||
unsigned char* StartCommonPtr,
|
||||
unsigned char* StartFunction,
|
||||
unsigned char* StartFunction,
|
||||
unsigned char* EndFunction,
|
||||
unsigned char* ExceptionTable) const {
|
||||
unsigned PointerSize = TD->getPointerSize();
|
||||
|
||||
|
||||
// EH frame header.
|
||||
unsigned char* StartEHPtr = (unsigned char*)JCE->getCurrentPCValue();
|
||||
JCE->allocateSpace(4, 0);
|
||||
@ -558,7 +558,7 @@ JITDwarfEmitter::EmitEHFrame(const Function* Personality,
|
||||
// specific data area in the exception table.
|
||||
if (Personality) {
|
||||
JCE->emitULEB128Bytes(PointerSize == 4 ? 4 : 8);
|
||||
|
||||
|
||||
if (PointerSize == 4) {
|
||||
if (!MMI->getLandingPads().empty())
|
||||
JCE->emitInt32(ExceptionTable-(unsigned char*)JCE->getCurrentPCValue());
|
||||
@ -573,7 +573,7 @@ JITDwarfEmitter::EmitEHFrame(const Function* Personality,
|
||||
} else {
|
||||
JCE->emitULEB128Bytes(0);
|
||||
}
|
||||
|
||||
|
||||
// Indicate locations of function specific callee saved registers in
|
||||
// frame.
|
||||
EmitFrameMoves((intptr_t)StartFunction, MMI->getFrameMoves());
|
||||
@ -593,6 +593,6 @@ JITDwarfEmitter::EmitEHFrame(const Function* Personality,
|
||||
JCE->emitInt32(0);
|
||||
JCE->emitInt32(0);
|
||||
}
|
||||
|
||||
|
||||
return StartEHPtr;
|
||||
}
|
||||
|
@ -35,33 +35,33 @@ class JITDwarfEmitter {
|
||||
MachineModuleInfo* MMI;
|
||||
JIT& Jit;
|
||||
bool stackGrowthDirection;
|
||||
|
||||
|
||||
unsigned char* EmitExceptionTable(MachineFunction* MF,
|
||||
unsigned char* StartFunction,
|
||||
unsigned char* StartFunction,
|
||||
unsigned char* EndFunction) const;
|
||||
|
||||
void EmitFrameMoves(intptr_t BaseLabelPtr,
|
||||
void EmitFrameMoves(intptr_t BaseLabelPtr,
|
||||
const std::vector<MachineMove> &Moves) const;
|
||||
|
||||
|
||||
unsigned char* EmitCommonEHFrame(const Function* Personality) const;
|
||||
|
||||
unsigned char* EmitEHFrame(const Function* Personality,
|
||||
unsigned char* EmitEHFrame(const Function* Personality,
|
||||
unsigned char* StartBufferPtr,
|
||||
unsigned char* StartFunction,
|
||||
unsigned char* StartFunction,
|
||||
unsigned char* EndFunction,
|
||||
unsigned char* ExceptionTable) const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
JITDwarfEmitter(JIT& jit);
|
||||
|
||||
unsigned char* EmitDwarfTable(MachineFunction& F,
|
||||
|
||||
unsigned char* EmitDwarfTable(MachineFunction& F,
|
||||
JITCodeEmitter& JCE,
|
||||
unsigned char* StartFunction,
|
||||
unsigned char* EndFunction,
|
||||
unsigned char* &EHFramePtr);
|
||||
|
||||
|
||||
|
||||
|
||||
void setModuleInfo(MachineModuleInfo* Info) {
|
||||
MMI = Info;
|
||||
}
|
||||
|
@ -108,8 +108,8 @@ void OProfileJITEventListener::NotifyFunctionEmitted(
|
||||
if (op_write_native_code(Agent, F.getName().data(),
|
||||
reinterpret_cast<uint64_t>(FnStart),
|
||||
FnStart, FnSize) == -1) {
|
||||
DEBUG(dbgs() << "Failed to tell OProfile about native function "
|
||||
<< F.getName() << " at ["
|
||||
DEBUG(dbgs() << "Failed to tell OProfile about native function "
|
||||
<< F.getName() << " at ["
|
||||
<< FnStart << "-" << ((char*)FnStart + FnSize) << "]\n");
|
||||
return;
|
||||
}
|
||||
@ -153,9 +153,9 @@ void OProfileJITEventListener::NotifyFunctionEmitted(
|
||||
|
||||
if (op_write_debug_line_info(Agent, FnStart,
|
||||
LineInfo.size(), &*LineInfo.begin()) == -1) {
|
||||
DEBUG(dbgs()
|
||||
DEBUG(dbgs()
|
||||
<< "Failed to tell OProfile about line numbers for native function "
|
||||
<< F.getName() << " at ["
|
||||
<< F.getName() << " at ["
|
||||
<< FnStart << "-" << ((char*)FnStart + FnSize) << "]\n");
|
||||
}
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ TargetMachine *JIT::selectTarget(Module *Mod,
|
||||
}
|
||||
|
||||
// Allocate a target...
|
||||
TargetMachine *Target =
|
||||
TargetMachine *Target =
|
||||
TheTarget->createTargetMachine(TheTriple.getTriple(), FeaturesStr);
|
||||
assert(Target && "Could not allocate target machine!");
|
||||
return Target;
|
||||
|
Loading…
x
Reference in New Issue
Block a user