llvm.org GIT mirror llvm / af303d5
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28719 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Spencer 13 years ago
10 changed file(s) with 39 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
1616 #define LLVM_INLINEASM_H
1717
1818 #include "llvm/Value.h"
19 #include "llvm/Support/IncludeFile.h"
1920 #include
2021
2122 namespace llvm {
3435
3536 InlineAsm(const FunctionType *Ty, const std::string &AsmString,
3637 const std::string &Constraints, bool hasSideEffects);
37 ~InlineAsm();
38 virtual ~InlineAsm();
3839 public:
3940
4041 /// InlineAsm::get - Return the the specified uniqued inline asm string.
127128
128129 } // End llvm namespace
129130
131 // Make sure the InlineAsm.cpp file is linked when this one is #included.
132 FORCE_DEFINING_FILE_TO_BE_LINKED(InlineAsm)
133
130134 #endif
1616 #define LLVM_LINKALLVMCORE_H
1717
1818 #include "llvm/Support/IncludeFile.h"
19 #include "llvm/Support/Mangler.h"
1920 #include "llvm/Module.h"
2021 #include "llvm/Instructions.h"
2122 #include "llvm/IntrinsicInst.h"
23 #include "llvm/InlineAsm.h"
2224 #include "llvm/Analysis/Verifier.h"
2325
2426 namespace {
1313 #ifndef LLVM_SUPPORT_MANGLER_H
1414 #define LLVM_SUPPORT_MANGLER_H
1515
16 #include "llvm/Support/IncludeFile.h"
1617 #include
1718 #include
1819 #include
102103
103104 } // End llvm namespace
104105
106 // Force the Mangler.cpp file to be linked when this header is #included
107 FORCE_DEFINING_FILE_TO_BE_LINKED(Mangler)
108
105109 #endif // LLVM_SUPPORT_MANGLER_H
207207 if (Ty->getNumParams() != NumInputs) return false;
208208 return true;
209209 }
210
211 DEFINING_FILE_FOR(InlineAsm)
199199 for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I)
200200 InsertName(I, Names);
201201 }
202
203 // Cause this file to be linked in when Support/Mangler.h is #included
204 DEFINING_FILE_FOR(Mangler)
2626 #include "llvm/System/Signals.h"
2727 #include "llvm/Support/PluginLoader.h"
2828 #include "llvm/Support/Timer.h"
29 #include "llvm/LinkAllVMCore.h"
2930 #include
3031
3132 using namespace llvm;
2727 #include "llvm/Analysis/Verifier.h"
2828 #include "llvm/System/Signals.h"
2929 #include "llvm/Config/config.h"
30 #include "llvm/LinkAllVMCore.h"
3031 #include
3132 #include
3233 #include
1515 #include "llvm/Support/CommandLine.h"
1616 #include "llvm/Support/PluginLoader.h"
1717 #include "llvm/System/Signals.h"
18 #include "llvm/LinkAllVMCore.h"
1819 #include
1920
2021 using namespace llvm;
1919 //
2020 //===----------------------------------------------------------------------===//
2121
22 #include "llvm/LinkAllVMCore.h"
2223 #include "llvm/Linker.h"
2324 #include "llvm/System/Program.h"
2425 #include "llvm/Module.h"
7677 cl::desc("Disable writing of compressed bytecode files"));
7778
7879 static cl::list PostLinkOpts("post-link-opts",
79 cl::value_desc("path to post-link optimization programs"),
80 cl::value_desc("path"),
8081 cl::desc("Run one or more optimization programs after linking"));
82
83 static cl::list XLinker("Xlinker", cl::value_desc("option"),
84 cl::desc("Pass options to the system linker"));
8185
8286 // Compatibility options that are ignored but supported by LD
8387 static cl::opt CO3("soname", cl::Hidden,
9195
9296 static cl::opt CO6("h", cl::Hidden,
9397 cl::desc("Compatibility option: ignored"));
98
9499
95100 /// This is just for convenience so it doesn't have to be passed around
96101 /// everywhere.
302307 args.push_back(OutputFilename.c_str());
303308 args.push_back(InputFilename.c_str());
304309
310 // Add in the library paths
311 for (unsigned index = 0; index < LibPaths.size(); index++) {
312 args.push_back("-L");
313 args.push_back(LibPaths[index].c_str());
314 }
315
316 // Add the requested options
317 for (unsigned index = 0; index < XLinker.size(); index++) {
318 args.push_back(XLinker[index].c_str());
319 args.push_back(Libraries[index].c_str());
320 }
321
305322 // Add in the libraries to link.
306323 for (unsigned index = 0; index < Libraries.size(); index++)
307324 if (Libraries[index] != "crtend") {
308325 args.push_back("-l");
309326 args.push_back(Libraries[index].c_str());
310327 }
328
311329 args.push_back(0);
312330
313331 // Run the compiler to assembly and link together the program.
2424 #include "llvm/Support/PluginLoader.h"
2525 #include "llvm/Support/SystemUtils.h"
2626 #include "llvm/Transforms/LinkAllPasses.h"
27 #include "llvm/LinkAllVMCore.h"
2728 #include
2829 #include
2930 #include