mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-07-22 09:29:31 +00:00
Replace the interim lli build fix with something cleaner
Eliminates the LLI_BUILDING_CHILD build hack from r199885. Also add a FIXME to remove code that tricks the tests into passing when the feature fails to work. Please don't do stuff like this, the tests exist for a reason! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199929 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ebcaef4340
commit
fe32bb7833
@ -1,5 +1,4 @@
|
|||||||
set(LLVM_LINK_COMPONENTS support)
|
set(LLVM_LINK_COMPONENTS support)
|
||||||
add_definitions(-DLLI_BUILDING_CHILD)
|
|
||||||
|
|
||||||
add_llvm_executable(lli-child-target
|
add_llvm_executable(lli-child-target
|
||||||
ChildTarget.cpp
|
ChildTarget.cpp
|
||||||
|
@ -14,8 +14,6 @@ include $(LEVEL)/Makefile.config
|
|||||||
|
|
||||||
LINK_COMPONENTS := support
|
LINK_COMPONENTS := support
|
||||||
|
|
||||||
CXXFLAGS += -DLLI_BUILDING_CHILD
|
|
||||||
|
|
||||||
SOURCES := ChildTarget.cpp ../RemoteTarget.cpp
|
SOURCES := ChildTarget.cpp ../RemoteTarget.cpp
|
||||||
|
|
||||||
include $(LLVM_SRC_ROOT)/Makefile.rules
|
include $(LLVM_SRC_ROOT)/Makefile.rules
|
||||||
|
@ -22,31 +22,6 @@
|
|||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
#ifndef LLI_BUILDING_CHILD
|
|
||||||
|
|
||||||
// Static methods
|
|
||||||
RemoteTarget *RemoteTarget::createRemoteTarget() {
|
|
||||||
return new RemoteTarget;
|
|
||||||
}
|
|
||||||
|
|
||||||
RemoteTarget *RemoteTarget::createExternalRemoteTarget(std::string &ChildName) {
|
|
||||||
#ifdef LLVM_ON_UNIX
|
|
||||||
return new RemoteTargetExternal(ChildName);
|
|
||||||
#else
|
|
||||||
return 0;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
bool RemoteTarget::hostSupportsExternalRemoteTarget() {
|
|
||||||
#ifdef LLVM_ON_UNIX
|
|
||||||
return true;
|
|
||||||
#else
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Simulated remote execution
|
// Simulated remote execution
|
||||||
//
|
//
|
||||||
|
@ -111,11 +111,6 @@ public:
|
|||||||
|
|
||||||
RemoteTarget() : IsRunning(false), ErrorMsg("") {}
|
RemoteTarget() : IsRunning(false), ErrorMsg("") {}
|
||||||
virtual ~RemoteTarget() { if (IsRunning) stop(); }
|
virtual ~RemoteTarget() { if (IsRunning) stop(); }
|
||||||
|
|
||||||
// Create an instance of the system-specific remote target class.
|
|
||||||
static RemoteTarget *createRemoteTarget();
|
|
||||||
static RemoteTarget *createExternalRemoteTarget(std::string &ChildName);
|
|
||||||
static bool hostSupportsExternalRemoteTarget();
|
|
||||||
private:
|
private:
|
||||||
// Main processing function for the remote target process. Command messages
|
// Main processing function for the remote target process. Command messages
|
||||||
// are received on file descriptor CmdFD and responses come back on OutFD.
|
// are received on file descriptor CmdFD and responses come back on OutFD.
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
#include "llvm/IR/LLVMContext.h"
|
#include "llvm/IR/LLVMContext.h"
|
||||||
#include "RemoteMemoryManager.h"
|
#include "RemoteMemoryManager.h"
|
||||||
#include "RemoteTarget.h"
|
#include "RemoteTarget.h"
|
||||||
|
#include "RemoteTargetExternal.h"
|
||||||
#include "llvm/ADT/Triple.h"
|
#include "llvm/ADT/Triple.h"
|
||||||
#include "llvm/Bitcode/ReaderWriter.h"
|
#include "llvm/Bitcode/ReaderWriter.h"
|
||||||
#include "llvm/CodeGen/LinkAllCodegenComponents.h"
|
#include "llvm/CodeGen/LinkAllCodegenComponents.h"
|
||||||
@ -663,21 +664,23 @@ int main(int argc, char **argv, char * const *envp) {
|
|||||||
|
|
||||||
OwningPtr<RemoteTarget> Target;
|
OwningPtr<RemoteTarget> Target;
|
||||||
if (!ChildExecPath.empty()) { // Remote execution on a child process
|
if (!ChildExecPath.empty()) { // Remote execution on a child process
|
||||||
if (!RemoteTarget::hostSupportsExternalRemoteTarget()) {
|
#ifndef LLVM_ON_UNIX
|
||||||
errs() << "Warning: host does not support external remote targets.\n"
|
// FIXME: Remove this pointless fallback mode which causes tests to "pass"
|
||||||
<< " Defaulting to simulated remote execution\n";
|
// on platforms where they should XFAIL.
|
||||||
Target.reset(RemoteTarget::createRemoteTarget());
|
errs() << "Warning: host does not support external remote targets.\n"
|
||||||
} else {
|
<< " Defaulting to simulated remote execution\n";
|
||||||
if (!sys::fs::can_execute(ChildExecPath)) {
|
Target.reset(new RemoteTarget);
|
||||||
errs() << "Unable to find usable child executable: '" << ChildExecPath
|
#else
|
||||||
<< "'\n";
|
if (!sys::fs::can_execute(ChildExecPath)) {
|
||||||
return -1;
|
errs() << "Unable to find usable child executable: '" << ChildExecPath
|
||||||
}
|
<< "'\n";
|
||||||
Target.reset(RemoteTarget::createExternalRemoteTarget(ChildExecPath));
|
return -1;
|
||||||
}
|
}
|
||||||
|
Target.reset(new RemoteTargetExternal(ChildExecPath));
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
// No child process name provided, use simulated remote execution.
|
// No child process name provided, use simulated remote execution.
|
||||||
Target.reset(RemoteTarget::createRemoteTarget());
|
Target.reset(new RemoteTarget);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Give the memory manager a pointer to our remote target interface object.
|
// Give the memory manager a pointer to our remote target interface object.
|
||||||
|
Loading…
Reference in New Issue
Block a user