Commit Graph

63894 Commits

Author SHA1 Message Date
Ted Kremenek 70e5526a61 Add comments.
llvm-svn: 76901
2009-07-23 21:44:18 +00:00
Ted Kremenek 9c49762776 Refine checking and diagnostics for use of floating point variable as a counter.
This implements <rdar://problem/6336718> and checks for CERT secure coding
advisory FLP30-C.

llvm-svn: 76900
2009-07-23 21:34:35 +00:00
Chris Lattner 308c7896a4 "fix" PR4612, which is a crash on:
%0 = malloc [3758096384 x i32]

The "malloc" instruction doesn't support 64-bits correctly (see PR715),
and should be removed.  Victor is actively working on fixing this, in 
the meantime just don't crash.

llvm-svn: 76899
2009-07-23 21:26:18 +00:00
Anders Carlsson 516e5e7835 Correct a thinko in bitfield layout code. Fixes PR4611.
llvm-svn: 76898
2009-07-23 21:16:33 +00:00
Daniel Dunbar 2a5b83c7e6 Simplify, NFC.
llvm-svn: 76897
2009-07-23 20:38:28 +00:00
Duncan Sands 1f3b8c0d16 Fix PR4614: the Intel C compiler defines _GNUC__
but does not provide __builtin_bswap32/64.

llvm-svn: 76896
2009-07-23 19:08:27 +00:00
Duncan Sands f4981105ca Revert r75581: it causes massive breakage in the Ada
testsuite, due to exception handling not working
correctly.  Maybe because the libgcc unwinder is
miscompiled - not sure, and I won't have time to
look into it before leaving on holiday.  Note that
miscompilations of libgcc are not picked up by the
nightly testers, because they dynamically link with
libgcc, so pick up the system version rather than
the version built as part of llvm-gcc.  This is a
nasty flaw in the nightly testers.  (On the other
hand the Ada testsuite links with the just built
libgcc).

llvm-svn: 76895
2009-07-23 19:00:02 +00:00
Daniel Dunbar 84b5f6efb7 Switch ValueSymbolTable to StringRef based API.
llvm-svn: 76894
2009-07-23 18:52:12 +00:00
Daniel Dunbar f01154cf2c Add llvm::Value::getNameRef, for help in API migration.
llvm-svn: 76893
2009-07-23 18:50:53 +00:00
Reid Kleckner c2d882dd1a Re-committing changes from r76825 to BumpPtrAllocator with a fix and tests for
an off-by-one error.

llvm-svn: 76891
2009-07-23 18:34:13 +00:00
Evan Cheng d2919a1773 Fix up ARM constant island pass for Thumb2.
Also fixed up code to fully use the SoImm field for ADR on ARM mode.

llvm-svn: 76890
2009-07-23 18:27:47 +00:00
Evan Cheng 95a73e2eab Since we have moved unified assembly, switch to ADR instruction instead of a the difficult-to-read .set + add syntax to materialize pc-relative address.
Turns out this also fixed a poor code selection on Thumb1. I have no idea why we were using a mov + add to do the same thing as ADR before.

llvm-svn: 76889
2009-07-23 18:26:03 +00:00
Daniel Dunbar 5bf72e20eb Convert StringMap to using StringRef for its APIs.
- Yay for '-'s and simplifications!

 - I kept StringMap::GetOrCreateValue for compatibility purposes, this can
   eventually go away. Likewise the StringMapEntry Create functions still follow
   the old style.

 - NIFC.

llvm-svn: 76888
2009-07-23 18:17:34 +00:00
Daniel Dunbar 07b749230c Switch the driver back to always using clang-cc by default (for C++, and
regardless of the architecture).
 - This is a good default for development & testing; for example without this
   any tests using 'clang' in the test suite will fail on PowerPC, since the
   driver will avoid using clang.

 - We don't want to actually ship something built this way, but that should be
   handled via some sort of configuration file.

