summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/ms-declspecs.c
Commit message (Collapse)AuthorAgeFilesLines
* Bring r325915 back.Rafael Espindola2018-02-231-7/+7
| | | | | | | | | | | | | | | The tests that failed on a windows host have been fixed. Original message: Start setting dso_local for COFF. With this there are still some GVs where we don't set dso_local because setGVProperties is never called. I intend to fix that in followup commits. This is just the bare minimum to teach shouldAssumeDSOLocal what it should do for COFF. llvm-svn: 325940
* Revert "Start setting dso_local for COFF."Rafael Espindola2018-02-231-7/+7
| | | | | | | | This reverts commit r325915. It will take some time to fix the failures on a windows host. llvm-svn: 325929
* Start setting dso_local for COFF.Rafael Espindola2018-02-231-7/+7
| | | | | | | | | With this there are still some GVs where we don't set dso_local because setGVProperties is never called. I intend to fix that in followup commits. This is just the bare minimum to teach shouldAssumeDSOLocal what it should do for COFF. llvm-svn: 325915
* Replace some stray uses of the old spelling of the flag with the newChandler Carruth2017-01-121-1/+1
| | | | | | spelling. NFC. llvm-svn: 291851
* Cleanup the handling of noinline function attributes, -fno-inline,Chandler Carruth2016-12-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -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
* Reorder the check strings in test case following r252692.Akira Hatanaka2015-11-111-1/+1
| | | | | | rdar://problem/19836465 llvm-svn: 252693
* [MS Compat] Add support for __declspec(noalias)David Majnemer2015-07-201-0/+5
| | | | | | | The attribute '__declspec(noalias)' communicates that the function only accesses memory pointed to by its pointer-typed arguments. llvm-svn: 242728
* Don't crash when a selectany symbol would get common linkageNico Weber2015-04-151-1/+3
| | | | | | | | | | | | | | | | Things can't both be in comdats and have common linkage, so never give things in comdats common linkage. Common linkage is only used in .c files, and the only thing that can trigger a comdat in c is selectany from what I can tell. Fixes PR23243. Also address an over-the-shoulder review comment from rnk by moving the hasAttr<SelectAnyAttr>() in Decl.cpp around a bit. It only makes a minor difference for selectany on global variables, so it goes well with the rest of this patch. http://reviews.llvm.org/D9042 llvm-svn: 235053
* Make __declspec(selectany) turn variable declartions into definitions.Nico Weber2015-04-151-0/+4
| | | | | | Fixes PR23242. llvm-svn: 235046
* [patch][pr19848] Produce explicit comdats in clang.Rafael Espindola2015-01-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The llvm IR until recently had no support for comdats. This was a problem when targeting C++ on ELF/COFF as just using weak linkage would cause quite a bit of dead bits to remain on the executable (unless -ffunction-sections, -fdata-sections and --gc-sections were used). To fix the problem, llvm's codegen will just assume that any weak or linkonce that is not in an explicit comdat should be output in one with the same name as the global. This unfortunately breaks cases like pr19848 where a weak symbol is not xpected to be part of any comdat. Now that we have explicit comdats in the IR, we can finally get both cases right. This first patch just makes clang give explicit comdats to GlobalValues where t is allowed to. A followup patch to llvm will then stop implicitly producing comdats. llvm-svn: 225705
* Implement __declspec(selectany) under -fms-extensionsReid Kleckner2013-05-201-0/+5
| | | | | | | | | | | | | | | | selectany only applies to externally visible global variables. It has the effect of making the data weak_odr. The MSDN docs suggest that unused definitions can only be dropped at linktime, so Clang uses weak instead of linkonce. MSVC optimizes away references to constant selectany data, so it must assume that there is only one definition, hence weak_odr. Reviewers: espindola Differential Revision: http://llvm-reviews.chandlerc.com/D814 llvm-svn: 182266
* Fix testcases to not rely upon target-* attributes.Bill Wendling2013-02-261-6/+6
| | | | llvm-svn: 176135
* Revert "Add more attributes from the command line to functions."Anna Zaks2013-02-251-6/+6
| | | | | | | | This reverts commit 176009. The commit is a likely cause of several buildbot failures. llvm-svn: 176044
* Add more attributes from the command line to functions.Bill Wendling2013-02-251-6/+6
| | | | | | | This is an ongoing process. Any command line option which a back-end cares about should be added here. llvm-svn: 176009
* Update tests so that we don't test for function-only attributes on call sites.Bill Wendling2013-02-221-1/+1
| | | | llvm-svn: 175921
* Update to use references to attribute groups instead of listing the ↵Bill Wendling2013-02-221-2/+2
| | | | | | attributes on the call/invoke instructions. llvm-svn: 175878
* Modify the tests to use attribute group references instead of listing theBill Wendling2013-02-201-5/+9
| | | | | | function attributes. llvm-svn: 175606
* Add the 'target-cpu' and 'target-features' attributes to functions.Bill Wendling2013-02-151-2/+2
| | | | | | | The back-end will use these values to reconfigure code generation for different features. llvm-svn: 175308
* Update the tests.Bill Wendling2013-01-311-2/+2
| | | | | | | This update coincides with r174110. That change ordered the attributes alphabetically. llvm-svn: 174111
* Reapplying the changes from r158717 as they were rolled back to avoid merge ↵Aaron Ballman2012-06-191-0/+8
| | | | | | conflicts from a separate problematic patch. llvm-svn: 158750
* Revert r158700 and dependent patches r158716, r158717, and r158731.Jakob Stoklund Olesen2012-06-191-8/+0
| | | | | | | | The original r158700 caused crashes in the gcc test suite, g++.abi/vtable3a.C among others. It also caused failures in the libc++ test suite. llvm-svn: 158749
* Improves parsing and semantic analysis for MS __declspec attributes. This ↵Aaron Ballman2012-06-191-0/+8
| | | | | | includes support for the align (which fixes PR12631). llvm-svn: 158717
* Turned on support for __declspecs: noreturn, noinline, nothrow and naked in ↵Aaron Ballman2012-02-231-0/+16
MS compatibility mode. llvm-svn: 151295
OpenPOWER on IntegriCloud