Chris Lattner
2bb5cb490c
reimplement codegen for indirect goto with the following advantages:
...
1. CGF now has fewer bytes of state (one pointer instead of a vector).
2. The generated code is determinstic, instead of getting labels in
'map order' based on pointer addresses.
3. Clang now emits one 'indirect goto switch' for each function, instead
of one for each indirect goto. This fixes an M*N = N^2 IR size issue
when there are lots of address-taken labels and lots of indirect gotos.
4. This also makes the default cause do something useful, reducing the
size of the jump table needed (by one).
llvm-svn: 83952
2009-10-13 06:55:33 +00:00
Chris Lattner
9842a4dcb1
merge an indirect goto test into statements, add another
...
hairier (but nonsensical) example.
llvm-svn: 83951
2009-10-13 06:52:43 +00:00
Zhongxing Xu
e02b89566a
Return the original state by default.
...
llvm-svn: 83949
2009-10-13 06:07:58 +00:00
Chris Lattner
92ae16b0ae
number address-taken labels from 1. This allows 0 to be used as a sentinel
...
for a null pointer. In other words, "&&foo != NULL" will always work out to
true.
llvm-svn: 83948
2009-10-13 06:04:29 +00:00
Chris Lattner
dd7eaad7d4
Use the new Type::getInt8PtrTy method. This should probably be used in a lot
...
more places in clang codegen now.
llvm-svn: 83947
2009-10-13 06:02:42 +00:00
John Thompson
9f2a365fe2
test commit
...
llvm-svn: 83945
2009-10-13 05:45:19 +00:00
Chris Lattner
a611b45806
add rdar # I accidentally lost.
...
llvm-svn: 83942
2009-10-13 04:57:27 +00:00
Chris Lattner
af066d818c
merge two tests.
...
llvm-svn: 83941
2009-10-13 04:56:49 +00:00
Chris Lattner
1a6babf1f4
make the diagnostic in the 'unused result' warning more precise
...
about the reason, rdar://7186119.
llvm-svn: 83940
2009-10-13 04:53:48 +00:00
Chris Lattner
f315471e24
fix PR4938 by recognizing % as a modifier on outputs,
...
previously we only recognized it on inputs.
llvm-svn: 83939
2009-10-13 04:32:07 +00:00
Zhongxing Xu
88dd1ff0d7
Now we can call into another function with the CallInliner transfer function.
...
llvm-svn: 83936
2009-10-13 02:36:42 +00:00
Zhongxing Xu
2d88c0b989
Add two utility methods.
...
llvm-svn: 83935
2009-10-13 02:29:58 +00:00
Zhongxing Xu
daa4176926
Add an initial implementation of EnterStackFrame() to the StoreManager.
...
llvm-svn: 83934
2009-10-13 02:24:55 +00:00
Devang Patel
232f278fc1
Disable tests that check debug info intrinsic. This does not work if debug info intrinsics are not used to encode debug info.
...
llvm-svn: 83929
2009-10-12 23:46:58 +00:00
Devang Patel
5b294f4330
Enable "debug info attached to an instruction" mode.
...
llvm-svn: 83928
2009-10-12 23:31:25 +00:00
Douglas Gregor
e3afaeb7e4
Minor CSS fix
...
llvm-svn: 83924
2009-10-12 23:15:14 +00:00
Douglas Gregor
ef06ccf8d0
When declaring a class template whose name is qualified, make sure
...
that the scope in which it is being declared is complete. Also, when
instantiating a member class template's ClassTemplateDecl, be sure to
delay type creation so that the resulting type is dependent. Ick.
llvm-svn: 83923
2009-10-12 23:11:44 +00:00
Douglas Gregor
0347f40eba
Minor margin fix
...
llvm-svn: 83918
2009-10-12 22:52:00 +00:00
Douglas Gregor
775b837976
Test explicit specialization involving multiple template<> headers
...
llvm-svn: 83914
2009-10-12 22:33:31 +00:00
Devang Patel
dac79decf3
There is no need to attach debug location info with alloca instruction.
...
llvm-svn: 83913
2009-10-12 22:29:02 +00:00
Devang Patel
551e112e99
Encode long double.
...
llvm-svn: 83912
2009-10-12 22:28:31 +00:00
Douglas Gregor
ca027af608
Permit explicit specialization of member functions of class templates
...
that are declarations (rather than definitions). Also, be sure to set
the access specifiers properly when instantiating the declarations of
member function templates.
llvm-svn: 83911
2009-10-12 22:27:17 +00:00
John McCall
e724ae92a8
More appropriate API usage.
...
llvm-svn: 83910
2009-10-12 22:25:59 +00:00
John McCall
d5707abdfd
Implement -Wparentheses: warn about using assignments in contexts that require
...
conditions. Add a fixit to insert the parentheses. Also fix a very minor
possible memory leak in 'for' conditions.
Fixes PR 4876 and rdar://problem/7289172
llvm-svn: 83907
2009-10-12 21:59:07 +00:00
Douglas Gregor
2210c9cd6e
Test explicit specializations of static data members that are declarations, not definitions
...
llvm-svn: 83904
2009-10-12 21:37:59 +00:00
Douglas Gregor
a2fe1fe208
Yet another test for explicit specialization, this one involving linkage
...
llvm-svn: 83901
2009-10-12 21:21:22 +00:00
Anders Carlsson
1d116976b4
Store the key function of a record decl inside CGRecordLayout.
...
llvm-svn: 83900
2009-10-12 21:16:22 +00:00
Ted Kremenek
289ae4f454
Use a BumpPtrAllocator to allocate all aspects of CFG, including CFGBlocks, successor and predecessor vectors, etc.
...
Speedup: when doing 'clang-cc -analyze -dump-cfg' (without actual printing, just
CFG building) on the amalgamated SQLite source (all of SQLite in one source
file), runtime reduced by 9%.
This fixes: <rdar://problem/7250745>
llvm-svn: 83899
2009-10-12 20:55:07 +00:00
Mike Stump
b9a9a7c0ad
Fixup windows include paths. Patch by John Thompson.
...
llvm-svn: 83898
2009-10-12 20:50:45 +00:00
Douglas Gregor
1fc79dda69
More tests for explicit template specialization
...
llvm-svn: 83896
2009-10-12 20:45:50 +00:00
Douglas Gregor
00bb0cbfa5
Add test for last commit
...
llvm-svn: 83893
2009-10-12 20:23:10 +00:00
Douglas Gregor
06db9f50a2
Diagnose the declaration of explicit specializations after an implicit
...
instantiation has already been required. To do so, keep track of the
point of instantiation for anything that can be instantiated.
llvm-svn: 83890
2009-10-12 20:18:28 +00:00
Fariborz Jahanian
e7196431c1
Handle built-in unary operators when reporting ambiguities.
...
wip - To prune excessive reporting.
llvm-svn: 83889
2009-10-12 20:11:40 +00:00
Anders Carlsson
bcee4a7b6b
Fix test.
...
llvm-svn: 83888
2009-10-12 20:06:34 +00:00
Anders Carlsson
a1b54fdbe1
Even more devirtualization cleverness.
...
llvm-svn: 83886
2009-10-12 19:59:15 +00:00
Ted Kremenek
a81b3256a4
Allow BumpVectorContext to conditionally own the underlying BumpPtrAllocator.
...
llvm-svn: 83884
2009-10-12 19:54:17 +00:00
Anders Carlsson
2a01709204
More devirtualization improvements.
...
llvm-svn: 83883
2009-10-12 19:51:33 +00:00
Anders Carlsson
b61301f353
Devirtualize calls on temporaries. A().f() for example.
...
llvm-svn: 83882
2009-10-12 19:45:47 +00:00
Anders Carlsson
d7432dfb0a
Factor out devirtualization checking into a separate function and make it handle references correctly.
...
llvm-svn: 83880
2009-10-12 19:41:04 +00:00
Fariborz Jahanian
65694b413d
Use CanQualType (instead of QualType) to store collection of visible
...
canonical conversion types.
llvm-svn: 83869
2009-10-12 18:36:50 +00:00
Fariborz Jahanian
574de2c5a4
If built-in operators could not be selected because of ambiguity in
...
user-defined type conversions, issue list of ambiguites in addition
to the diagnostic. So, clang now issues the following:
b.cpp:19:19: error: left hand operand to ->* must be a pointer to class compatible with the right hand operand, but is 'struct C1'
int i = c1->*pmf;
~~^
b.cpp:19:19: note: because of ambiguity in conversion of 'struct C1' to 'struct E *'
b.cpp:5:5: note: candidate function
operator E*();
^
b.cpp:11:5: note: candidate function
operator E*();
^
llvm-svn: 83862
2009-10-12 17:51:19 +00:00
Axel Naumann
a7e200e6f7
Don't install Makefiles nor tablegen input in include/.
...
Fix exclusion of .tmp, which in turn enables installation of $(PROJ_OBJ_ROOT)/tools/clang/include/*.inc.
llvm-svn: 83855
2009-10-12 16:42:18 +00:00
Edward O'Callaghan
e4ab8eacf7
Typo in AddGnuCPlusPlusIncludePaths.
...
llvm-svn: 83847
2009-10-12 12:02:47 +00:00
Anders Carlsson
b5296558f1
If the base type of a member call is a record type we don't need to emit a virtual call.
...
llvm-svn: 83816
2009-10-11 23:55:52 +00:00
Benjamin Kramer
bb0a07bf92
Remove dead variable.
...
llvm-svn: 83808
2009-10-11 22:57:54 +00:00
Benjamin Kramer
2e8301dd62
Add CGVtable.cpp to CMakeLists.
...
llvm-svn: 83800
2009-10-11 22:22:38 +00:00
Anders Carlsson
2bb27f53e0
Move the vtable builder to CGVtable.cpp, general cleanup.
...
llvm-svn: 83798
2009-10-11 22:13:54 +00:00
Anders Carlsson
2295f31810
Change mangleCXXVtable and mangleCXXRtti to take CXXRecordDecls instead of QualTypes.
...
llvm-svn: 83793
2009-10-11 21:24:51 +00:00
Benjamin Kramer
3ce29858e9
CMake mingw build fixes.
...
- llvm's libs must be linked after clang's
- libLLVMSystem depends on psapi on win32 (get_system_libs has it)
- CIndex builds successfully on mingw now
llvm-svn: 83773
2009-10-11 12:22:00 +00:00
Sebastian Redl
8046049942
This ought to complete exception spec support. Man, am I glad.
...
llvm-svn: 83767
2009-10-11 09:14:57 +00:00