Граф коммитов

31763 Коммитов

Автор SHA1 Сообщение Дата
Chandler Carruth d2deee17ad Rework the selection of builtin library search paths on Linux to
precisely match the pattern and logic used by the GCC driver on Linux as
of a recent SVN checkout.

This happens to follow a *much* more principled approach. There is
a strict hierarchy of paths examined, first with multilib-suffixing,
second without such suffixing. Any and all of these directories which
exist will be added to the library search path when using GCC.

There were many places where Clang followed different paths, omitted
critical entries, and worst of all (in terms of challenges to debugging)
got the entries in a subtly wrong order.

If this breaks Clang on a distro you use, please let me know, and I'll
work with you to figure out what is needed to work on that distro. I've
checked the behavior of the latest release of Ubuntu, OpenSUSE, Fedora,
and Gentoo. I'll be testing it on those as well as Debian stable and
unstable and ArchLinux. I may even dig out a Slackware install.

No real regression tests yet, those will follow once I add enough
support for sysroot to simulate various distro layouts in the testsuite.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140981 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-03 05:28:29 +00:00
Peter Collingbourne 78dd67e78c CUDA: diagnose invalid calls across targets
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140978 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-02 23:49:40 +00:00
Peter Collingbourne 1f24076313 CUDA: add separate diagnostics for too few/many exec config args
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140977 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-02 23:49:29 +00:00
Peter Collingbourne af15b4d0aa Add ConvertArgumentsForCall diagnostics for at least/at most n args
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140976 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-02 23:49:20 +00:00
Peter Collingbourne 8591a7f521 CUDA: diagnose unconfigured calls to global functions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140975 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-02 23:49:15 +00:00
John McCall 80d2355df4 Sorry, I misunderstood the interaction here; the GNU runtime does
support both a fragile and non-fragile ABI, and it can be selected at
runtime.  That driver option also works on Darwin (although obviously
the code is not necessarily usable if the system runtime is fragile)
so just do that.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140973 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-02 20:27:18 +00:00
John McCall 591dbc7b0c Use -fgnu-runtime to force the use of the non-fragile ABI;
otherwise these tests would fail on hosts that happen to default
to that, since that affects whether default synthesis can happen.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140970 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-02 11:28:21 +00:00
Chandler Carruth 4768b9c771 Temporarily XFAIL this test until John or someone else who works on ObjC
can look at it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140968 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-02 09:52:36 +00:00
Chandler Carruth a9402e4b43 Simplify this through the power of the ternary operator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140965 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-02 07:28:34 +00:00
Chandler Carruth bc0df72408 Consolidate the currently bizarre 32/64 multilib selection logic a bit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140964 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-02 07:06:48 +00:00
Ted Kremenek 3c2b5f7d61 Fix another major performance regression in LiveVariables by not canonicalizing the underlying ImmutableSets on every analyzed statement (just at merges). Fixes <rdar://problem/10087538>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140958 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-02 01:45:37 +00:00
John McCall d1e40d5389 Make -fobjc-nonfragile-abi the -cc1 default, since it's the
increasingly prevailing case to the point that new features
like ARC don't even support the fragile ABI anymore.

This required a little bit of reshuffling with exceptions
because a check was assuming that ObjCNonFragileABI was
only being set in ObjC mode, and that's actually a bit
obnoxious to do.

Most, though, it involved a perl script to translate a ton
of test cases.

Mostly no functionality change for driver users, although
there are corner cases with disabling language-specific
exceptions that we should handle more correctly now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140957 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-02 01:16:38 +00:00
Ted Kremenek 6a835dddf4 Fix LiveVariables analysis bug with MaterializeTemporaryExpr and fix handling in ExprEngine. Fixes <rdar://problem/10201666>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140956 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-02 00:54:48 +00:00
John McCall 2b014d6c0c When performing an @throw in ARC, retain + autorelease
the pointer, being sure to do so before running cleanups
associated with that full-expression.  rdar://10042689



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140945 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-01 10:32:24 +00:00
John McCall cdda47faab Parse attributes written in an ObjC method parameter type as
attributes on the parameter declaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140944 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-01 09:56:14 +00:00
Anna Zaks b459cf34c4 Address PR10616. The crash has already been fixed by Ted in r140725, so just refactor to use existing API + test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140932 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-01 06:35:19 +00:00
John McCall e82247a71a Hey, maybe we shouldn't silently ignore decl attributes
on declarators written as types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140931 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-01 05:17:03 +00:00
Chandler Carruth 130e5efd29 As I suspected, completely non-multilib machines just get no suffix.
Make the suffixes optional everywhere, and just make sure they have the
right value. The suffixes aren't the interesting part of this test
anyways.

