aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/MachOWriter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* It makes no sense to have a ODR version of commonDuncan Sands2009-03-111-2/+1
| | | | | | | linkage, so remove it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66690 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce new linkage types linkonce_odr, weak_odr, common_odrDuncan Sands2009-03-071-3/+6
| | | | | | | | | | | | | | | | | | | | | | and extern_weak_odr. These are the same as the non-odr versions, except that they indicate that the global will only be overridden by an *equivalent* global. In C, a function with weak linkage can be overridden by a function which behaves completely differently. This means that IP passes have to skip weak functions, since any deductions made from the function definition might be wrong, since the definition could be replaced by something completely different at link time. This is not allowed in C++, thanks to the ODR (One-Definition-Rule): if a function is replaced by another at link-time, then the new function must be the same as the original function. If a language knows that a function or other global can only be overridden by an equivalent global, it can give it the weak_odr linkage type, and the optimizers will understand that it is alright to make deductions based on the function body. The code generators on the other hand map weak and weak_odr linkage to the same thing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66339 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support to the JIT for true non-lazy operation. When a call to a functionNate Begeman2009-02-181-0/+5
| | | | | | | | | | | | | | | | | | | | | that has not been JIT'd yet, the callee is put on a list of pending functions to JIT. The call is directed through a stub, which is updated with the address of the function after it has been JIT'd. A new interface for allocating and updating empty stubs is provided. Add support for removing the ModuleProvider the JIT was created with, which would otherwise invalidate the JIT's PassManager, which is initialized with the ModuleProvider's Module. Add support under a new ExecutionEngine flag for emitting the infomration necessary to update Function and GlobalVariable stubs after JITing them, by recording the address of the stub and the name of the GlobalValue. This allows code to be copied from one address space to another, where libraries may live at different virtual addresses, and have the stubs updated with their new correct target addresses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64906 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the private linkage.Rafael Espindola2009-01-151-1/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62279 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename getABITypeSize to getTypePaddedSize, asDuncan Sands2009-01-121-6/+6
| | | | | | | suggested by Chris. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62099 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some release-assert warningsChris Lattner2008-12-191-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61244 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix MachineCodeEmitter to use uintptr_t instead of intptr_t. This avoids ↵Evan Cheng2008-12-101-7/+7
| | | | | | some overflow issues. Patch by Thomas Jablin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60828 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename startFunctionStub to startGVStub since it's also used for GV non-lazy ↵Evan Cheng2008-11-081-3/+3
| | | | | | ptr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58897 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename APFloat::convertToAPInt to bitcastToAPInt toDale Johannesen2008-10-091-2/+2
| | | | | | | | | make it clearer what the function does. No functional change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57325 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman2008-09-041-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55779 91177308-0d34-0410-b5e6-96231b3b80d8
* Use raw_ostream throughout the AsmPrinter.Owen Anderson2008-08-211-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55092 91177308-0d34-0410-b5e6-96231b3b80d8
* Use isSingleValueType instead of isFirstClassType toDan Gohman2008-05-231-1/+1
| | | | | | | exclude struct and array types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51459 91177308-0d34-0410-b5e6-96231b3b80d8
* Add CommonLinkage; currently tentative definitionsDale Johannesen2008-05-141-1/+3
| | | | | | | | | | | | are represented as "weak", but there are subtle differences in some cases on Darwin, so we need both. The intent is that "common" will behave identically to "weak" unless somebody changes their target to do something else. No functional change as yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51118 91177308-0d34-0410-b5e6-96231b3b80d8
* Correlate stubs with functions in JIT: when emitting a stub, the JIT tells ↵Nicolas Geoffray2008-04-161-2/+3
| | | | | | | | | | the memory manager which function the stub will resolve. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49814 91177308-0d34-0410-b5e6-96231b3b80d8
* Use PassManagerBase instead of FunctionPassManager for functionsDan Gohman2008-03-111-2/+2
| | | | | | | | | that merely add passes. This allows them to be used with either FunctionPassManager or PassManager, or even with a custom new kind of pass manager. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48256 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak build with gcc 4.3: provide missed includes and silence most ↵Anton Korobeynikov2008-02-201-0/+1
| | | | | | annoying warnings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47367 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable exception handling int JITNicolas Geoffray2008-02-131-0/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47079 91177308-0d34-0410-b5e6-96231b3b80d8
* Use getPreferredAlignmentLog or getPreferredAlignmentDuncan Sands2008-01-291-4/+2
| | | | | | | | to get the alignment of global variables, rather than using hand-made versions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46495 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate the remaining uses of getTypeSize. ThisDuncan Sands2007-11-051-6/+8
| | | | | | | | | | | | | | | should only effect x86 when using long double. Now 12/16 bytes are output for long double globals (the exact amount depends on the alignment). This brings globals in line with the rest of LLVM: the space reserved for an object is now always the ABI size. One tricky point is that only 10 bytes should be output for long double if it is a field in a packed struct, which is the reason for the additional argument to EmitGlobalConstant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43688 91177308-0d34-0410-b5e6-96231b3b80d8
* Revise previous patch per review comments.Dale Johannesen2007-09-121-4/+4
| | | | | | | | | Next round of x87 long double stuff. Getting close now, basically works. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41875 91177308-0d34-0410-b5e6-96231b3b80d8
* Add APInt interfaces to APFloat (allows directlyDale Johannesen2007-09-111-4/+4
| | | | | | | | | | | access to bits). Use them in place of float and double interfaces where appropriate. First bits of x86 long double constants handling (untested, probably does not work). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41858 91177308-0d34-0410-b5e6-96231b3b80d8
* Next round of APFloat changes.Dale Johannesen2007-09-061-2/+4
| | | | | | | | | | | | | | | Use APFloat in UpgradeParser and AsmParser. Change all references to ConstantFP to use the APFloat interface rather than double. Remove the ConstantFP double interfaces. Use APFloat functions for constant folding arithmetic and comparisons. (There are still way too many places APFloat is just a wrapper around host float/double, but we're getting there.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41747 91177308-0d34-0410-b5e6-96231b3b80d8
* Drop 'const'Devang Patel2007-05-031-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36662 91177308-0d34-0410-b5e6-96231b3b80d8
* Use 'static const char' instead of 'static const int'.Devang Patel2007-05-021-1/+1
| | | | | | | | Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36652 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not use typeinfo to identify pass in pass manager.Devang Patel2007-05-011-1/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36632 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unneeded header file.Reid Spencer2007-03-041-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34903 91177308-0d34-0410-b5e6-96231b3b80d8
* http://llvm.org/bugs/show_bug.cgi?id=1237Nate Begeman2007-03-031-5/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34875 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a typo, thanks Bill!Nate Begeman2007-02-281-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34741 91177308-0d34-0410-b5e6-96231b3b80d8
* More Mach-O writer improvements.Nate Begeman2007-02-281-29/+56
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34740 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1195:Reid Spencer2007-02-151-1/+1
| | | | | | | | Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and PackedTyID -> VectorTyID. No functional changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34293 91177308-0d34-0410-b5e6-96231b3b80d8
* Generalize TargetData strings, to support more interesting forms of data.Chris Lattner2007-02-141-2/+2
| | | | | | | Patch by Scott Michel. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34266 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate temporary vectors.Chris Lattner2007-02-101-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34161 91177308-0d34-0410-b5e6-96231b3b80d8
* Privatize StructLayout::MemberOffsets, adding an accessorChris Lattner2007-02-101-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34156 91177308-0d34-0410-b5e6-96231b3b80d8
* Add function to create a file writer.Bill Wendling2007-02-081-2/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34031 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a fixme by correctly calculating preferred alignments for functions,Nate Begeman2007-02-071-11/+14
| | | | | | | | | | based on the alignment of the symbol and the target data's preferred align for that type. Also, rename some arguments for consistency. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33984 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass in non-Mach-O-specific parameters to the GetTargetRelocation method.Bill Wendling2007-02-031-2/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33816 91177308-0d34-0410-b5e6-96231b3b80d8
* Properly support cstringsNate Begeman2007-01-291-3/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33629 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle multiple functions, properly mangle symbols, and fix support forNate Begeman2007-01-261-16/+41
| | | | | | | scattered relocations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33555 91177308-0d34-0410-b5e6-96231b3b80d8
* Make ivars private and use getters. Have the MachOWriter return "Mach-OBill Wendling2007-01-241-2/+2
| | | | | | | Writer" for the pass name. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33483 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the TargetMachOWriterInfo class to get this information.Bill Wendling2007-01-241-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33478 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach TargetData to handle 'preferred' alignment for each target, and useChris Lattner2007-01-201-1/+1
| | | | | | | these alignment amounts to align scalars when we can. Patch by Scott Michel! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33409 91177308-0d34-0410-b5e6-96231b3b80d8
* Have the OutputBuffer take the is64Bit and isLittleEndian booleans.Bill Wendling2007-01-181-7/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33316 91177308-0d34-0410-b5e6-96231b3b80d8
* Changed to use the OutputBuffer instead of the methods in MachO and ELFBill Wendling2007-01-171-74/+88
| | | | | | | writers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33311 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert patch.Bill Wendling2007-01-171-90/+76
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33298 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the methods in the TargetObjInfo object instead of internal methods.Bill Wendling2007-01-171-76/+90
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33289 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1064:Reid Spencer2007-01-121-29/+39
| | | | | | | | | | | | | | | | | | | | | | | | Implement the arbitrary bit-width integer feature. The feature allows integers of any bitwidth (up to 64) to be defined instead of just 1, 8, 16, 32, and 64 bit integers. This change does several things: 1. Introduces a new Derived Type, IntegerType, to represent the number of bits in an integer. The Type classes SubclassData field is used to store the number of bits. This allows 2^23 bits in an integer type. 2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and 64-bit integers. These are replaced with just IntegerType which is not a primitive any more. 3. Adjust the rest of LLVM to account for this change. Note that while this incremental change lays the foundation for arbitrary bit-width integers, LLVM has not yet been converted to actually deal with them in any significant way. Most optimization passes, for example, will still only deal with the byte-width integer types. Future increments will rectify this situation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33113 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename BoolTy as Int1Ty. Patch by Sheng Zhou.Reid Spencer2007-01-111-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33076 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR950:Reid Spencer2006-12-311-8/+4
| | | | | | | | | | | | | | | | | | | Three changes: 1. Convert signed integer types to signless versions. 2. Implement the @sext and @zext parameter attributes. Previously the type of an function parameter was used to determine whether it should be sign extended or zero extended before the call. This information is now communicated via the function type's parameter attributes. 3. The interface to LowerCallTo had to be changed in order to accommodate the parameter attribute information. Although it would have been convenient to pass in the FunctionType itself, there isn't always one present in the caller. Consequently, a signedness indication for the result type and for each parameter was provided for in the interface to this method. All implementations were changed to make the adjustment necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32788 91177308-0d34-0410-b5e6-96231b3b80d8
* Properly mangles symbol table namesNate Begeman2006-12-111-112/+333
| | | | | | | | | | Supports constant pools Supports relocations to jump tables Supports relocations within the data segment (global = address of global) Allocates memory in a non-hacky for all non-code objects. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32430 91177308-0d34-0410-b5e6-96231b3b80d8