summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [modules] Follow the C++ standard's rule for linkage of enumerators: they haveRichard Smith2015-11-134-40/+94
| | | | | | | | | the linkage of the enumeration. For enumerators of unnamed enumerations, extend the -Wmodules-ambiguous-internal-linkage extension to allow selecting an arbitrary enumerator (but only if they all have the same value, otherwise it's ambiguous). llvm-svn: 253010
* Add support for function attribute 'disable_tail_calls'.Akira Hatanaka2015-11-132-2/+28
| | | | | | | | | | | | | | | | | | | | | | The ``disable_tail_calls`` attribute instructs the backend to not perform tail call optimization inside the marked function. For example, int callee(int); int foo(int a) __attribute__((disable_tail_calls)) { return callee(a); // This call is not tail-call optimized. } Note that this attribute is different from 'not_tail_called', which prevents tail-call optimization to the marked function. rdar://problem/8973573 Differential Revision: http://reviews.llvm.org/D12547 llvm-svn: 252986
* Remove -Wobjc-weak-compat; there isn't a compelling use case for this.John McCall2015-11-121-15/+13
| | | | llvm-svn: 252971
* Avoid duplicated diagnostic when lookup for a nested-name-specifier fails ↵Richard Smith2015-11-121-2/+5
| | | | | | due to ambiguity. llvm-svn: 252967
* [modules] Simplify and generalize the existing rule for finding hiddenRichard Smith2015-11-123-24/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | declarations in redeclaration lookup. A declaration is now visible to lookup if: * It is visible (not in a module, or in an imported module), or * We're doing redeclaration lookup and it's externally-visible, or * We're doing typo correction and looking for unimported decls. We now support multiple modules having different internal-linkage or no-linkage definitions of the same name for all entities, not just for functions, variables, and some typedefs. As previously, if multiple such entities are visible, any attempt to use them will result in an ambiguity error. This patch fixes the linkage calculation for a number of entities where we previously didn't need to get it right (using-declarations, namespace aliases, and so on). It also classifies enumerators as always having no linkage, which is a slight deviation from the C++ standard's definition, but not an observable change outside modules (this change is being discussed on the -core reflector currently). This also removes the prior special case for tag lookup, which made some cases of this work, but also led to bizarre, bogus "must use 'struct' to refer to type 'Foo' in this scope" diagnostics in C++. llvm-svn: 252960
* DR407: Rationalize how we handle tags being hidden by typedefs. Even withRichard Smith2015-11-121-17/+38
| | | | | | | | | | | | | | | | | | DR407, the C++ standard doesn't really say how this should work. Here's what we do (which is consistent with DR407 as far as I can tell): * When performing name lookup for an elaborated-type-specifier, a tag declaration hides a typedef declaration that names the same type. * When performing any other kind of lookup, a typedef declaration hides a tag declaration that names the same type. In any other case where lookup finds both a typedef and a tag (that is, when they name different types), the lookup will be ambiguous. If lookup finds a tag and a typedef that name the same type, and finds anything else, the lookup will always be ambiguous (even if the other entity would hide the tag, it does not also hide the typedef). llvm-svn: 252959
* Revert r240335.Richard Smith2015-11-122-3/+0
| | | | | | | | | | | | | | | This failed to solve the problem it was aimed at, and introduced just as many issues as it resolved. Realistically, we need to deal with the possibility that multiple modules might define different internal linkage symbols with the same name, and this isn't a problem unless two such symbols are simultaneously visible. The case where two modules define equivalent internal linkage symbols is handled by r252063: if lookup finds multiple sufficiently-similar entities from different modules, we just pick one of them as an extension (but we keep them separate). llvm-svn: 252957
* Correct atomic libcall support for __atomic_*_fetch builtins.James Y Knight2015-11-121-39/+39
| | | | | | | | | | | | | | In r244063, I had caused these builtins to call the same-named library functions, __atomic_*_fetch_SIZE. However, this was incorrect: while those functions are in fact supported by GCC's libatomic, they're not documented by the spec (and gcc doesn't ever call them). Instead, you're /supposed/ to call the __atomic_fetch_* builtins and then redo the operation inline to return the final value. Differential Revision: http://reviews.llvm.org/D14385 llvm-svn: 252920
* Add support for driver option -mno-ms-bitfields.Akira Hatanaka2015-11-121-1/+2
| | | | | | | | This option is used to cancel -mms-bitfields on the command line. rdar://problem/15898553 llvm-svn: 252912
* Cull non-standard variants of ARM architectures (NFC)Artyom Skrobov2015-11-121-5/+0
| | | | | | | | | | | | Summary: Clang-side update, corresponding to D14577 Reviewers: rengolin Subscribers: aemerson, cfe-commits, rengolin Differential Revision: http://reviews.llvm.org/D14578 llvm-svn: 252904
* [C++] Add the "norecurse" attribute to main() if in C++ modeJames Molloy2015-11-121-0/+8
| | | | | | The C++ spec (3.6.1.3) says "The function `main` shall not be used within a program". This implies that it cannot recurse, so add the norecurse attribute to help the midend out a bit. llvm-svn: 252902
* Re-recommit: Add support for the new mips-mti-linux toolchain.Vasileios Kalintiris2015-11-126-27/+253
| | | | | | | | Last time, this caused two Windows buildbots and a single ARM buildbot to fail. I XFAIL'd the failing test on win32,win64 machines in order to see if the ARM buildbot complains again. llvm-svn: 252901
* Use %select to merge two diagnostics that only differ in one word and are ↵Craig Topper2015-11-121-3/+2
| | | | | | emitted in the same place. NFC llvm-svn: 252861
* [Sema] Remove unnecessary parens in check using logical or; NFC.Nathan Wilson2015-11-121-1/+1
| | | | llvm-svn: 252855
* Refactor out some common code from r252834David Blaikie2015-11-121-39/+26
| | | | llvm-svn: 252840
* Provide a frontend based error for always_inline functions that requireEric Christopher2015-11-122-25/+74
| | | | | | | | | | | | | | | target features that the caller function doesn't provide. This matches the existing backend failure to inline functions that don't have matching target features - and diagnoses earlier in the case of always_inline. Fix up a few test cases that were, in fact, invalid if you tried to generate code from the backend with the specified target features and add a couple of tests to illustrate what's going on. This should fix PR25246. llvm-svn: 252834
* Move checkTargetFeatures to CodeGenFunction.cpp to make itEric Christopher2015-11-122-42/+43
| | | | | | more obvious that it's generic. llvm-svn: 252833
* In preparation to use it in more places renameEric Christopher2015-11-122-14/+12
| | | | | | | checkBuiltinTargetFeatures to checkTargetFeatures and sink the error handling into the function. llvm-svn: 252832
* [Basic] Fix DRY violation, just call getLineTable() (NFC)Vedant Kumar2015-11-121-8/+3
| | | | llvm-svn: 252828
* Add diagnostics which fall under [dcl.spec.concept]p5Nathan Wilson2015-11-111-0/+7
| | | | | | | | | | | | Summary: Diagnose when a function concept declaration has parameter(s) Reviewers: rsmith, faisalv, aaron.ballman, hubert.reinterpretcast Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D14352 llvm-svn: 252827
* [TLS on Darwin] treat all Darwin platforms in the same way.Manman Ren2015-11-112-4/+4
| | | | | | rdar://problem/9001553 llvm-svn: 252820
* Extract out a function onto CodeGenModule for getting the map ofEric Christopher2015-11-115-44/+47
| | | | | | | features for a particular function, then use it to clean up some code. llvm-svn: 252819
* [TLS on Darwin] change how we handle globals with linkonce or weak linkage.Manman Ren2015-11-112-11/+16
| | | | | | | | | | | | This is about how we handle static member of a template. Before this commit, we use internal linkage for the IR thread-local variable, which is inefficient. With this commit, we will start to follow Itanium C++ ABI. rdar://problem/23415206 Reviewed by John McCall. llvm-svn: 252814
* [SemaDeclCXX] Use isTemplateParamScope() rather than accessing raw bits.Davide Italiano2015-11-111-2/+2
| | | | llvm-svn: 252793
* [TLS] move setting tls_guard in tls_init.Manman Ren2015-11-111-4/+4
| | | | | | | | We used to emit the store prior to branch in the entry block. To make it more efficient, this commit moves it to the init block. We still mark as initialized before initializing anything else. llvm-svn: 252777
* Silencing a -Wreturn-type warning for control reaching the end of a non-void ↵Aaron Ballman2015-11-111-0/+1
| | | | | | function. llvm-svn: 252727
* [ASan] Allow -fsanitize-recover=address.Yury Gribov2015-11-112-5/+11
| | | | | | Differential Revision: http://reviews.llvm.org/D14243 llvm-svn: 252721
* [X86] Add 'pause' builtin that's already in llvm and use it instead of ↵Craig Topper2015-11-111-1/+1
| | | | | | inline assembly to implement _mm_pause. llvm-svn: 252712
* [X86] Use __builtin_ia32_paddq and __builtin_ia32_psubq to implement a ↵Craig Topper2015-11-111-2/+2
| | | | | | couple intrinsics that were supposed to operate on MMX registers. Otherwise we end up operating on GPRs. Throw in a test for _mm_mul_su32 while I was there. llvm-svn: 252711
* [X86] Header formatting fixes. NFCCraig Topper2015-11-112-2/+2
| | | | llvm-svn: 252710
* [X86] Add missing typecasts in intrinsic macros. This should make them more ↵Craig Topper2015-11-117-55/+85
| | | | | | robust against inputs that aren't already the right type. llvm-svn: 252700
* [X86] Change pointer type in AVX2 gather builtins to be the scalar type ↵Craig Topper2015-11-111-160/+118
| | | | | | instead of the vector type. This matches gcc and removes extras casts. llvm-svn: 252697
* Fix a FIXME about using std::is_sorted.Eric Christopher2015-11-111-3/+4
| | | | llvm-svn: 252691
* Add support for GCC's '__auto_type' extension, per the GCC manual:Richard Smith2015-11-1119-67/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | https://gcc.gnu.org/onlinedocs/gcc/Typeof.html Differences from the GCC extension: * __auto_type is also permitted in C++ (but only in places where it could appear in C), allowing its use in headers that might be shared across C and C++, or used from C++98 * __auto_type can be combined with a declarator, as with C++ auto (for instance, "__auto_type *p") * multiple variables can be declared in a single __auto_type declaration, with the C++ semantics (the deduced type must be the same in each case) This patch also adds a missing restriction on applying typeof to a bit-field, which GCC has historically rejected in C (due to lack of clarity as to whether the operand should be promoted). The same restriction also applies to __auto_type in C (in both GCC and Clang). This also fixes PR25449. Patch by Nicholas Allegra! llvm-svn: 252690
* N3922: direct-list-initialization of an auto-typed variable no longer deduces aRichard Smith2015-11-114-163/+165
| | | | | | | | | | | | | | | | | | | std::initializer_list<T> type. Instead, the list must contain a single element and the type is deduced from that. In Clang 3.7, we warned by default on all the cases that would change meaning due to this change. In Clang 3.8, we will support only the new rules -- per the request in N3922, this change is applied as a Defect Report against earlier versions of the C++ standard. This change is not entirely trivial, because for lambda init-captures we previously did not track the difference between direct-list-initialization and copy-list-initialization. The difference was not previously observable, because the two forms of initialization always did the same thing (the elements of the initializer list were always copy-initialized regardless of the initialization style used for the init-capture). llvm-svn: 252688
* [static analyzer] Don't flag nil storage into NSMutableDictionary.Anna Zaks2015-11-111-2/+1
| | | | | | This is now allowed and has the behavior of removing the mapping. llvm-svn: 252679
* Define __unsafe_unretained and __autoreleasing in ObjC GC mode.John McCall2015-11-101-0/+2
| | | | | | This was an accidental regression from the MRC __weak patch. llvm-svn: 252668
* [COFF] Don't try to emit weak aliases on COFFReid Kleckner2015-11-101-5/+10
| | | | | | | | | | | | | | | | | This comes up when a derived class destructor is equivalent to a base class destructor defined in the same TU, and we try to alias them. A COFF weak alias cannot satisfy a normal undefined symbol reference from another TU. The other TU must also mark the referenced symbol as weak, and we can't rely on that. Clang already has a special case here for dllexport, but we failed to realize that the problem also applies to other non-discardable symbols such as those from explicit template instantiations. Fixes PR25477. llvm-svn: 252659
* Implement __attribute__((internal_linkage)).Evgeniy Stepanov2015-11-103-13/+98
| | | | | | | | | | | | | | The attrubite is applicable to functions and variables and changes the linkage of the subject to internal. This is the same functionality as C-style "static", but applicable to class methods; and the same as anonymouns namespaces, but can apply to individual methods of a class. Following the proposal in http://lists.llvm.org/pipermail/cfe-dev/2015-October/045580.html llvm-svn: 252648
* [WebAssembly] Change long double to be quadruple-precision floating point.Dan Gohman2015-11-101-0/+2
| | | | llvm-svn: 252646
* Add the variant of __sparc_v9__ with five underscores, not just four.Joerg Sonnenberger2015-11-101-1/+3
| | | | llvm-svn: 252640
* [Analyzer] Fix comments and formatting. NFC.Sean Eveson2015-11-102-4/+4
| | | | llvm-svn: 252599
* [X86] Use setzero instead of set1(0) in a few places in intrinsic headers.Craig Topper2015-11-102-6/+6
| | | | llvm-svn: 252587
* [X86] Remove temporary variables from macros in x86 intrinsic headers. ↵Craig Topper2015-11-107-198/+138
| | | | | | Prevents duplicate names appearing from multiple macro expansions. NFC llvm-svn: 252586
* [X86] Fix bad intrinsic header comment. NFC.Craig Topper2015-11-101-1/+1
| | | | llvm-svn: 252585
* Use the generic Sparc CPU handling for Linux, FreeBSD and OpenBSD, too.Joerg Sonnenberger2015-11-101-29/+26
| | | | | | | | This currently changes the default toward the more historic -Av8/-Av9, but as discussed with James Y Knight, consistency is for now more important than figuring out which default CPU each OS should be using. llvm-svn: 252571
* Use the normal switch over getArch() approach and not a long if chain.Joerg Sonnenberger2015-11-101-13/+23
| | | | llvm-svn: 252562
* [Driver] Use platform-appropriate profiling libraries for WatchOS, TVOSVedant Kumar2015-11-101-2/+10
| | | | | | | | | | | | | When adding profiling instrumentation, use libclang_rt.profile_tvos.a for TVOS targets and libclang_rt.profile_watchos.a for WatchOS targets. I've also fixed up a comment and added an assert() that prevents us from defaulting to an incorrect platform. Differential Revision: http://reviews.llvm.org/D14521 Reviewed-by: t.p.northover llvm-svn: 252558
* Reorganise CPU handling for Sparc. When using -mcpu=v9 and co, __sparcv8Joerg Sonnenberger2015-11-092-17/+126
| | | | | | | | | is not defined for 32bit mode, but __sparcv9 is. Pass down the correct -target-cpu flags to the backend, so that instruction restrictions are applied correctly. Pass down the correct -A flag when not using IAS. The latter is limited to NetBSD targets in this commit. llvm-svn: 252545
* Extend linux header search to find libc++ headers in c++/vN for any N.Evgeniy Stepanov2015-11-091-6/+22
| | | | llvm-svn: 252514
OpenPOWER on IntegriCloud