Commit Graph

118856 Commits

Author SHA1 Message Date
Anna Zaks 79b5c26014 [analyzer] Fixup for r146793. Add tests for atol and atoll.
llvm-svn: 146794
2011-12-17 00:30:16 +00:00
Anna Zaks 3b0ab206d2 [analyzer] Add support for taint flowing through a function (atoi).
Check if the input parameters are tainted (or point to tainted data) on
a checkPreStmt<CallExpr>. If the output should be tainted, record it in
the state. On post visit (checkPostStmt<CallExpr>), use the state to
make decisions (in addition to the existing logic). Use this logic for
atoi and fscanf.

llvm-svn: 146793
2011-12-17 00:26:34 +00:00
Anna Zaks 9de45554e1 [analyzer] Minor: Simplify & assert.
llvm-svn: 146792
2011-12-17 00:26:29 +00:00
Chad Rosier 060d03be1c Fix _mm256_round_pd, _mm256_round_ps, _mm_permute_pd and _mm256_permute_pd AVX
intrinsics to use "I" (ICE) markings.  Fix avxintrin.h to take them into 
account.
Part of rdar://10595450

llvm-svn: 146791
2011-12-17 00:15:26 +00:00
Jakob Stoklund Olesen 465cdf3ba4 Preserve more memory operands in ARMExpandPseudo.
I don't think this affects anything but verbose assembly.

llvm-svn: 146787
2011-12-17 00:07:02 +00:00
Dan Gohman 518cda42b9 The powers that be have decided that LLVM IR should now support 16-bit
"half precision" floating-point with a first-class type.

This patch adds basic IR support (but not codegen support).

llvm-svn: 146786
2011-12-17 00:04:22 +00:00
Eric Christopher 27886c6c1e When recursing for the original size of a type, stop if we are at a
pointer or a reference type - we actually just want the size of the
pointer then for that.

Fixes rdar://10335756

llvm-svn: 146785
2011-12-16 23:42:45 +00:00
Eric Christopher da011dd0e3 Resolve part of a fixme and add a new one.
llvm-svn: 146784
2011-12-16 23:42:42 +00:00
Eric Christopher 03faed3eac Add a fixme here.
llvm-svn: 146783
2011-12-16 23:42:38 +00:00
Eric Christopher 09cd3568f4 Fix spacing.
llvm-svn: 146782
2011-12-16 23:42:35 +00:00
Eric Christopher 3e3ecd0ab6 Update documentation.
llvm-svn: 146781
2011-12-16 23:42:33 +00:00
Eric Christopher 365d083585 Extraneous whitespace and 80-col.
llvm-svn: 146780
2011-12-16 23:42:31 +00:00
Eric Christopher cd88813dbf When in a limited debug information situation if we can find the original
declaration for the type then go ahead and use that, it's still smaller
than creating an all new derived type.

Part of rdar://10335756 and others.

llvm-svn: 146779
2011-12-16 23:40:18 +00:00
Eric Christopher ea225fb412 Start down the path of getting clang to internally agree on structs versus
classes.

Part of rdar://10520586 and a couple others.

llvm-svn: 146778
2011-12-16 23:40:14 +00:00
Jim Ingham f7f36dc694 Make the objc-dynamic-value test a little trickier (still passes) and test the GetDynamicValue API.
llvm-svn: 146777
2011-12-16 23:24:58 +00:00
Johnny Chen b456b792e0 http://llvm.org/bugs/show_bug.cgi?id=11588
valobj.AddressOf() returns None when an address is expected in a SyntheticChildrenProvider

Patch from Enrico Granata:

The problem was that the frozen object created by the expression parser was a copy of the contents of the StgClosure, rather than a pointer to it. Thus, the expression parser was correctly computing the result of the arithmetic&cast operation along with its address, but only saving it in the live object. This meant that the frozen copy acted as an address-less variable, hence the problem.

The fix attached to this email lets the expression parser store the "live address" in the frozen copy of the address when the object is built without a valid address of its own.
Doing so, along with delegating ValueObjectConstResult to calculate its own address when necessary, solves the issue. I have also added a new test case to check for regressions in this area, and checked that existing test cases pass correctly.

llvm-svn: 146768
2011-12-16 23:04:52 +00:00
Jakob Stoklund Olesen 9790187b6c Fix off-by-one error in bucket sort.
The bad sorting caused a misaligned basic block when building 176.vpr in
ARM mode.

