aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineModuleInfoImpls.cpp
AgeCommit message (Collapse)AuthorFilesLines
2018-08-29[MinGW] [X86] Add stubs for references to data variables that might end up ↵Martin Storsjo1-0/+1
imported from a dll Variables declared with the dllimport attribute are accessed via a stub variable named __imp_<var>. In MinGW configurations, variables that aren't declared with a dllimport attribute might still end up imported from another DLL with runtime pseudo relocs. For x86_64, this avoids the risk that the target is out of range for a 32 bit PC relative reference, in case the target DLL is loaded further than 4 GB from the reference. It also avoids having to make the text section writable at runtime when doing the runtime fixups, which makes it worthwhile to do for i386 as well. Add stub variables for all dso local data references where a definition of the variable isn't visible within the module, since the DLL data autoimporting might make them imported even though they are marked as dso local within LLVM. Don't do this for variables that actually are defined within the same module, since we then know for sure that it actually is dso local. Don't do this for references to functions, since there's no need for runtime pseudo relocations for autoimporting them; if a function from a different DLL is called without the appropriate dllimport attribute, the call just gets routed via a thunk instead. GCC does something similar since 4.9 (when compiling with -mcmodel=medium or large; from that version, medium is the default code model for x86_64 mingw), but only for x86_64. Differential Revision: https://reviews.llvm.org/D51288 llvm-svn: 340942
2017-10-26[MachineModuleInfoImpls] Replace qsort with array_pod_sortMandeep Singh Grang1-10/+4
Summary: This seems to be the only place in llvm we directly call qsort. We can replace this with a call to array_pod_sort. Also minor cleanup of the sorting function. Reviewers: bkramer, Eugene.Zelenko, rafael Reviewed By: bkramer Subscribers: efriedma, llvm-commits Differential Revision: https://reviews.llvm.org/D39214 llvm-svn: 316671
2017-10-10[CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko1-3/+7
other minor fixes (NFC). llvm-svn: 315380
2017-06-16[WebAssembly] Use __stack_pointer global when writing wasm binarySam Clegg1-1/+0
This ensures that symbolic relocations are generated for stack pointer manipulations. These relocations are of type R_WEBASSEMBLY_GLOBAL_INDEX_LEB. This change also adds support for reading relocations of this type in WasmObjectFile.cpp. Since its a globally imported symbol this does mean that the get_global/set_global instruction won't be valid until the objects are linked that global used in no longer an imported global. Differential Revision: https://reviews.llvm.org/D34172 llvm-svn: 305616
2017-02-24[WebAssembly] Add support for using a wasm global for the stack pointer.Dan Gohman1-0/+1
This replaces the __stack_pointer variable which was allocated in linear memory. llvm-svn: 296201
2015-04-07Clear the stub map in getSortedStubs.Rafael Espindola1-5/+4
This makes sure they are only output once (and frees a bit of memory). llvm-svn: 234313
2012-09-26Rename virtual table anchors from Anchor() to anchor() for consistency with ↵Craig Topper1-2/+2
the rest of the tree. llvm-svn: 164666
2010-03-10Add a bit along with the MCSymbols stored in the MachineModuleInfo maps thatBill Wendling1-5/+4
indicates that an MCSymbol is external or not. (It's true if it's external.) This will be used to specify the correct information to add to non-lazy pointers. That will be explained further when this bit is used. llvm-svn: 98199
2010-02-15Preliminary patch to improve dwarf EH generation - Hooks to return ↵Anton Korobeynikov1-5/+6
Personality / FDE / LSDA / TType encoding depending on target / options (e.g. code model / relocation model) - MCIzation of Dwarf EH printer to use encoding information - Stub generation for ELF target (needed for indirect references) - Some other small changes here and there llvm-svn: 96285
2010-02-03make MachineModuleInfoMachO hold non-const MCSymbol*'s insteadChris Lattner1-4/+4
of const ones. non-const ones aren't very useful, because you can't even, say, emit them. llvm-svn: 95205
2009-09-16Don't sort the vector when it is empty. This should fix some expensive checkingBenjamin Kramer1-1/+2
failures. llvm-svn: 82040
2009-09-16add a new MachineModuleInfoMachO class, which is the per-moduleChris Lattner1-0/+44
stuff common across all macho targets. llvm-svn: 82018