llvm-svn: 76886
2009-07-23 17:48:59 +00:00
Daniel Dunbar 635d481de0 Simplify.
llvm-svn: 76885
2009-07-23 17:33:49 +00:00
Anders Carlsson d78fc89fcb We don't need to keep track of the packed alignment, just whether the struct is packed or not. Fixes PR4610.
llvm-svn: 76884
2009-07-23 17:24:40 +00:00
David Goodwin 6deba28c6f Fix frame index elimination to correctly handle thumb-2 addressing modes that don't allow negative offsets. During frame elimination convert *i12 opcode to a *i8 when necessary due to a negative offset.
llvm-svn: 76883
2009-07-23 17:06:46 +00:00
Anders Carlsson 8af896c10a Move the LLVM field number for bit fields into the BitFieldInfo structure, since it's meaning is completely different than for non-bit fields.
llvm-svn: 76882
2009-07-23 17:01:21 +00:00
Douglas Gregor 27bdf00fd7 Clean up the ActOnTag action, so that there is only a single entry
point that covers templates and non-templates. This should eliminate
the flood of warnings I introduced yesterday.

Removed the ActOnClassTemplate action, which is no longer used.

llvm-svn: 76881
2009-07-23 16:36:45 +00:00
Andreas Bolka dcb9f483bf FileCheck'ize and expand LDA testcases.
llvm-svn: 76880
2009-07-23 15:56:53 +00:00
Andrew Lenharth 57e9daaf33 emit simple node was using different labels for fields than the rest of the graph writter
llvm-svn: 76879
2009-07-23 15:24:38 +00:00
Douglas Gregor 2aff97c9e6 Unbreak the CMake build
llvm-svn: 76878
2009-07-23 15:15:06 +00:00
Andreas Bolka c8cd3f6959 Cache dependence computation using FoldingSet.
This introduces an LDA-internal DependencePair class. The intention is,
that this is a place where dependence testers can store various results
such as SCEVs describing conflicting iterations, breaking conditions,
distance/direction vectors, etc.

llvm-svn: 76877
2009-07-23 14:32:46 +00:00
Zhongxing Xu ee5d708e55 Add two nodes to the call graph:
- Root is the main function or 0.
 - ExternalCallingNode has edges to all external functions.

llvm-svn: 76876
2009-07-23 13:39:38 +00:00
Zhongxing Xu a598e5c9d5 Add template specializations to view the call graph in dot format.
- change the DenseMap used in callgraph to std::map, since DenseMap cannot
   be used with mapped_iterator and friends.

llvm-svn: 76874
2009-07-23 09:04:23 +00:00
Zhongxing Xu fdd52922c2 constify methods.
llvm-svn: 76873
2009-07-23 08:32:25 +00:00
Evan Cheng edda8cbfad 80 col violation.
llvm-svn: 76872
2009-07-23 07:58:08 +00:00
Zhongxing Xu ef5cfd43b3 Add getter methods.
llvm-svn: 76871
2009-07-23 07:37:14 +00:00
Daniel Dunbar 3cdf80589f Add newline at EOF.
llvm-svn: 76870
2009-07-23 07:07:43 +00:00
Chris Lattner 7b9dda45f0 enhance DepthFirstIterator to support more robust operations in the face
of code mutating the graph while it is being traversed.  Patch by 
Olaf Krzikalla!

llvm-svn: 76869
2009-07-23 06:30:28 +00:00
Chris Lattner 7413f07b9d testcase for PR4590
llvm-svn: 76868
2009-07-23 06:07:59 +00:00
Chris Lattner 88ab854873 refactor a blob of code out to a new 'FoldOrOfFCmps' function and
simplify it.

