summaryrefslogtreecommitdiff
path: root/utils/llvm.grm
Commit message (Collapse)AuthorAge
* Remove the linker_private and linker_private_weak linkages.Rafael Espindola2014-03-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These linkages were introduced some time ago, but it was never very clear what exactly their semantics were or what they should be used for. Some investigation found these uses: * utf-16 strings in clang. * non-unnamed_addr strings produced by the sanitizers. It turns out they were just working around a more fundamental problem. For some sections a MachO linker needs a symbol in order to split the section into atoms, and llvm had no idea that was the case. I fixed that in r201700 and it is now safe to use the private linkage. When the object ends up in a section that requires symbols, llvm will use a 'l' prefix instead of a 'L' prefix and things just work. With that, these linkages were already dead, but there was a potential future user in the objc metadata information. I am still looking at CGObjcMac.cpp, but at this point I am convinced that linker_private and linker_private_weak are not what they need. The objc uses are currently split in * Regular symbols (no '\01' prefix). LLVM already directly provides whatever semantics they need. * Uses of a private name (start with "\01L" or "\01l") and private linkage. We can drop the "\01L" and "\01l" prefixes as soon as llvm agrees with clang on L being ok or not for a given section. I have two patches in code review for this. * Uses of private name and weak linkage. The last case is the one that one could think would fit one of these linkages. That is not the case. The semantics are * the linker will merge these symbol by *name*. * the linker will hide them in the final DSO. Given that the merging is done by name, any of the private (or internal) linkages would be a bad match. They allow llvm to rename the symbols, and that is really not what we want. From the llvm point of view, these objects should really be (linkonce|weak)(_odr)?. For now, just keeping the "\01l" prefix is probably the best for these symbols. If we one day want to have a more direct support in llvm, IMHO what we should add is not a linkage, it is just a hidden_symbol attribute. It would be applicable to multiple linkages. For example, on weak it would produce the current behavior we have for objc metadata. On internal, it would be equivalent to private (and we should then remove private). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203866 91177308-0d34-0410-b5e6-96231b3b80d8
* Unify clang/llvm attributes for asan/tsan/msan (LLVM part)Kostya Serebryany2013-02-26
| | | | | | | | | | | | | | | | | | | | These are two related changes (one in llvm, one in clang). LLVM: - rename address_safety => sanitize_address (the enum value is the same, so we preserve binary compatibility with old bitcode) - rename thread_safety => sanitize_thread - rename no_uninitialized_checks -> sanitize_memory CLANG: - add __attribute__((no_sanitize_address)) as a synonym for __attribute__((no_address_safety_analysis)) - add __attribute__((no_sanitize_thread)) - add __attribute__((no_sanitize_memory)) for S in address thread memory If -fsanitize=S is present and __attribute__((no_sanitize_S)) is not set llvm attribute sanitize_S git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176075 91177308-0d34-0410-b5e6-96231b3b80d8
* [tsan/msan] adding thread_safety and uninitialized_checks attributesKostya Serebryany2013-02-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174864 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Remove the Inline Asm Non-Standard Dialect attribute. ThisChad Rosier2012-09-04
| | | | | | | implementation does not co-exist well with how the sideeffect and alignstack attributes are handled. The reverts r161641. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163174 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Add a new Inline Asm Non-Standard Dialect attribute.Chad Rosier2012-08-10
| | | | | | | | | | | | | | This new attribute is intended to be used by the backend to determine how the inline asm string should be parsed/printed. This patch adds the ia_nsdialect attribute and also adds a test case to ensure the IR is correctly parsed, but there is no functional change at this time. The standard dialect is assumed to be AT&T. Therefore, this attribute should only be added to MS-style inline assembly statements, which use the Intel dialect. If we ever support more dialects we'll need to add additional state to the attribute. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161641 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend Attributes to 64 bitsKostya Serebryany2012-01-20
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: LLVM needs more function attributes than currently available (32 bits). One such proposed attribute is "address_safety", which shows that a function is being checked for address safety (by AddressSanitizer, SAFECode, etc). Solution: - extend the Attributes from 32 bits to 64-bits - wrap the object into a class so that unsigned is never erroneously used instead - change "unsigned" to "Attributes" throughout the code, including one place in clang. - the class has no "operator uint64 ()", but it has "uint64_t Raw() " to support packing/unpacking. - the class has "safe operator bool()" to support the common idiom: if (Attributes attr = getAttrs()) useAttrs(attr); - The CTOR from uint64_t is marked explicit, so I had to add a few explicit CTOR calls - Add the new attribute "address_safety". Doing it in the same commit to check that attributes beyond first 32 bits actually work. - Some of the functions from the Attribute namespace are worth moving inside the class, but I'd prefer to have it as a separate commit. Tested: "make check" on Linux (32-bit and 64-bit) and Mac (10.6) built/run spec CPU 2006 on Linux with clang -O2. This change will break clang build in lib/CodeGen/CGCall.cpp. The following patch will fix it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148553 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove last references to hotpatch.Rafael Espindola2011-10-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141057 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new function attribute, nonlazybind, which inhibits lazy-loadingJohn McCall2011-06-15
| | | | | | | | | | | | | | | | | | optimizations when emitting calls to the function; instead those calls may use faster relocations which require the function to be immediately resolved upon loading the dynamic object featuring the call. This is useful when it is known that the function will be called frequently and pervasively and therefore there is no merit in delaying binding of the function. Currently only implemented for x86-64, where it turns into a call through the global offset table. Patch by Dan Gohman, who assures me that he's going to add LangRef documentation for this once it's committed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133080 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't worry about union types.Dan Gohman2010-08-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112427 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the polygen grammar for linker_private and linker_private_weak,Dan Gohman2010-08-04
| | | | | | | and add comments about major implemented features. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110215 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a polygen rule that reflects the fact that nsw and nuw can beDan Gohman2010-05-04
| | | | | | | used together in either order. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102983 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the alignstack keyword.Dan Gohman2010-03-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97457 91177308-0d34-0410-b5e6-96231b3b80d8
* Reintroduce the InlineHint function attribute.Jakob Stoklund Olesen2010-02-06
| | | | | | | | | | | | This time it's for real! I am going to hook this up in the frontends as well. The inliner has some experimental heuristics for dealing with the inline hint. When given a -respect-inlinehint option, functions marked with the inline keyword are given a threshold just above the default for -O3. We need some experiments to determine if that is the right thing to do. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95466 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the InlineHint attribute. There are no current or plannedEric Christopher2010-01-15
| | | | | | | users. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93558 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an 'inline hint' attribute to represent sourceDale Johannesen2009-08-26
| | | | | | | | | | code hints that it would be a good idea to inline a function ("inline" keyword). No functional change yet; FEs do not emit this and inliner does not use it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80063 91177308-0d34-0410-b5e6-96231b3b80d8
* Add inbounds to the polygen grammar.Dan Gohman2009-07-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77261 91177308-0d34-0410-b5e6-96231b3b80d8
* Add new optimization keywords to the polygen grammar.Dan Gohman2009-07-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76811 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the private keyword to the polygen grammar.Dan Gohman2009-07-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76135 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the vicmp and vfcmp instructions. Because we never had a release withNick Lewycky2009-07-08
| | | | | | | | these instructions, no autoupgrade or backwards compatibility support is provided. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74991 91177308-0d34-0410-b5e6-96231b3b80d8
* Split the Add, Sub, and Mul instruction opcodes into separateDan Gohman2009-06-04
| | | | | | | | | | | | | | | | integer and floating-point opcodes, introducing FAdd, FSub, and FMul. For now, the AsmParser, BitcodeReader, and IRBuilder all preserve backwards compatability, and the Core LLVM APIs preserve backwards compatibility for IR producers. Most front-ends won't need to change immediately. This implements the first step of the plan outlined here: http://nondot.org/sabre/LLVMNotes/IntegerOverflow.txt git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72897 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the polygen grammer to reflect that zext and sext are no longerDan Gohman2009-03-30
| | | | | | | valid argument attributes (zeroext and signext are). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68053 91177308-0d34-0410-b5e6-96231b3b80d8
* It makes no sense to have a ODR version of commonDuncan Sands2009-03-11
| | | | | | | linkage, so remove it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66690 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the one-definition-rule version of extern_weakDuncan Sands2009-03-11
| | | | | | | | linkage: this linkage type only applies to declarations, but ODR is only relevant to globals with definitions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66650 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce new linkage types linkonce_odr, weak_odr, common_odrDuncan Sands2009-03-07
| | | | | | | | | | | | | | | | | | | | | | 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
* Fix a thinko in the grammar for thread_local variables.Dan Gohman2009-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61767 91177308-0d34-0410-b5e6-96231b3b80d8
* A few more polygen grammar updates.Dan Gohman2009-01-05
| | | | | | | | | | | - After GlobalAssign, emit addrspace before global/constant, to follow the new syntax. - Eliminate "type void", which is now invalid. - Fix invalid liblists like [, "foo"]. - Tweak whitespace in a few places. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61706 91177308-0d34-0410-b5e6-96231b3b80d8
* Update polygen grammar for recent language changes.Dan Gohman2009-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61669 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the LLVM polygen grammar for recent language changes:Dan Gohman2008-09-15
| | | | | | | x86_ssecallcc, function notes, and some whitespace adjustments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56221 91177308-0d34-0410-b5e6-96231b3b80d8
* AsmParser support for immediate constant aggregate values.Dan Gohman2008-06-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52149 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the polygen grammer for the new insertvalue and extractvalue syntax.Dan Gohman2008-06-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51879 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the spelling of the va_arg keyword.Dan Gohman2008-05-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51484 91177308-0d34-0410-b5e6-96231b3b80d8
* Make structs and arrays first-class types, and add assemblyDan Gohman2008-05-23
| | | | | | | | | | and bitcode support for the extractvalue and insertvalue instructions and constant expressions. Note that this does not yet include CodeGen support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51468 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a polygen grammar definition for LLVM assembly language.Dan Gohman2008-05-22
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51449 91177308-0d34-0410-b5e6-96231b3b80d8