Sorry for the churn as I let the bots try out various patterns.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140927 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-01 02:39:57 +00:00
Richard Smith 9f569cca2a constexpr: semantic checking for constexpr functions and constructors. Based in
part on patches by Peter Collingbourne.

We diverge from the C++11 standard in a few areas, mostly related to checking
constexpr function declarations, and not just definitions. See WG21 paper
N3308=11-0078 for details.

Function invocation substitution is not available in this patch; constexpr
functions cannot yet be used from within constant expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140926 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-01 02:31:28 +00:00
Chandler Carruth 00ca8483cf Teach this test to cope with Windows suffixes so that msys builds can
run it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140925 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-01 02:08:56 +00:00
Chandler Carruth 37cbb0b8bd Correct my failure at writing proper regex's for FileCheck. Thanks Nick.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140920 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-01 01:46:47 +00:00
Chandler Carruth f3a852a247 Allow for both 'lib' and 'lib32', as both seem to be in evidence. I've
left a FIXME to go track down more distros and see if 'lib' is ever the
64-bit half.

This should hopefully appease the build bots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140915 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-01 01:26:40 +00:00
Chandler Carruth 29bbe2bca6 There might be an 'ld' without any path prefix.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140913 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-01 01:03:45 +00:00
John McCall 2cf031d33c Allow the results of cf_returns_not_retained function
calls, or calls to audited functions without an explicit
return attribute, to be casted without a bridge cast.
Tie this mechanism in with the existing exceptions to
the cast restrictions.  State those restrictions more
correctly and generalize.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140912 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-01 01:01:08 +00:00
John McCall 7df2ff45f1 Tweak the interface for analyzing the CF conventions for a name
to take a FunctionDecl* instead of an llvm::StringRef.  Eventually
we might push more logic in there, like using slightly different
conventions for C++ methods.

Also, fix a bug where 'copy' and 'create' were being caught in 
non-camel-cased strings.  We want copyFoo and CopyFoo and XCopy
but not Xcopy or xcopy.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140911 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-01 00:48:56 +00:00
Chandler Carruth c4cc403d1e Add a test that ensures we get the basic multilib '-L' flags to 'ld'
invocations on Linux.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140909 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-01 00:37:39 +00:00
Chandler Carruth eb86b5b039 Revert r140604: "Let -B work for ld paths on Linux."
This patch may do what it describes, it may not. It's hard to tell as
its completely unclear what this is supposed to do. There are also no
test cases. More importantly, this seems to have broken lots of linker
invocations on multilib Linux systems.

The manual pages for 'ld' on Linux mention translating a '=' at the
beginning of the path into a *configure time* sysroot prefix (this is,
I believe, distinct from the --sysroot flag which 'ld' also can
support). I tested this with a normal binutils 'ld', a binutils 'ld'
with the sysroot flag enabled, and gold with the sysroot flag enabled,
and all of them try to open the path '=/lib/../lib32', No translation
occurs.

I think at the very least inserting an '=' needs to be conditioned on
some indication that it is supported and desired. I'm also curious to
see what toolchain and whan environment cause it to actually make
a difference.

