Douglas Gregor [Thu, 23 Jul 2009 23:49:00 +0000 (23:49 +0000)]
This patch fixes the implementations of the __has_trivial_destructor
and __has_trivial_constructor builtin pseudo-functions and
additionally implements __has_trivial_copy and __has_trivial_assign,
from John McCall!
llvm-svn: 76916
Daniel Dunbar [Thu, 23 Jul 2009 23:41:22 +0000 (23:41 +0000)]
Output UTF-16 string literals independent of host byte order.
- Steve, can you take a look at this? It seems like this code should live
elsewhere, and there is a FIXME about having Sema validates the UTF-8 to
UTF-16 conversion.
llvm-svn: 76915
Sean Callanan [Thu, 23 Jul 2009 23:39:34 +0000 (23:39 +0000)]
Added a 2+-byte NOP instruction to the Intel tables,
for the assembler/disassembler to use.
llvm-svn: 76914
Fariborz Jahanian [Thu, 23 Jul 2009 23:32:59 +0000 (23:32 +0000)]
Diagnose when base classes and members to be intialized
with constructors don't have a matching constructor.
llvm-svn: 76913
Owen Anderson [Thu, 23 Jul 2009 23:25:33 +0000 (23:25 +0000)]
Privatize the ConstantStruct table.
llvm-svn: 76912
Mike Stump [Thu, 23 Jul 2009 23:25:26 +0000 (23:25 +0000)]
Refactor and push the evaluation as late as possible.
llvm-svn: 76911
David Greene [Thu, 23 Jul 2009 23:21:10 +0000 (23:21 +0000)]
Write space padding as one string to speed up comment printing.
llvm-svn: 76910
Evan Cheng [Thu, 23 Jul 2009 23:09:51 +0000 (23:09 +0000)]
Thumb2 does not allow the use of "pc" register as part of the load / store address.
llvm-svn: 76909
Daniel Dunbar [Thu, 23 Jul 2009 22:52:48 +0000 (22:52 +0000)]
Factor out map lookup for CFString constants.
llvm-svn: 76908
Anders Carlsson [Thu, 23 Jul 2009 22:52:34 +0000 (22:52 +0000)]
Don't just store the field/bit field info one field, do it for all fields in the union.
llvm-svn: 76907
Mike Stump [Thu, 23 Jul 2009 22:40:11 +0000 (22:40 +0000)]
Some cleanups suggested by Daniel.
llvm-svn: 76906
Ted Kremenek [Thu, 23 Jul 2009 22:29:41 +0000 (22:29 +0000)]
Implement: <rdar://problem/
6335715> rule request: gets() buffer overflow
llvm-svn: 76905
Reid Kleckner [Thu, 23 Jul 2009 22:27:18 +0000 (22:27 +0000)]
Fixing unittests on 32-bit Darwin, using 0x...ULL instead of 0x...U .
llvm-svn: 76904
Anders Carlsson [Thu, 23 Jul 2009 21:52:03 +0000 (21:52 +0000)]
Fix another thinko.
llvm-svn: 76903
Reid Kleckner [Thu, 23 Jul 2009 21:46:56 +0000 (21:46 +0000)]
Re-committing r76828 with the JIT memory manager changes now that the build
bots like the BumpPtrAllocator changes.
llvm-svn: 76902
Ted Kremenek [Thu, 23 Jul 2009 21:44:18 +0000 (21:44 +0000)]
Add comments.
llvm-svn: 76901
Ted Kremenek [Thu, 23 Jul 2009 21:34:35 +0000 (21:34 +0000)]
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
Chris Lattner [Thu, 23 Jul 2009 21:26:18 +0000 (21:26 +0000)]
"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
Anders Carlsson [Thu, 23 Jul 2009 21:16:33 +0000 (21:16 +0000)]
Correct a thinko in bitfield layout code. Fixes PR4611.
llvm-svn: 76898
Daniel Dunbar [Thu, 23 Jul 2009 20:38:28 +0000 (20:38 +0000)]
Simplify, NFC.
llvm-svn: 76897
Duncan Sands [Thu, 23 Jul 2009 19:08:27 +0000 (19:08 +0000)]
Fix PR4614: the Intel C compiler defines _GNUC__
but does not provide __builtin_bswap32/64.
llvm-svn: 76896
Duncan Sands [Thu, 23 Jul 2009 19:00:02 +0000 (19:00 +0000)]
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
Daniel Dunbar [Thu, 23 Jul 2009 18:52:12 +0000 (18:52 +0000)]
Switch ValueSymbolTable to StringRef based API.
llvm-svn: 76894
Daniel Dunbar [Thu, 23 Jul 2009 18:50:53 +0000 (18:50 +0000)]
Add llvm::Value::getNameRef, for help in API migration.
llvm-svn: 76893
Reid Kleckner [Thu, 23 Jul 2009 18:34:13 +0000 (18:34 +0000)]
Re-committing changes from r76825 to BumpPtrAllocator with a fix and tests for
an off-by-one error.
llvm-svn: 76891
Evan Cheng [Thu, 23 Jul 2009 18:27:47 +0000 (18:27 +0000)]
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
Evan Cheng [Thu, 23 Jul 2009 18:26:03 +0000 (18:26 +0000)]
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
Daniel Dunbar [Thu, 23 Jul 2009 18:17:34 +0000 (18:17 +0000)]
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
Daniel Dunbar [Thu, 23 Jul 2009 17:48:59 +0000 (17:48 +0000)]
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
Daniel Dunbar [Thu, 23 Jul 2009 17:33:49 +0000 (17:33 +0000)]
Simplify.
llvm-svn: 76885
Anders Carlsson [Thu, 23 Jul 2009 17:24:40 +0000 (17:24 +0000)]
We don't need to keep track of the packed alignment, just whether the struct is packed or not. Fixes PR4610.
llvm-svn: 76884
David Goodwin [Thu, 23 Jul 2009 17:06:46 +0000 (17:06 +0000)]
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
Anders Carlsson [Thu, 23 Jul 2009 17:01:21 +0000 (17:01 +0000)]
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
Douglas Gregor [Thu, 23 Jul 2009 16:36:45 +0000 (16:36 +0000)]
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
Andreas Bolka [Thu, 23 Jul 2009 15:56:53 +0000 (15:56 +0000)]
FileCheck'ize and expand LDA testcases.
llvm-svn: 76880
Andrew Lenharth [Thu, 23 Jul 2009 15:24:38 +0000 (15:24 +0000)]
emit simple node was using different labels for fields than the rest of the graph writter
llvm-svn: 76879
Douglas Gregor [Thu, 23 Jul 2009 15:15:06 +0000 (15:15 +0000)]
Unbreak the CMake build
llvm-svn: 76878
Andreas Bolka [Thu, 23 Jul 2009 14:32:46 +0000 (14:32 +0000)]
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
Zhongxing Xu [Thu, 23 Jul 2009 13:39:38 +0000 (13:39 +0000)]
Add two nodes to the call graph:
- Root is the main function or 0.
- ExternalCallingNode has edges to all external functions.
llvm-svn: 76876
Zhongxing Xu [Thu, 23 Jul 2009 09:04:23 +0000 (09:04 +0000)]
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
Zhongxing Xu [Thu, 23 Jul 2009 08:32:25 +0000 (08:32 +0000)]
constify methods.
llvm-svn: 76873
Evan Cheng [Thu, 23 Jul 2009 07:58:08 +0000 (07:58 +0000)]
80 col violation.
llvm-svn: 76872
Zhongxing Xu [Thu, 23 Jul 2009 07:37:14 +0000 (07:37 +0000)]
Add getter methods.
llvm-svn: 76871
Daniel Dunbar [Thu, 23 Jul 2009 07:07:43 +0000 (07:07 +0000)]
Add newline at EOF.
llvm-svn: 76870
Chris Lattner [Thu, 23 Jul 2009 06:30:28 +0000 (06:30 +0000)]
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
Chris Lattner [Thu, 23 Jul 2009 06:07:59 +0000 (06:07 +0000)]
testcase for PR4590
llvm-svn: 76868
Chris Lattner [Thu, 23 Jul 2009 05:46:22 +0000 (05:46 +0000)]
refactor a blob of code out to a new 'FoldOrOfFCmps' function and
simplify it.
llvm-svn: 76866
Lang Hames [Thu, 23 Jul 2009 05:44:24 +0000 (05:44 +0000)]
For real this time: PHI Def & Kill tracking added to PHIElimination.
llvm-svn: 76865
Chris Lattner [Thu, 23 Jul 2009 05:33:39 +0000 (05:33 +0000)]
merge vector-casts-0.ll into vector-casts.ll
llvm-svn: 76864
Chris Lattner [Thu, 23 Jul 2009 05:32:17 +0000 (05:32 +0000)]
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
Daniel Dunbar [Thu, 23 Jul 2009 05:30:36 +0000 (05:30 +0000)]
Shield clang from LLVM API changes, until the dust settles.
llvm-svn: 76862
Chris Lattner [Thu, 23 Jul 2009 05:27:48 +0000 (05:27 +0000)]
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
Chris Lattner [Thu, 23 Jul 2009 05:25:12 +0000 (05:25 +0000)]
rename test
llvm-svn: 76860
Chris Lattner [Thu, 23 Jul 2009 05:14:02 +0000 (05:14 +0000)]
refactor a bunch of code out into a helper function,
no functionality change.
llvm-svn: 76859
Daniel Dunbar [Thu, 23 Jul 2009 05:06:51 +0000 (05:06 +0000)]
Fix test case, which has a control-reaches-end-of-non-void warning that was
being masked by previous bug.
llvm-svn: 76858
Daniel Dunbar [Thu, 23 Jul 2009 05:01:54 +0000 (05:01 +0000)]
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
Anders Carlsson [Thu, 23 Jul 2009 04:59:05 +0000 (04:59 +0000)]
Set field info for unions.
llvm-svn: 76856
Chris Lattner [Thu, 23 Jul 2009 04:59:02 +0000 (04:59 +0000)]
remove a really old and dead header
llvm-svn: 76855
Anders Carlsson [Thu, 23 Jul 2009 04:50:01 +0000 (04:50 +0000)]
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
Chris Lattner [Thu, 23 Jul 2009 04:49:39 +0000 (04:49 +0000)]
merge one more sse41 test into sse41.ll
llvm-svn: 76853
Chris Lattner [Thu, 23 Jul 2009 04:43:48 +0000 (04:43 +0000)]
merge another sse41 test into sse41.ll
llvm-svn: 76852
Daniel Dunbar [Thu, 23 Jul 2009 04:41:06 +0000 (04:41 +0000)]
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
Chris Lattner [Thu, 23 Jul 2009 04:39:09 +0000 (04:39 +0000)]
merge sse41-pmovx.ll into sse41.ll
llvm-svn: 76850
Lang Hames [Thu, 23 Jul 2009 04:34:03 +0000 (04:34 +0000)]
Added PHI Def & Kill tracking to PHIElimination pass.
llvm-svn: 76849
Chris Lattner [Thu, 23 Jul 2009 04:33:02 +0000 (04:33 +0000)]
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
Anders Carlsson [Thu, 23 Jul 2009 04:00:39 +0000 (04:00 +0000)]
Handle zero width bit fields in unions correctly (by ignoring them).
llvm-svn: 76847
Anders Carlsson [Thu, 23 Jul 2009 03:43:54 +0000 (03:43 +0000)]
Implement union layout support.
llvm-svn: 76846
Anders Carlsson [Thu, 23 Jul 2009 03:17:50 +0000 (03:17 +0000)]
Check in CGRecordLayoutBuilder which is a reimplementation of the record layout code. (Yay, no more packed structs unless absolutely necessary). We currently don't use the layouts being built but that will change when the new code is mature enough :)
llvm-svn: 76845
Daniel Dunbar [Thu, 23 Jul 2009 03:03:07 +0000 (03:03 +0000)]
These IRgen improvements have been done.
Technically we could still do a bit more to avoid deferred generation of statics
which we know are used, but I seriously doubt this is important.
llvm-svn: 76844
Eric Christopher [Thu, 23 Jul 2009 02:22:41 +0000 (02:22 +0000)]
Support insertps via the intrinsic and add a couple of simple
testcases to make sure it's being generated.
llvm-svn: 76843
Sanjiv Gupta [Thu, 23 Jul 2009 02:11:04 +0000 (02:11 +0000)]
Do not call getMangledName on Intrinsics.
llvm-svn: 76842
Devang Patel [Thu, 23 Jul 2009 02:00:51 +0000 (02:00 +0000)]
MDString
- Rename member function size(). New name is length().
- Store string beginning and length. Earlier it used to store string end.
llvm-svn: 76841
Eric Christopher [Thu, 23 Jul 2009 01:58:04 +0000 (01:58 +0000)]
Add test for pinsrd and pinsrb instructions.
llvm-svn: 76840
Andreas Bolka [Thu, 23 Jul 2009 01:57:06 +0000 (01:57 +0000)]
Minor cosmetics: indentation, formatting, naming.
llvm-svn: 76839
Reid Kleckner [Thu, 23 Jul 2009 01:40:54 +0000 (01:40 +0000)]
Reverting r76825 and r76828, since they caused clang runtime errors and some build failure involving memset.
llvm-svn: 76838
Zhongxing Xu [Thu, 23 Jul 2009 01:38:47 +0000 (01:38 +0000)]
add header for 'memset'.
llvm-svn: 76837
Devang Patel [Thu, 23 Jul 2009 01:36:16 +0000 (01:36 +0000)]
Silence "uninitialized use" warning.
llvm-svn: 76836
Devang Patel [Thu, 23 Jul 2009 01:19:53 +0000 (01:19 +0000)]
Hide constructors.
llvm-svn: 76835
Devang Patel [Thu, 23 Jul 2009 01:07:34 +0000 (01:07 +0000)]
Derive MDNode from MetadataBase instead of Constant. Emit MDNodes into METADATA_BLOCK in bitcode file.
llvm-svn: 76834
Ted Kremenek [Thu, 23 Jul 2009 01:07:19 +0000 (01:07 +0000)]
Add initial implementation of checking for uses of floating point as a loop counter.
llvm-svn: 76833
Ted Kremenek [Thu, 23 Jul 2009 01:06:10 +0000 (01:06 +0000)]
Add instance predicate method to match static method.
llvm-svn: 76832
Ted Kremenek [Thu, 23 Jul 2009 01:05:31 +0000 (01:05 +0000)]
Add 'previsit' Checker pass for ObjCMessageExprs.
llvm-svn: 76831
Steve Naroff [Thu, 23 Jul 2009 01:01:38 +0000 (01:01 +0000)]
Remove a bunch of FIXME's related to ObjC type checking.
- Move Sema::ObjCQualifiedIdTypesAreCompatible(), Sema::QualifiedIdConformsQualifiedId(), and a couple helper functions to ASTContext.
- Change ASTContext::canAssignObjCInterfaces() to use ASTContext:: ObjCQualifiedIdTypesAreCompatible().
- Tweak several test cases to accommodate the new/improved type checking.
llvm-svn: 76830
Eric Christopher [Thu, 23 Jul 2009 01:01:32 +0000 (01:01 +0000)]
Fix error message for correct opcode.
llvm-svn: 76829
Reid Kleckner [Thu, 23 Jul 2009 00:49:59 +0000 (00:49 +0000)]
Make the JIT code emitter properly retry and ask for more memory when it runs
out of memory, and also make the default memory manager allocate more memory
when it runs out.
Also, switch function stubs and global data over to using the BumpPtrAllocator.
This makes it so the JIT no longer mmaps (or the equivalent on Windows) 16 MB
of memory, and instead allocates in 512K slabs. I suspect this size could go
lower, especially on embedded platforms, now that more slabs can be allocated.
llvm-svn: 76828
Fariborz Jahanian [Thu, 23 Jul 2009 00:42:24 +0000 (00:42 +0000)]
Add constructor used to initialize base/member in
CXXBaseOrMemberInitializer AST node. Needed by
its clients to do the initialization.
llvm-svn: 76826
Reid Kleckner [Thu, 23 Jul 2009 00:30:41 +0000 (00:30 +0000)]
Parameterize the BumpPtrAllocator over a slab allocator. It defaults to using
malloc, so there should be no functional changes to other code.
These changes are necessary since I have plans to use this allocator in the JIT
memory manager, and it needs a special allocator.
I also added some tests which helped me pinpoint some bugs.
llvm-svn: 76825
Mike Stump [Thu, 23 Jul 2009 00:20:25 +0000 (00:20 +0000)]
Fix case, apparently some people still build on case sensitive
filesystems.
llvm-svn: 76824
Dan Gohman [Thu, 23 Jul 2009 00:09:46 +0000 (00:09 +0000)]
Revert r75663 (and r76805), as it is causing regressions on powerpc.
llvm-svn: 76823
Mike Stump [Wed, 22 Jul 2009 23:56:57 +0000 (23:56 +0000)]
Add warning for falling off the end of a function that should return a
value. This is on by default, and controlled by -Wreturn-type (-Wmost
-Wall). I believe there should be very few false positives, though
the most interesting case would be:
int() { bar(); }
when bar does:
bar() { while (1) ; }
Here, we assume functions return, unless they are marked with the
noreturn attribute. I can envision a fixit note for functions that
never return normally that don't have a noreturn attribute to add a
noreturn attribute.
If anyone spots other false positives, let me know!
llvm-svn: 76821
Douglas Gregor [Wed, 22 Jul 2009 23:48:44 +0000 (23:48 +0000)]
Implement support for out-of-line definitions of the class members of class
templates, e.g.,
template<typename T>
struct Outer {
struct Inner;
};
template<typename T>
struct Outer<T>::Inner {
// ...
};
Implementing this feature required some extensions to ActOnTag, which
now takes a set of template parameter lists, and is the precursor to
removing the ActOnClassTemplate function from the parser Action
interface. The reason for this approach is simple: the parser cannot
tell the difference between a class template definition and the
definition of a member of a class template; both have template
parameter lists, and semantic analysis determines what that template
parameter list means.
There is still some cleanup to do with ActOnTag and
ActOnClassTemplate. This commit provides the basic functionality we
need, however.
llvm-svn: 76820
Chris Lattner [Wed, 22 Jul 2009 23:27:22 +0000 (23:27 +0000)]
remove SectionFlags::Small: it is only used on Xcore, and we'll find
a better solution for it in the future.
llvm-svn: 76818
Dan Gohman [Wed, 22 Jul 2009 23:26:55 +0000 (23:26 +0000)]
x86 isel tweak: use lea (%reg,%reg) instead of lea (,%reg,2).
llvm-svn: 76817
Eli Friedman [Wed, 22 Jul 2009 23:24:42 +0000 (23:24 +0000)]
Fix test breakage.
llvm-svn: 76816
Argyrios Kyrtzidis [Wed, 22 Jul 2009 23:13:42 +0000 (23:13 +0000)]
Change Preprocessor to keep a copy of LangOptions instead of reference, like ASTContext.
Now when creating a Preprocessor we can pass it a temporary LangOptions object instead of having to remember to keep it around.
llvm-svn: 76815
Mike Stump [Wed, 22 Jul 2009 22:56:04 +0000 (22:56 +0000)]
Improve CFG support for C++ throw expressions.
llvm-svn: 76814
Mike Stump [Wed, 22 Jul 2009 22:55:09 +0000 (22:55 +0000)]
Prep for new warning.
llvm-svn: 76813
Dan Gohman [Wed, 22 Jul 2009 22:45:50 +0000 (22:45 +0000)]
Add new keywords to the vim syntax highlighting.
llvm-svn: 76812
Dan Gohman [Wed, 22 Jul 2009 22:45:30 +0000 (22:45 +0000)]
Add new optimization keywords to the polygen grammar.
llvm-svn: 76811
Dan Gohman [Wed, 22 Jul 2009 22:44:56 +0000 (22:44 +0000)]
Rename the new unsigned and signed keywords to nuw and nsw,
which stand for no-unsigned-wrap and no-signed-wrap.
llvm-svn: 76810