<rdar://problem/10594653>

llvm-svn: 146767
2011-12-16 23:00:05 +00:00
Nicola Gigante 3533eb4f5c Fix an inconsistency in the syntactic form of InitListExpr in case of initialization that involves a ConstructorConversion
llvm-svn: 146766
2011-12-16 22:57:37 +00:00
Richard Smith eb3ce7c3db Don't allow #include (and its friends #import, #include_next and
#__include_macros) in the arguments of a function-style macro. Directives in the
arguments of such macros have undefined behaviour, and GCC does not correctly
support these cases. In some situations, this can lead to better diagnostics.

llvm-svn: 146765
2011-12-16 22:50:01 +00:00
Douglas Gregor b6c9d56eb5 Add missing header change
llvm-svn: 146764
2011-12-16 22:40:58 +00:00
Douglas Gregor 812523570e Make sure we're always setting the previous declaration of an ObjCInterfaceDecl
llvm-svn: 146763
2011-12-16 22:37:11 +00:00
Nick Lewycky f59e129c3b Add the value of "suitably aligned" from the C++11 standard to Basic/TargetInfo.
This is equal to alignof(std::max_align_t) on the platform and equal to the
alignment provided by malloc. (Platform owners please double-check your
platform's value.)

llvm-svn: 146762
2011-12-16 22:34:14 +00:00
Nick Lewycky c0a61734df Fix 80-column violation and whitespace. No functionality change.
llvm-svn: 146761
2011-12-16 22:32:39 +00:00
Eli Friedman 375f09f5bf Add missing flush call. This is an attempt to fix a broken Windows buildbot.
llvm-svn: 146760
2011-12-16 22:12:23 +00:00
Richard Smith 864711ee9f Reduce recursion limit on this test further to try to make the msys bot green.
llvm-svn: 146759
2011-12-16 21:59:02 +00:00
Chad Rosier 33d22d8def Fix vinsertf128_* AVX intrinsics to use "I" (ICE) markings. Fix avxintrin.h to
take them into account.
rdar://10590282

llvm-svn: 146758
2011-12-16 21:40:31 +00:00
Chad Rosier 9138fea25e Fix vperm2f128_* AVX intrinsics to use "I" (ICE) markings. Fix avxintrin.h to
take them into account.
rdar://10576962

llvm-svn: 146757
2011-12-16 21:07:34 +00:00
Sean Callanan bb12004c38 Updated Clang to take an enhancement to the way
we handle Objective-C method calls.  Currently,
LLDB treats the result of an Objective-C method
as unknown if the type information doesn't have
the method's signature.  Now Clang can cast the
result to id if it isn't explicitly cast.

I also added a test case for this, as well as a
fix for a type import problem that this feature
exposed.

llvm-svn: 146756
2011-12-16 21:06:35 +00:00
Richard Smith 300237f00c Add a warning flag for ext_embedded_directive. gcc considers this undefined
behaviour to be an error, so it's useful to be able to make it an error in clang
too.

llvm-svn: 146755
2011-12-16 20:58:01 +00:00
Dylan Noblesmith 1c419ff50d APInt: update asserts for base-36
Hexatridecimal was added in r139695.

And fix the unittest that now triggers the assert.

llvm-svn: 146754
2011-12-16 20:36:31 +00:00
Richard Smith 13f6718b42 PR11594: Don't blindly build a UnaryOperator UO_Minus on an expression which
might not be an rvalue when checking array accesses. Instead, pass through a
flag indicating the array index is negated.

llvm-svn: 146753
2011-12-16 19:31:14 +00:00
Kostya Serebryany 6bb2f1d5b5 Recently the GCD tests started failing because of the invalid size of
FakeStack on the worker threads.
This patch moves the AsanThread initialization into a separate
procedure that's called when AsanThread objects are called for worker
threads.
Patch by glider@google.com

llvm-svn: 146752
2011-12-16 19:13:35 +00:00
Jakob Stoklund Olesen 5af144809e Don't adjust for alignment padding in OffsetIsInRange.
This adjustment is already included in the block offsets computed by
BasicBlockInfo, and adjusting again here can cause the pass to loop.

When CreateNewWater splits a basic block, OffsetIsInRange would reject
the new CPE on the next pass because of the too conservative alignment
adjustment. This caused the block to be split again, and so on.

llvm-svn: 146751
2011-12-16 19:10:00 +00:00
Benjamin Kramer 9ca2e7293b Hexagon: Fix a nasty order-of-initialization bug.
Reenable the tests.

llvm-svn: 146750
2011-12-16 19:08:59 +00:00
Richard Smith f6f003af6a C++11 constexpr: Add note stacks containing backtraces if constant evaluation
fails within a call to a constexpr function. Add -fconstexpr-backtrace-limit
argument to driver and frontend, to control the maximum number of notes so
produced (default 10). Fix APValue printing to be able to pretty-print all
APValue types, and move the testing for this functionality from a unittest to
a -verify test now that it's visible in clang's output.

llvm-svn: 146749
2011-12-16 19:06:07 +00:00
Anna Zaks e48ee50324 [analyzer] Better stdin support.
llvm-svn: 146748
2011-12-16 18:28:50 +00:00
Anna Zaks cf2f8aab62 Fixup to the relaxed diagnostic verification option r146633.
We should exit when matching the '+' even if nothing was found to
prevent searching for all UNIT_MAX items.

llvm-svn: 146747
2011-12-16 18:28:45 +00:00
Greg Clayton b5c39fe9cc Handle all of the "thumb" target triple architecture variants that llvm
handles.

llvm-svn: 146746
2011-12-16 18:15:52 +00:00
Devang Patel fbfd303dc4 Update tests to match r146744.
llvm-svn: 146745
2011-12-16 17:56:38 +00:00
Devang Patel 78847f0bbe In DICompositeType, referenced to derived type is either metadata or null.
llvm-svn: 146744
2011-12-16 17:51:31 +00:00
Devang Patel c16e1ed4bb Clarify and fix subprogram description.
llvm-svn: 146743
2011-12-16 17:50:04 +00:00
Douglas Gregor 7671e53b66 If there is a definition of an ObjCInterfaceDecl, make it the Decl returned from the corresponding ObjCInterfaceType
llvm-svn: 146740
2011-12-16 16:34:57 +00:00
Jakob Stoklund Olesen 2a05f691ab Note ARM constant island alignment in the release notes.
The command line option should be removed, but not until the feature has
gotten a lot of testing. The ARMConstantIslandPass tends to have subtle
bugs that only show up after a while.

llvm-svn: 146739
2011-12-16 16:07:41 +00:00
David Blaikie 1d578782fa Support decltype in pseudo destructors and dependent destructor calls.
Reviewed by Eli Friedman.

llvm-svn: 146738
2011-12-16 16:03:09 +00:00
Fariborz Jahanian 21c2484454 objc: after issuing the warning on direct use of __attribute__((NSObject))
on properties, prevent consequential error  diagnostics. // rdar://10591336

llvm-svn: 146737
2011-12-16 15:54:29 +00:00
Howard Hinnant d6f44b6601 Allow unique_ptr<T const []> to be constructed with a T* (in addition to a const T*)
llvm-svn: 146736
2011-12-16 15:37:23 +00:00
Manuel Klimek 2c899a181c Adds a JSON parser and a benchmark (json-bench) to catch performance regressions.
llvm-svn: 146735
2011-12-16 13:09:10 +00:00
Chandler Carruth fd1f79871a Put the '*' in the right place in the unit test. Forgot to fix up this
bit of style, sorry.

llvm-svn: 146733
2011-12-16 09:37:55 +00:00
Chandler Carruth 2fd51946ee Make GCC happy by using makeAraryRef instead of the implicit conversion.
I have no idea why GCC can't cope with the implicit conversion and Clang
can, or whose bug it is. Grr.

llvm-svn: 146732
2011-12-16 09:36:16 +00:00
Chandler Carruth 1d47523a8e Add a generic collection of class templates to ADT for building
variadic-like functions in C++98. See the comments in the header file
for a more detailed description of how these work. We plan to use these
extensively in the AST matching library. This code and idea were
originally authored by Zhanyong Wan. I've condensed it using macros
to reduce repeatition and adjusted it to fit better with LLVM's ADT.

Thanks to both David Blaikie and Doug Gregor for the review!

llvm-svn: 146729
2011-12-16 08:58:59 +00:00