Douglas Gregor
aa74a1e49f
Implement promotion for enumeration types.
...
WHAT!?!
It turns out that Type::isPromotableIntegerType() was not considering
enumeration types to be promotable, so we would never do the
promotion despite having properly computed the promotion type when the
enum was defined. Various operations on values of enum type just
"worked" because we could still compute the integer rank of an enum
type; the oddity, however, is that operations such as "add an enum and
an unsigned" would often have an enum result type (!). The bug
actually showed up as a spurious -Wformat diagnostic
(<rdar://problem/7595366>), but in theory it could cause miscompiles.
In this commit:
- Enum types with a promotion type of "int" or "unsigned int" are
promotable.
- Tweaked the computation of promotable types for enums
- For all of the ABIs, treat enum types the same way as their
underlying types (*not* their promotion types) for argument passing
and return values
- Extend the ABI tester with support for enumeration types
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95117 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 20:10:50 +00:00
Douglas Gregor
c6277a0a42
Include <stdlib.h>, so that we're sure to get atoi.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95095 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 17:49:52 +00:00
Daniel Dunbar
fee1137617
Extern darwin-clang_rt.c test to also test targetting ARM ({armv6, armv7} x
...
{thumb,no-thumb}).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94264 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-23 00:26:38 +00:00
Daniel Dunbar
60eea55a98
Add a test for clang_rt support on Darwin. With appropriate massaging, this
...
checks that the runtime library can be linked and works for compiling on 10.6
for 10.{4,5,6} targets. Currently test is only for x86, and misses some
compiler-rt functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94083 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 17:10:39 +00:00
Daniel Dunbar
c67bb59d45
Tweak OptionalTests paths.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94082 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 17:09:39 +00:00
Daniel Dunbar
6d44f6ea30
Add utils/OptionalTests, a dumping ground for additional (lit) tests which for
...
one reason or another don't belong in the regular test suite.
Inside is utils/OptionalTests/Extra which is specifically for tests that match
the layout of the regular tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94080 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 16:55:39 +00:00
John McCall
7ae4373bde
Insert clang-flags into the clang command. Currently it needs to be a list;
...
future work should permit strings (by splitting them into a list o' strings).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93299 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 06:44:51 +00:00
Mike Stump
58002f9683
Remove unused code.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93262 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 22:20:00 +00:00
Mike Stump
cffd516070
Improve covariance tester to randomize the return value more.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93254 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 20:55:39 +00:00
Mike Stump
72e933e998
Add covariance tester.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93226 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 03:01:18 +00:00
Mike Stump
66d29ec664
Allow N_FIELDS to be 0.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93211 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 00:28:59 +00:00
Mike Stump
a8ae9f8c8a
Fix indentation.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93023 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-08 19:28:41 +00:00
Mike Stump
3d3744ca7d
Add in final overrider logic.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93022 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-08 19:25:36 +00:00
Mike Stump
d239227358
Add checker for type infos.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92956 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 22:50:03 +00:00
Mike Stump
b5ed0f64fa
Add checked for VTTs.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92954 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 22:28:10 +00:00
Mike Stump
3539f110dd
Detailed vtable checker.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92953 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 22:21:26 +00:00
Mike Stump
82f0be9c53
1/2 off all structs should not have any virtual functions.
...
Replace magic numbers with uuids.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92941 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 20:55:28 +00:00
Mike Stump
365d638ba3
Add a descriptive tag to each line to make the exact differences
...
easier to understand.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92932 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 19:39:43 +00:00
Mike Stump
408a304afe
Don't use two argument mixing function.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92929 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 19:24:27 +00:00
Mike Stump
1f48f4b1d0
Also generate the .s files.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92928 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 19:19:39 +00:00
Mike Stump
46ae64f202
Add a testcase generator for vtable/rtti testing. WIP.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92927 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 18:58:28 +00:00
Daniel Dunbar
a799cefcff
Tests: Tweak LLVM-Code-Symbols test to ignore common and undefined symbols for
...
now, let's start small.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92170 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-26 22:58:48 +00:00
Daniel Dunbar
e868669d42
Sketch a simple new C++Tests suite for checking that llvm-gcc and clang generate
...
the same visible symbols, useful for finding ABI/Mangler/vtable/etc. issues.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92147 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 21:27:38 +00:00
Douglas Gregor
d7557e3f14
Don't commit my silly little local changes
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92010 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 17:43:32 +00:00
Douglas Gregor
e1a5c17bff
Fix DISABLE_SMART_POINTERS build
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92008 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 17:40:29 +00:00
Douglas Gregor
006ce445f4
Revert accidental commit
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91930 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 22:30:51 +00:00
Douglas Gregor
90f9382b3e
Switch Sema::AddCXXDirectInitializerToDecl over to InitializationSequence
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91927 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 22:17:25 +00:00
Daniel Dunbar
f11031f505
C++Tests: Add target paths for LLVM-Code-Compile checks as well.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91716 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 21:27:23 +00:00
Douglas Gregor
046a0f3d53
Add a couple more paths to the LLVM-Code-Syntax test
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91627 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-17 21:51:02 +00:00
Douglas Gregor
eb3f00c292
Remove accidental commit containing local paths for the LLVM-Code-Syntax test
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91326 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 20:58:24 +00:00
Douglas Gregor
a6ca650754
Minor cleanups for constructor initialization in InitializationSequence
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91325 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 20:57:13 +00:00
Douglas Gregor
d240724926
Switch the Emacs clang-completion-mode over to clang -cc1
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91185 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 23:47:56 +00:00
Daniel Dunbar
dd63b28107
Update docs/comments/utils/examples to refer to clang -cc1 instead of clang-cc.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91176 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 23:04:35 +00:00
Douglas Gregor
5f16e521eb
Beef up Clang-on-LLVM testing a bit, by making LLVM-Syntax recursive
...
(since we now parse all of the headers appropriately) and teaching
LLVM-Code-Syntax about the extra paths needed to parse the backends.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91068 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 22:08:55 +00:00
Daniel Dunbar
93c5b915ae
Add utils/TestUtils, and sink pch-test.pl there.
...
Also, add a test for generator a C file with a very deep call stack.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90468 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 18:40:58 +00:00
Kovarththanan Rajaratnam
d8fdde1196
Tuck away scan-build related files into tools/scan-build
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90215 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 06:52:01 +00:00
Kovarththanan Rajaratnam
e1fea772c4
Move ubiviz to analyzer directory
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90213 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 06:34:06 +00:00
Daniel Dunbar
9bf8a17363
Don't run the LLVM Code tests by default.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89937 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 05:09:00 +00:00
Daniel Dunbar
6cfe889055
Add -Werror for Clang and LLVM on Clang (headers) syntax tests.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89936 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 05:08:53 +00:00
Douglas Gregor
f21bf9b87a
Add C++ tests to try to parse and compile the LLVM libraries
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89923 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-26 02:28:53 +00:00
Douglas Gregor
9d85109159
Don't try to parse LinkAllParses.h for now
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89820 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-25 00:31:20 +00:00
Ted Kremenek
a52e7424e6
Remove '-checker-simple' reference from scan-build. Patch by Kovarththanan Rajaratnam!
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89673 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-23 17:37:58 +00:00
Daniel Dunbar
93b189ff4a
Change Clang-Code-Compile tests to only -emit-llvm instead of running
...
codegen/as.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89634 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-23 00:07:14 +00:00
Daniel Dunbar
c0513be755
Add two new C++ lit tests suites, for testing Clang .cpp files with
...
-fsyntax-only and with -c.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88845 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 08:10:41 +00:00
Daniel Dunbar
72a0b79d20
Add Clang-Syntax C++Tests; these don't run by default, use the lit arguments
...
'--param run_clang_syntax=1' to run them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88839 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 07:23:09 +00:00
Daniel Dunbar
36ce794e52
Use the other excludes syntax.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88836 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-15 07:11:12 +00:00
Ted Kremenek
2a1814a643
Use 'eq' operator, and enable regular experimental checks when --experimental-checks is passed to scan-build.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88673 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 18:49:48 +00:00
Ted Kremenek
8382cf57b7
Add clang-cc option "--analyzer-experimental-internal-checks". This
...
option enables new "internal" checks that will eventually be turned on
by default but still require broader testing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88671 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13 18:46:29 +00:00
Douglas Gregor
35de813674
Turn off -Wsign-compare warnings by default
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86233 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-06 05:24:12 +00:00
Douglas Gregor
b7a86f5c5f
When we encounter a derived-to-base conversion when performing an
...
implicit conversion sequence, check the validity of this conversion
and then perform it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86210 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-06 01:02:41 +00:00