aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2013-05-03Make cleanUpLocation() a self-contained function.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180986 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03[ms-cxxabi] Emit non-virtual member function pointersReid Kleckner
Without any conversion, this is pretty straightforward. Most of the fields can be zeros. The order is: - field offset or pointer - nonvirtual adjustment (for MI functions) - vbptr offset (for unspecified) - virtual adjustment offset (for virtual inheritance) Differential Revision: http://llvm-reviews.chandlerc.com/D699 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180985 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03Attempt to un-break the gdb buildbot.Adrian Prantl
- Use the debug location of the return expression for the cleanup code if the return expression is trivially evaluatable, regardless of the number of stop points in the function. - Ensure that any EH code in the cleanup still gets the line number of the closing } of the lexical scope. - Added a testcase with EH in the cleanup. rdar://problem/13442648 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180982 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03Re-apply 180974 with the build error fixed. This was the resultTed Kremenek
of a weird merge error with git. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180981 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03Revert "Change LocationContextMap to be a temporary instead of shared ↵Rafael Espindola
variable in BugReporter." This reverts commit 180974. It broke the build. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180979 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03Move parsing of identifiers in MS-style inline assembly intoJohn McCall
the actual parser and support arbitrary id-expressions. We're actually basically set up to do arbitrary expressions here if we wanted to. Assembly operands permit things like A::x to be written regardless of language mode, which forces us to embellish the evaluation context logic somewhat. The logic here under template instantiation is incorrect; we need to preserve the fact that an expression was unevaluated. Of course, template instantiation in general is fishy here because we have no way of delaying semantic analysis in the MC parser. It's all just fishy. I've also fixed the serialization of MS asm statements. This commit depends on an LLVM commit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180976 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02Change LocationContextMap to be a temporary instead of shared variable in ↵Ted Kremenek
BugReporter. BugReporter is used to process ALL bug reports. By using a shared map, we are having mappings from different PathDiagnosticPieces to LocationContexts well beyond the point where we are processing a given report. This state is inherently error prone, and is analogous to using a global variable. Instead, just create a temporary map, one per report, and when we are done with it we throw it away. No extra state. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180974 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02Use attribute argument information to determine when to parse attribute ↵Douglas Gregor
arguments as expressions. This change partly addresses a heinous problem we have with the parsing of attribute arguments that are a lone identifier. Previously, we would end up parsing the 'align' attribute of this as an expression "(Align)": template<unsigned Size, unsigned Align> class my_aligned_storage { __attribute__((align((Align)))) char storage[Size]; }; while this would parse as a "parameter name" 'Align': template<unsigned Size, unsigned Align> class my_aligned_storage { __attribute__((align(Align))) char storage[Size]; }; The code that handles the alignment attribute would completely ignore the parameter name, so the while the first of these would do what's expected, the second would silently be equivalent to template<unsigned Size, unsigned Align> class my_aligned_storage { __attribute__((align)) char storage[Size]; }; i.e., use the maximal alignment rather than the specified alignment. Address this by sniffing the "Args" provided in the TableGen description of attributes. If the first argument is "obviously" something that should be treated as an expression (rather than an identifier to be matched later), parse it as an expression. Fixes <rdar://problem/13700933>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180973 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02Revert r180970; it's causing breakage.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180972 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02Use attribute argument information to determine when to parse attribute ↵Douglas Gregor
arguments as expressions. This change partly addresses a heinous problem we have with the parsing of attribute arguments that are a lone identifier. Previously, we would end up parsing the 'align' attribute of this as an expression "(Align)": template<unsigned Size, unsigned Align> class my_aligned_storage { __attribute__((align((Align)))) char storage[Size]; }; while this would parse as a "parameter name" 'Align': template<unsigned Size, unsigned Align> class my_aligned_storage { __attribute__((align(Align))) char storage[Size]; }; The code that handles the alignment attribute would completely ignore the parameter name, so the while the first of these would do what's expected, the second would silently be equivalent to template<unsigned Size, unsigned Align> class my_aligned_storage { __attribute__((align)) char storage[Size]; }; i.e., use the maximal alignment rather than the specified alignment. Address this by sniffing the "Args" provided in the TableGen description of attributes. If the first argument is "obviously" something that should be treated as an expression (rather than an identifier to be matched later), parse it as an expression. Fixes <rdar://problem/13700933>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180970 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02Remove redundant flag.Bill Wendling
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180968 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02We don't want FP elimination when doing an Apple-style build.Bill Wendling
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180950 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02[analyzer] Don't try to evaluate MaterializeTemporaryExpr as a constant.Jordan Rose
...and don't consider '0' to be a null pointer constant if it's the initializer for a float! Apparently null pointer constant evaluation looks through both MaterializeTemporaryExpr and ImplicitCastExpr, so we have to be more careful about types in the callers. For RegionStore this just means giving up a little more; for ExprEngine this means handling the MaterializeTemporaryExpr case explicitly. Follow-up to r180894. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180944 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02Use the Itanium ABI for thread_local on Darwin.Bill Wendling
After some discussion, it was decided to use the Itanium ABI for thread_local on Darwin OS X platforms. This involved a couple of changes. First, we use "_tlv_atexit" instead of "__cxa_thread_atexit". Secondly, the global variables are marked with 'internal' linkage, because we want all access to be calls to the Itanium-specific entry point, which has normal linkage. <rdar://problem/13733006> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180941 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02Fix crasher when the range in a C++ range-for loop has an ill-formed ↵Douglas Gregor
initializer. Fixes <rdar://problem/13712739>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180937 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02When looking for the module associated with one of our magical builtin ↵Douglas Gregor
headers, speculatively load module maps. The "magical" builtin headers are the headers we provide as part of the C standard library, which typically comes from /usr/include. We essentially merge our headers into that location (due to cyclic dependencies). This change makes sure that, when header search finds one of our builtin headers, we figure out which module it actually lives in. This case is fairly rare; one ends up having to include one of the few built-in C headers we provide before including anything from /usr/include to trigger it. Fixes <rdar://problem/13787184>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180934 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02Basic clang-format integration for BBEdit.Daniel Jasper
Thanks to Avi Drissman! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180933 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02Ensure that the line table for functions with cleanups is sequential.Adrian Prantl
If there is cleanup code, the cleanup code gets the debug location of the closing '}'. The subsequent ret IR-instruction does not get a debug location. The return _expression_ will get the debug location of the return statement. If the function contains only a single, simple return statement, the cleanup code may become the first breakpoint in the function. In this case we set the debug location for the cleanup code to the location of the return statement. rdar://problem/13442648 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180932 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02Use a more idiomatic way to disable debug locations.Adrian Prantl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180931 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02Use a triple ensure that __has_feature(c_thread_local) is 1 in C11 mode.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180925 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02[document parsing]: support c++11 type aliasesFariborz Jahanian
with no comment of their own to inherit the comment of their aliased type. // rdar://13752382 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180924 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02Make sure we define wchar_t related macros correctly in -fms-extensions mode.Hans Wennborg
This adds a test to make sure we define _WCHAR_T_DEFINED and _NATIVE_WCHAR_T_DEFINED correctly in the preprocessor, and updates stddef.h to set it when typedeffing wchar_t. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180918 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02Fix typo in a stddef.h comment: s/risze_t/rsize_t/Hans Wennborg
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180916 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02Only evaluate __has_feature(c_thread_local) and ↵Douglas Gregor
__has_feature(cxx_thread_local) true when the target supports thread-local storage. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180909 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02[analyzer] Finally make c++-analyzer 'executable' again.Anton Yartsev
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180905 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02[analyzer] RetainCountChecker: don't track through xpc_connection_set_context.Jordan Rose
It is unfortunate that we have to mark these exceptions in multiple places. This was already in CallEvent. I suppose it does let us be more precise about saying /which/ arguments have their retain counts invalidated -- the connection's is still valid even though the context object's isn't -- but we're not tracking the retain count of XPC objects anyway. <rdar://problem/13783514> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180904 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02[analyzer] Recreated as a file.Anton Yartsev
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180903 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02[analyzer] Temporary remove c++analyzer to recreate it as a separate file, ↵Anton Yartsev
not a symlink. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180902 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02[analyzer] Added 'executable' property to c++analyzer.Anton Yartsev
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180901 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02[analyzer] scan-build for WindowsAnton Yartsev
The patch allows Windows users to launch scan-build without any additional preparations in the same way as it described in http://clang-analyzer.llvm.org/scan-build.html. The only thing that should be done to make scan-build work from an arbitrary location is to add scan-build folder to the PATH environment variable. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180900 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-01[analyzer] Consolidate constant evaluation logic in SValBuilder.Jordan Rose
Previously, this was scattered across Environment (literal expressions), ExprEngine (default arguments), and RegionStore (global constants). The former special-cased several kinds of simple constant expressions, while the latter two deferred to the AST's constant evaluator. Now, these are all unified as SValBuilder::getConstantVal(). To keep Environment fast, the special cases for simple constant expressions have been left in, but the main benefits are that (a) unusual constants like ObjCStringLiterals now work as default arguments and global constant initializers, and (b) we're not duplicating code between ExprEngine and RegionStore. This actually caught a bug in our test suite, which is awesome: we stop tracking allocated memory if it's passed as an argument along with some kind of callback, but not if the callback is 0. We were testing this in a case where the callback parameter had a default value, but that value was 0. After this change, the analyzer now (correctly) flags that as a leak! <rdar://problem/13773117> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180894 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-01[analyzer] Don't inline the [cd]tors of C++ iterators.Jordan Rose
This goes with r178516, which instructed the analyzer not to inline the constructors and destructors of C++ container classes. This goes a step further and does the same thing for iterators, so that the analyzer won't falsely decide we're trying to construct an iterator pointing to a nonexistent element. The heuristic for determining whether something is an iterator is the presence of an 'iterator_category' member. This is controlled under the same -analyzer-config option as container constructor/destructor inlining: 'c++-container-inlining'. <rdar://problem/13770187> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180890 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-01[documenting declaration]: Remove arc liftime qualifiersFariborz Jahanian
when doccumenting declrations in comments. // rdar://13757500 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180880 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-01Fix typo in FileCheck.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180877 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-01[inline asm] Add a test case for r180873. Test case needs to be on the clangChad Rosier
side because we need an inline asm diagnostics handler in place. Unfortunately, we emit a .s file because we need to build the SelectionDAG to hit the backend issue. rdar://13446483 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180874 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-01Fix spurious trailing comma when printing some of the __c11_atomic_* ↵Richard Smith
builtins. Patch by Joe Sprowes! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180867 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-01PR15884: In the 'taking the address of a temporary' extension, materialize theRichard Smith
temporary to an lvalue before taking its address. This removes a weird special case from the AST representation, and allows the constant expression evaluator to deal with it without (broken) hacks. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180866 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-01Re-apply "[analyzer] Model casts to bool differently from other numbers."Jordan Rose
This doesn't appear to be the cause of the slowdown. I'll have to try a manual bisect to see if there's really anything there, or if it's just the bot itself taking on additional load. Meanwhile, this change helps with correctness. This changes an assertion and adds a test case, then re-applies r180638, which was reverted in r180714. <rdar://problem/13296133> and PR15863 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180864 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-01Fix buildbot yet again. // rdar://13757500.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180863 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-01attempt to fix the buildbot failure.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180861 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-01[ObjC declaration documentation] declaration of Fariborz Jahanian
types involving Objective-C pointers must have their arc qualifiers elided as they don't add any additional info. // rdar://13757500. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180860 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-01As of r180836, these tests should no longer be XFAILed on Windows.Aaron Ballman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180853 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-01Point diagnostics that complain about a use of a selector in an objc ↵Argyrios Kyrtzidis
message, to the selector location. Previously it would point to the left bracket or the receiver, which can be particularly problematic if the receiver is a block literal and we end up point the diagnostic far away for the selector that is complaining about. rdar://13620447 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180833 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-30Revert 180817 because 180816 was reverted.Adrian Prantl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180823 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-30Fix PR15845: apparently MSVC does not support implicit int in C++ mode.Richard Smith
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180822 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-30Do not generate VLAs as complex variables any more, as they are nowAdrian Prantl
correctly represented as breg+0 locations in the backend. (Paired commit with LLVM: r180815) rdar://problem/13658587 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180817 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-30[driver] Allow multiple -arch options with -save-temps by adding the arch nameChad Rosier
to the temporary files. rdar://13218604 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180813 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-30[analyzer] scan-build: support -enable-checker with new Xcode integration.Jordan Rose
<rdar://problem/13772094> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180812 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-30Revert r180739 and r180748: they broke C++11 thread_local on non-Darwin ↵Richard Smith
systems and did not do the right thing on Darwin. Original commit message: Emit the TLS intialization functions into a list. Add the TLS initialization functions to a list of initialization functions. The back-end takes this list and places the function pointers into the correct section. This way they're called before `main().' <rdar://problem/13733006> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180809 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-30When deducing an 'auto' type, don't modify the type-as-written.Richard Smith
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180808 91177308-0d34-0410-b5e6-96231b3b80d8