I'm going to add a test case for basic sanity of Linux 'ld' invocations
from Clang in a follow-up commit that would have caught this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140908 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-01 00:37:35 +00:00
Ted Kremenek 5202a4d0bb Enable -Wstrlcpy-strlcat-size by default.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140900 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30 22:52:22 +00:00
Argyrios Kyrtzidis 717a20b9ce Mark a TagDecl when it is free standing (e.g. "struct foo;")
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140894 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30 22:11:31 +00:00
Daniel Dunbar 26e0b30455 Revert my --working-directory option, which wasn't well thought through.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140889 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30 21:33:09 +00:00
Douglas Gregor 1f634c6dc9 Add a section detailing the steps required to add an expression or
statement to Clang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140888 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30 21:32:37 +00:00
Fariborz Jahanian f2e5945e3a objc arc: allow objc_returns_inner_pointer on methods that return
a reference type, since inner reference is much like an inner pointer.
// rdar://10139365


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140880 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30 20:50:23 +00:00
Benjamin Kramer f2cee5cbda Fix compiler warning about && in ||.
This time the warning found an actual bug, we don't want to handle
force_align_arg_pointer differently than __force_align_arg_pointer__.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140877 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30 20:32:22 +00:00
Bob Wilson da79da2a87 Install a copy of the libc++ headers with clang. <rdar://problem/10096516>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140876 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30 20:24:28 +00:00
Eli Friedman 9afbfbe71c Support dllimport and dllexport on x86-64 Windows. PR10978. Patch by Ruben Van Boxem.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140871 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30 18:53:25 +00:00
Fariborz Jahanian ccae76c821 objc gc: assigning to an objc object struct member through an ivar
pointer to this struct must go through the none ivar writer barrier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140867 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30 18:23:36 +00:00
Eli Friedman 225bf773d1 Minor cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140866 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30 18:19:16 +00:00
Argyrios Kyrtzidis 2dfdb948be [libclang] Introduce CXCursor_CXXAccessSpecifier for C++'s public:/private:/protected: specifiers.
Patch by Paolo Capriotti!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140864 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30 17:58:23 +00:00
David Chisnall 3c3ccd283f Remove the conditional that avoided passing the Objective-C runtime specification flags to cc1. This fixes PR10369 (__builtin_NSStringMakeConstantString() selecting the wrong runtime in C / C++ code and crashing, although it doesn't fix the problem that instantiating the Mac runtime for non-Darwin targets was crashing.)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140853 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30 13:32:35 +00:00
Sebastian Redl a891a32d37 Fix a bug in the token caching for inline constructors in C++11, and improve error recovery in both dialects. This should fix the GCC test suite failures as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140847 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30 08:32:17 +00:00
John McCall 8dfac0baaf Add explicit attributes to mark functions as having had their
CoreFoundation object-transfer properties audited, and add a #pragma
to cause them to be automatically applied to functions in a particular
span of code.  This has to be implemented largely in the preprocessor
because of the requirement that the region be entirely contained in
a single file;  that's hard to impose from the parser without registering
for a ton of callbacks.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140846 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30 05:12:12 +00:00
Ted Kremenek e4c6675ccc Fix crash when analyzing C++ code involving constant enums and switch statements (<rdar://problem/10202899>).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140844 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30 03:51:54 +00:00
Anna Zaks 0658879cc9 [analyzer] Fix a bug in RetainReleaseChecker diagnostics. It gives more precise error message on the modified test case (and prevents duplicate diagnostics when we purge at block granularity).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140840 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30 02:19:19 +00:00
Anna Zaks d309528384 [analyzer] Add -analyzer-purge option which can take on multiple values, remove -analyzer-purge=none. (Small refactor as well: move the work of constructing AnalysisManager from the callers to the class itself.)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140838 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30 02:03:00 +00:00
Eli Friedman 3fedbe1f71 Some fixes for MS-style asm parsing: specifically, add some error checking, and handle asm comments using semicolons correctly. (The comments are actually surprisingly tricky.)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140837 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30 01:13:51 +00:00
Richard Smith 55dec86897 constexpr functions are implicitly const. More tests to follow.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140831 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30 00:45:47 +00:00
Richard Smith 7426f79384 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140829 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30 00:35:43 +00:00
Richard Smith 2d23ec2980 Suggest adding 'constexpr' if the GNU extension for in-class initializers for static const float members is used in C++11 mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140828 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-30 00:33:19 +00:00
Richard Smith 947be1941e Mark the ExtWarn for in-class initialization of static const float members as a GNU extension. Don't extend the scope of this extension to all literal types in C++0x mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140820 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-29 23:18:34 +00:00
Fariborz Jahanian 0f32caff4d Minor refactoring. Enumerators may inherit the deprecated/unavailable
attributes from the enumeration type.
// rdar://10201690


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140818 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-29 22:45:21 +00:00