mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
For PR780:
1. Add #includes to LinkAllVMCore.h to get Mangler.o and InlineAsm.o 2. Make Mangler.h and InlineAsm.h use the macros to ensure linkage 3. Make each of the tools with --load options include LinkAllVMCore.h This should be the last set of changes for this bug and 800. llvm-svn: 28719
This commit is contained in:
parent
71f6e90ae3
commit
854aa3ca41
@ -17,6 +17,7 @@
|
|||||||
#define LLVM_INLINEASM_H
|
#define LLVM_INLINEASM_H
|
||||||
|
|
||||||
#include "llvm/Value.h"
|
#include "llvm/Value.h"
|
||||||
|
#include "llvm/Support/IncludeFile.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
@ -35,7 +36,7 @@ class InlineAsm : public Value {
|
|||||||
|
|
||||||
InlineAsm(const FunctionType *Ty, const std::string &AsmString,
|
InlineAsm(const FunctionType *Ty, const std::string &AsmString,
|
||||||
const std::string &Constraints, bool hasSideEffects);
|
const std::string &Constraints, bool hasSideEffects);
|
||||||
~InlineAsm();
|
virtual ~InlineAsm();
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// InlineAsm::get - Return the the specified uniqued inline asm string.
|
/// InlineAsm::get - Return the the specified uniqued inline asm string.
|
||||||
@ -128,4 +129,7 @@ public:
|
|||||||
|
|
||||||
} // End llvm namespace
|
} // End llvm namespace
|
||||||
|
|
||||||
|
// Make sure the InlineAsm.cpp file is linked when this one is #included.
|
||||||
|
FORCE_DEFINING_FILE_TO_BE_LINKED(InlineAsm)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -17,9 +17,11 @@
|
|||||||
#define LLVM_LINKALLVMCORE_H
|
#define LLVM_LINKALLVMCORE_H
|
||||||
|
|
||||||
#include "llvm/Support/IncludeFile.h"
|
#include "llvm/Support/IncludeFile.h"
|
||||||
|
#include "llvm/Support/Mangler.h"
|
||||||
#include "llvm/Module.h"
|
#include "llvm/Module.h"
|
||||||
#include "llvm/Instructions.h"
|
#include "llvm/Instructions.h"
|
||||||
#include "llvm/IntrinsicInst.h"
|
#include "llvm/IntrinsicInst.h"
|
||||||
|
#include "llvm/InlineAsm.h"
|
||||||
#include "llvm/Analysis/Verifier.h"
|
#include "llvm/Analysis/Verifier.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#ifndef LLVM_SUPPORT_MANGLER_H
|
#ifndef LLVM_SUPPORT_MANGLER_H
|
||||||
#define LLVM_SUPPORT_MANGLER_H
|
#define LLVM_SUPPORT_MANGLER_H
|
||||||
|
|
||||||
|
#include "llvm/Support/IncludeFile.h"
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -103,4 +104,7 @@ private:
|
|||||||
|
|
||||||
} // End llvm namespace
|
} // End llvm namespace
|
||||||
|
|
||||||
|
// Force the Mangler.cpp file to be linked when this header is #included
|
||||||
|
FORCE_DEFINING_FILE_TO_BE_LINKED(Mangler)
|
||||||
|
|
||||||
#endif // LLVM_SUPPORT_MANGLER_H
|
#endif // LLVM_SUPPORT_MANGLER_H
|
||||||
|
@ -208,3 +208,5 @@ bool InlineAsm::Verify(const FunctionType *Ty, const std::string &ConstStr) {
|
|||||||
if (Ty->getNumParams() != NumInputs) return false;
|
if (Ty->getNumParams() != NumInputs) return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFINING_FILE_FOR(InlineAsm)
|
||||||
|
@ -200,3 +200,6 @@ Mangler::Mangler(Module &M, const char *prefix)
|
|||||||
for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
|
for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
|
||||||
InsertName(I, Names);
|
InsertName(I, Names);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Cause this file to be linked in when Support/Mangler.h is #included
|
||||||
|
DEFINING_FILE_FOR(Mangler)
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include "llvm/System/Signals.h"
|
#include "llvm/System/Signals.h"
|
||||||
#include "llvm/Support/PluginLoader.h"
|
#include "llvm/Support/PluginLoader.h"
|
||||||
#include "llvm/Support/Timer.h"
|
#include "llvm/Support/Timer.h"
|
||||||
|
#include "llvm/LinkAllVMCore.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "llvm/Analysis/Verifier.h"
|
#include "llvm/Analysis/Verifier.h"
|
||||||
#include "llvm/System/Signals.h"
|
#include "llvm/System/Signals.h"
|
||||||
#include "llvm/Config/config.h"
|
#include "llvm/Config/config.h"
|
||||||
|
#include "llvm/LinkAllVMCore.h"
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
#include "llvm/Support/PluginLoader.h"
|
#include "llvm/Support/PluginLoader.h"
|
||||||
#include "llvm/System/Signals.h"
|
#include "llvm/System/Signals.h"
|
||||||
|
#include "llvm/LinkAllVMCore.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#include "llvm/LinkAllVMCore.h"
|
||||||
#include "llvm/Linker.h"
|
#include "llvm/Linker.h"
|
||||||
#include "llvm/System/Program.h"
|
#include "llvm/System/Program.h"
|
||||||
#include "llvm/Module.h"
|
#include "llvm/Module.h"
|
||||||
@ -77,9 +78,12 @@ static cl::opt<bool>DisableCompression("disable-compression",cl::init(false),
|
|||||||
cl::desc("Disable writing of compressed bytecode files"));
|
cl::desc("Disable writing of compressed bytecode files"));
|
||||||
|
|
||||||
static cl::list<std::string> PostLinkOpts("post-link-opts",
|
static cl::list<std::string> PostLinkOpts("post-link-opts",
|
||||||
cl::value_desc("path to post-link optimization programs"),
|
cl::value_desc("path"),
|
||||||
cl::desc("Run one or more optimization programs after linking"));
|
cl::desc("Run one or more optimization programs after linking"));
|
||||||
|
|
||||||
|
static cl::list<std::string> XLinker("Xlinker", cl::value_desc("option"),
|
||||||
|
cl::desc("Pass options to the system linker"));
|
||||||
|
|
||||||
// Compatibility options that are ignored but supported by LD
|
// Compatibility options that are ignored but supported by LD
|
||||||
static cl::opt<std::string> CO3("soname", cl::Hidden,
|
static cl::opt<std::string> CO3("soname", cl::Hidden,
|
||||||
cl::desc("Compatibility option: ignored"));
|
cl::desc("Compatibility option: ignored"));
|
||||||
@ -93,6 +97,7 @@ static cl::opt<bool> CO5("eh-frame-hdr", cl::Hidden,
|
|||||||
static cl::opt<std::string> CO6("h", cl::Hidden,
|
static cl::opt<std::string> CO6("h", cl::Hidden,
|
||||||
cl::desc("Compatibility option: ignored"));
|
cl::desc("Compatibility option: ignored"));
|
||||||
|
|
||||||
|
|
||||||
/// This is just for convenience so it doesn't have to be passed around
|
/// This is just for convenience so it doesn't have to be passed around
|
||||||
/// everywhere.
|
/// everywhere.
|
||||||
static std::string progname;
|
static std::string progname;
|
||||||
@ -303,12 +308,25 @@ static int GenerateNative(const std::string &OutputFilename,
|
|||||||
args.push_back(OutputFilename.c_str());
|
args.push_back(OutputFilename.c_str());
|
||||||
args.push_back(InputFilename.c_str());
|
args.push_back(InputFilename.c_str());
|
||||||
|
|
||||||
|
// Add in the library paths
|
||||||
|
for (unsigned index = 0; index < LibPaths.size(); index++) {
|
||||||
|
args.push_back("-L");
|
||||||
|
args.push_back(LibPaths[index].c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add the requested options
|
||||||
|
for (unsigned index = 0; index < XLinker.size(); index++) {
|
||||||
|
args.push_back(XLinker[index].c_str());
|
||||||
|
args.push_back(Libraries[index].c_str());
|
||||||
|
}
|
||||||
|
|
||||||
// Add in the libraries to link.
|
// Add in the libraries to link.
|
||||||
for (unsigned index = 0; index < Libraries.size(); index++)
|
for (unsigned index = 0; index < Libraries.size(); index++)
|
||||||
if (Libraries[index] != "crtend") {
|
if (Libraries[index] != "crtend") {
|
||||||
args.push_back("-l");
|
args.push_back("-l");
|
||||||
args.push_back(Libraries[index].c_str());
|
args.push_back(Libraries[index].c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
args.push_back(0);
|
args.push_back(0);
|
||||||
|
|
||||||
// Run the compiler to assembly and link together the program.
|
// Run the compiler to assembly and link together the program.
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include "llvm/Support/PluginLoader.h"
|
#include "llvm/Support/PluginLoader.h"
|
||||||
#include "llvm/Support/SystemUtils.h"
|
#include "llvm/Support/SystemUtils.h"
|
||||||
#include "llvm/Transforms/LinkAllPasses.h"
|
#include "llvm/Transforms/LinkAllPasses.h"
|
||||||
|
#include "llvm/LinkAllVMCore.h"
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user