llvm-svn: 76866
2009-07-23 05:46:22 +00:00
Lang Hames 077415e84b For real this time: PHI Def & Kill tracking added to PHIElimination.
llvm-svn: 76865
2009-07-23 05:44:24 +00:00
Chris Lattner 7152d39d6d merge vector-casts-0.ll into vector-casts.ll
llvm-svn: 76864
2009-07-23 05:33:39 +00:00
Chris Lattner 7d55541e56 Make some existing optimizations that would only trigger on scalars
also apply to vectors.  This allows us to compile this:

#include <emmintrin.h>
__m128i a(__m128 a, __m128 b) { return a==a & b==b; }
__m128i b(__m128 a, __m128 b) { return a!=a | b!=b; }

to:

_a:
	cmpordps	%xmm1, %xmm0
	ret
_b:
	cmpunordps	%xmm1, %xmm0
	ret

with clang instead of to a ton of horrible code.

llvm-svn: 76863
2009-07-23 05:32:17 +00:00
Daniel Dunbar 7c02cf609d Shield clang from LLVM API changes, until the dust settles.
llvm-svn: 76862
2009-07-23 05:30:36 +00:00
Chris Lattner b4ff7de8bd convert a test to filecheck format. This fixes an endemic problem
with negative tests: this test wasn't checking what it thought it was
because it was grepping .bc, not .ll.

llvm-svn: 76861
2009-07-23 05:27:48 +00:00
Chris Lattner 4a3affbdcf rename test
llvm-svn: 76860
2009-07-23 05:25:12 +00:00
Chris Lattner 9085438e4b refactor a bunch of code out into a helper function,
no functionality change.

llvm-svn: 76859
2009-07-23 05:14:02 +00:00
Daniel Dunbar 34169976d0 Fix test case, which has a control-reaches-end-of-non-void warning that was
being masked by previous bug.

llvm-svn: 76858
2009-07-23 05:06:51 +00:00
Daniel Dunbar a2f7c95dca Use llvm::BitVector instead of managing memory by hand.
- As it happens, this also fixes a use-of-uninitialized memory that was causing
   non-deterministic test failures.

llvm-svn: 76857
2009-07-23 05:01:54 +00:00
Anders Carlsson f55922b8b8 Set field info for unions.
llvm-svn: 76856
2009-07-23 04:59:05 +00:00
Chris Lattner 02def54fa1 remove a really old and dead header
llvm-svn: 76855
2009-07-23 04:59:02 +00:00
Anders Carlsson 718a89a501 Use arrays as union padding. Also, since the resulting struct will always contain a single element and either a single i8 element or an array of i8s, there's no reason to use a packed struct.
llvm-svn: 76854
2009-07-23 04:50:01 +00:00
Chris Lattner dc13b7c637 merge one more sse41 test into sse41.ll
llvm-svn: 76853
2009-07-23 04:49:39 +00:00
Chris Lattner 70d5783535 merge another sse41 test into sse41.ll
llvm-svn: 76852
2009-07-23 04:43:48 +00:00
Daniel Dunbar 8e31e77fd8 Revert r76831, there are many Analyzer test failures on multiple platforms.
--- Reverse-merging r76831 into '.':
U    include/clang/Analysis/PathSensitive/GRExprEngine.h
U    lib/Analysis/GRExprEngine.cpp

llvm-svn: 76851
2009-07-23 04:41:06 +00:00
Chris Lattner 08fc6e6e40 merge sse41-pmovx.ll into sse41.ll
llvm-svn: 76850
2009-07-23 04:39:09 +00:00
Lang Hames a77a3c3782 Added PHI Def & Kill tracking to PHIElimination pass.
llvm-svn: 76849
2009-07-23 04:34:03 +00:00
Chris Lattner b9cdd3153c change a test to run in filecheck style. Rename it to be a general
dumping ground of various SSE4.1 tests, since filecheck can reasonably
handle them all in one file.  Generalize it to check x86-64 stuff as
well since it has a different ABI (a convenient way to test both the 
reg and mem forms of these instructions).

llvm-svn: 76848
2009-07-23 04:33:02 +00:00