summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/address-safety-attr.cpp
Commit message (Collapse)AuthorAgeFilesLines
* IRGen: Add optnone attribute on function during O0Mehdi Amini2017-05-291-4/+4
| | | | | | | | | | | Amongst other, this will help LTO to correctly handle/honor files compiled with O0, helping debugging failures. It also seems in line with how we handle other options, like how -fnoinline adds the appropriate attribute as well. Differential Revision: https://reviews.llvm.org/D28404 llvm-svn: 304127
* Cleanup the handling of noinline function attributes, -fno-inline,Chandler Carruth2016-12-231-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -fno-inline-functions, -O0, and optnone. These were really, really tangled together: - We used the noinline LLVM attribute for -fno-inline - But not for -fno-inline-functions (breaking LTO) - But we did use it for -finline-hint-functions (yay, LTO is happy!) - But we didn't for -O0 (LTO is sad yet again...) - We had weird structuring of CodeGenOpts with both an inlining enumeration and a boolean. They interacted in weird ways and needlessly. - A *lot* of set smashing went on with setting these, and then got worse when we considered optnone and other inlining-effecting attributes. - A bunch of inline affecting attributes were managed in a completely different place from -fno-inline. - Even with -fno-inline we failed to put the LLVM noinline attribute onto many generated function definitions because they didn't show up as AST-level functions. - If you passed -O0 but -finline-functions we would run the normal inliner pass in LLVM despite it being in the O0 pipeline, which really doesn't make much sense. - Lastly, we used things like '-fno-inline' to manipulate the pass pipeline which forced the pass pipeline to be much more parameterizable than it really needs to be. Instead we can *just* use the optimization level to select a pipeline and control the rest via attributes. Sadly, this causes a bunch of churn in tests because we don't run the optimizer in the tests and check the contents of attribute sets. It would be awesome if attribute sets were a bit more FileCheck friendly, but oh well. I think this is a significant improvement and should remove the semantic need to change what inliner pass we run in order to comply with the requested inlining semantics by relying completely on attributes. It also cleans up tho optnone and related handling a bit. One unfortunate aspect of this is that for generating alwaysinline routines like those in OpenMP we end up removing noinline and then adding alwaysinline. I tried a bunch of other approaches, but because we recompute function attributes from scratch and don't have a declaration here I couldn't find anything substantially cleaner than this. Differential Revision: https://reviews.llvm.org/D28053 llvm-svn: 290398
* Remove 24 instances of 'REQUIRES: shell'Reid Kleckner2016-10-201-4/+3
| | | | | | | | | | | | | | | | | Tests fall into one of the following categories: - The requirement was unnecessary - Additional quoting was required for backslashes in paths (see "sed -e 's/\\/\\\\/g'") in the sanitizer tests. - OpenMP used 'REQUIRES: shell' as a proxy for the test failing on Windows. Those tests fail there reliably, so use XFAIL instead. I tried not to remove shell requirements that were added to suppress flaky test failures, but if I screwed up, we can add it back as needed. llvm-svn: 284793
* Implement no_sanitize attribute.Peter Collingbourne2015-05-151-10/+49
| | | | | | Differential Revision: http://reviews.llvm.org/D9631 llvm-svn: 237463
* Fix test failure caused by r235537. It does not run on Windows due to ↵Reid Kleckner2015-04-221-17/+12
| | | | | | REQUIRES: shell llvm-svn: 235551
* Fixup for r220403: Use getFileLoc() instead of getSpellingLoc() in ↵Alexey Samsonov2014-10-221-1/+7
| | | | | | | | | SanitizerBlacklist. This also handles the case where function name (not its body) is obtained from macro expansion. llvm-svn: 220407
* SanitizerBlacklist: Use spelling location for blacklisting purposes.Alexey Samsonov2014-10-221-0/+9
| | | | | | | | | When SanitizerBlacklist decides if the SourceLocation is blacklisted, we need to first turn it into a SpellingLoc before fetching the filename and scanning "src:" entries. Otherwise we will fail to fecth the correct filename for function definitions coming from macro expansion. llvm-svn: 220403
* SanitizerBlacklist: blacklist functions by their source location.Alexey Samsonov2014-10-171-14/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit changes the way we blacklist functions in ASan, TSan, MSan and UBSan. We used to treat function as "blacklisted" and turned off instrumentation in it in two cases: 1) Function is explicitly blacklisted by its mangled name. This part is not changed. 2) Function is located in llvm::Module, whose identifier is contained in the list of blacklisted sources. This is completely wrong, as llvm::Module may not correspond to the actual source file function is defined in. Also, function can be defined in a header, in which case user had to blacklist the .cpp file this header was #include'd into, not the header itself. Such functions could cause other problems - for instance, if the header was included in multiple source files, compiled separately and linked into a single executable, we could end up with both instrumented and non-instrumented version of the same function participating in the same link. After this change we will make blacklisting decision based on the SourceLocation of a function definition. If a function is not explicitly defined in the source file, (for example, the function is compiler-generated and responsible for initialization/destruction of a global variable), then it will be blacklisted if the corresponding global variable is defined in blacklisted source file, and will be instrumented otherwise. After this commit, the active users of blacklist files may have to revisit them. This is a backwards-incompatible change, but I don't think it's possible or makes sense to support the old incorrect behavior. I plan to make similar change for blacklisting GlobalVariables (which is ASan-specific). llvm-svn: 219997
* [Sanitize] Don't emit function attribute sanitize_address/thread/memory if ↵Alexey Samsonov2013-03-061-11/+29
| | | | | | the function is blacklisted. llvm-svn: 176550
* Add more of the command line options as attribute flags.Bill Wendling2013-02-281-22/+26
| | | | | | These can be easily queried by the back-end. llvm-svn: 176304
* Reapply r176133 with testcase fixes.Bill Wendling2013-02-271-6/+3
| | | | llvm-svn: 176145
* Unify clang/llvm attributes for asan/tsan/msan (Clang part)Kostya Serebryany2013-02-261-8/+8
| | | | | | | | | | | | | | | | | | | 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 llvm-svn: 176076
* Make for x86 to stop it failing on ARM buildbots.Bill Wendling2013-02-221-3/+3
| | | | llvm-svn: 175834
* Try to get buildbots to pass these tests.Bill Wendling2013-02-211-9/+12
| | | | llvm-svn: 175784
* Attempt to clean up tests for non-X86 platforms.Bill Wendling2013-02-201-19/+24
| | | | llvm-svn: 175652
* Modify the tests to use attribute group references instead of listing theBill Wendling2013-02-201-15/+22
| | | | | | function attributes. llvm-svn: 175606
* clang/test/CodeGen: Suppress a couple of tests on win32. It seems ↵NAKAMURA Takumi2013-01-181-0/+3
| | | | | | -fsanitize-blacklist doesn't accept DOSish pathnames. llvm-svn: 172820
* [ubsan] Add support for -fsanitize-blacklistWill Dietz2013-01-181-0/+2
| | | | llvm-svn: 172808
* Use the individual -fsanitize=<...> arguments to control which of the UBSanRichard Smith2012-11-051-1/+1
| | | | | | | checks to enable. Remove frontend support for -fcatch-undefined-behavior, -faddress-sanitizer and -fthread-sanitizer now that they don't do anything. llvm-svn: 167413
* [asan] add missing asan instrumentation in generated global init functionsKostya Serebryany2012-06-261-0/+6
| | | | llvm-svn: 159191
* The following patch adds __attribute__((no_address_safety_analysis)) which ↵Kostya Serebryany2012-01-241-0/+35
will allow to disable address safety analysis (such as e.g. AddressSanitizer or SAFECode) for a specific function. When building with AddressSanitizer, add AddressSafety function attribute to every generated function except for those that have __attribute__((no_address_safety_analysis)). With this patch we will be able to 1. disable AddressSanitizer for a particular function 2. disable AddressSanitizer-hostile optimizations (such as some cases of load widening) when AddressSanitizer is on. llvm-svn: 148842
OpenPOWER on IntegriCloud