Richard Smith
83c682115b
C++11 generalized constant expressions: evaluate equality comparisons between
...
arbitrary pointers, if those pointers don't point to weak objects or literals.
llvm-svn: 143334
2011-10-31 05:11:32 +00:00
Tobias Grosser
3510e999c4
cindex.py: Remove more ternary operator + whitespace fixes
...
Another batch of ternary operators and some whitespace fixes
(Getting in sync with the clang_complete version of this file)
llvm-svn: 143330
2011-10-31 02:06:50 +00:00
Richard Smith
8b3497ee54
C++11 generalized constant expressions: support pointer comparisons where the
...
result is not unspecified.
llvm-svn: 143329
2011-10-31 01:37:14 +00:00
Nick Lewycky
dd424a5bc4
Turn on the new .file directive when appropriate, instead of turning it off.
...
llvm-svn: 143327
2011-10-31 01:06:42 +00:00
Tobias Grosser
237f5a07fa
clang.py: Remove use of ternary operators
...
This change is necessary to make this file python 2.4 compatible.
llvm-svn: 143324
2011-10-31 00:49:07 +00:00
Tobias Grosser
e15496f1d7
cindex.py: Allow to create a cursor from file/row/column
...
We add a constructor to create a SourceLocation from a position in
a file and we use this SourceLocation to retrieve a cursor.
llvm-svn: 143322
2011-10-31 00:31:32 +00:00
Tobias Grosser
80c4b81f54
cindex.py: Add File.create_from_name()
...
llvm-svn: 143321
2011-10-31 00:07:19 +00:00
Richard Smith
390cd49906
Fix assert on constant expression evaluation of floating point increment.
...
llvm-svn: 143320
2011-10-30 23:17:09 +00:00
Peter Collingbourne
f1d76db466
Add support for lazily linking bitcode files (using a new
...
-mlink-bitcode-file flag), and more generally llvm::Modules, before
running optimisations.
llvm-svn: 143314
2011-10-30 17:30:44 +00:00
Roman Divacky
ce253d89a2
Add support for sse4a and enable it for amdfam10 cpu.
...
llvm-svn: 143312
2011-10-30 13:47:56 +00:00
Jim Goodnow II
921b9f52f4
Fixed CXX struct and class initialization printing to support 'move'
...
type constructors.
llvm-svn: 143309
2011-10-30 11:17:39 +00:00
Roman Divacky
43eb6f8aeb
Add support for amdfam10 cpu.
...
llvm-svn: 143305
2011-10-30 07:48:46 +00:00
Bob Wilson
d32fba2379
Stop disabling integrated assembler with -static. <rdar://problem/10175391>
...
The integrated assembler seems to be working pretty well for -static code
now, so remove the hacks to disable it.
llvm-svn: 143304
2011-10-30 00:20:28 +00:00
Richard Smith
9c8d1c5c64
Don't crash if a GCC binary conditional is used in a constant expression on an
...
integer-cast pointer value.
llvm-svn: 143299
2011-10-29 22:55:55 +00:00
Richard Smith
35a1f85466
constexpr evaluation: allow lvalue-to-rvalue conversion on any literal type, not
...
just integers and floating point types. Since we don't support evaluating class
types or performing lvalue-to-rvalue conversions on array elements yet, this
just means pointer types right now.
llvm-svn: 143298
2011-10-29 21:53:17 +00:00
Richard Smith
0b0a0b6174
constexpr function substitution:
...
Track the function invocation where an lvalue referring to a constexpr function
parameter originated from, and use it to substitute the correct argument and to
determine whether such an argument's lifetime has ended.
llvm-svn: 143296
2011-10-29 20:57:55 +00:00
Abramo Bagnara
254b63068a
Fixed FriendDecl source locations.
...
llvm-svn: 143295
2011-10-29 20:52:52 +00:00
Argyrios Kyrtzidis
9780553ef0
Use LIBCLANG_NOTHREADS instead of CINDEXTEST_NOTHREADS inside libclang,
...
so the c-index-test one can be enabled without affecting libclang.
llvm-svn: 143288
2011-10-29 19:32:39 +00:00
Richard Smith
7b553f1b19
Rename Expr::Evaluate to Expr::EvaluateAsRValue to make it clear that it will
...
implicitly perform an lvalue-to-rvalue conversion if used on an lvalue
expression. Also improve the documentation of Expr::Evaluate* to indicate which
of them will accept expressions with side-effects.
llvm-svn: 143263
2011-10-29 00:50:52 +00:00
Ted Kremenek
4610ea2bcf
Start work on SerializedDiagnosticPrinter, a new DiagnosticConsumer that serializes out the diagnostics for a given translation unit to a bit code file. This is a WIP.
...
The motivation for this new DiagnosticConsumer is to provide a way for tools invoking the compiler
to get its diagnostics via a libclang interface, rather than textually parsing the compiler output.
This gives us flexibility to change the compiler's textual output, but have a structured data format
for clients to use to get the diagnostics via a stable API.
I have no tests for this, but llvm-bcanalyzer so far shows that the emitted file is well-formed.
More work to follow.
llvm-svn: 143259
2011-10-29 00:12:39 +00:00
Fariborz Jahanian
244b187d22
objc-arc: desugar certain type and improve on diagnostic for
...
ownership qualifier cast which won't work.
// rdar://10244607
llvm-svn: 143258
2011-10-29 00:06:10 +00:00
Richard Smith
53cafabac0
Add test missed from r143234.
...
llvm-svn: 143257
2011-10-29 00:03:08 +00:00
Argyrios Kyrtzidis
7362e9bacb
[PCH] Sort the file decls by file offset not raw source location.
...
Currently sorting by raw source location does work as intended but who knows
what may change in the future..
llvm-svn: 143256
2011-10-28 23:57:47 +00:00
Argyrios Kyrtzidis
df53da8725
[PCH] In ASTWriter::associateDeclWithFile don't bother finding the file loc
...
if we are not interested in the decl.
llvm-svn: 143255
2011-10-28 23:57:43 +00:00
Richard Smith
472d495372
Fix assertion in constant expression evaluation. The LHS of a floating-point
...
binary operator isn't an rvalue if it's an assignment operator.
llvm-svn: 143250
2011-10-28 23:26:52 +00:00
Douglas Gregor
dba74af1b8
Move -Wc++11-compat out of -Wall. It causes trouble for clients that
...
define their own "nullptr" class in C++98 and build with -Wall.
llvm-svn: 143248
2011-10-28 23:11:43 +00:00
Douglas Gregor
2c4542d3ec
Give __STDC_VERSION__ the value 201001L when we're in C1x mode. The
...
committee hasn't set a value for __STDC_VERSION__ yet, so this is a
placeholder. But at least it's > 199901L.
llvm-svn: 143245
2011-10-28 23:02:54 +00:00
Argyrios Kyrtzidis
a109e00bba
[libclang] Introduce use of CINDEXTEST_FAILONERROR environment variable which, if set,
...
will cause c-index-test to return as failed if a compiler error occurred.
llvm-svn: 143243
2011-10-28 22:54:36 +00:00
Argyrios Kyrtzidis
d92ced00b1
[libclang] Check for environment variable CINDEXTEST_NOTHREADS in clang_reparseTranslationUnit.
...
llvm-svn: 143242
2011-10-28 22:54:33 +00:00
Argyrios Kyrtzidis
b12986f1cb
Make -error-on-deserialized-decl work correctly by correctly delegating to
...
the previous ASTDeserializationListener.
llvm-svn: 143241
2011-10-28 22:54:31 +00:00
Argyrios Kyrtzidis
729387327b
[ARC] Do not transfer ARC ownership if the cast is going to result in r-value,
...
in which case the ownership is redundant. Thanks to John for the suggestion.
llvm-svn: 143240
2011-10-28 22:54:28 +00:00
Argyrios Kyrtzidis
d373247d74
Add an alias option for -error-on-deserialized-decl with joined '='.
...
llvm-svn: 143239
2011-10-28 22:54:24 +00:00
Argyrios Kyrtzidis
5fc727a0c2
[PCH] Keep track of file-level declarations that are contained by files.
...
Introduce a FILE_SORTED_DECLS [de]serialization record that contains
a file sorted array of file-level DeclIDs in a PCH/Module.
The rationale is to allow "targeted" deserialization of decls inside
a range of a source file.
Cocoa PCH increased by 0.8%
Difference of creation time for Cocoa PCH is below the noise level.
llvm-svn: 143238
2011-10-28 22:54:21 +00:00
Richard Smith
254a73d636
Initial support for C++11 constexpr function invocation substitution. Using
...
constexpr function arguments outside of their function (passing or returning
them by reference) does not work correctly yet.
Calling constexpr function templates does not work yet, since the bodies are not
instantiated until the end of the translation unit.
llvm-svn: 143234
2011-10-28 22:34:42 +00:00
Devang Patel
fa59ac363e
In case of template specialization, do not try to delay emitting debug info for concrete type in -flimit-debug-info mode. This fixes some of the failures from bs15503.exp tests in gdb testsuite.
...
llvm-svn: 143227
2011-10-28 21:12:13 +00:00
Rafael Espindola
77a4538c6c
Fix this on the bots and make the test more complete by enabling optimizations.
...
llvm-svn: 143223
2011-10-28 20:52:18 +00:00
Rafael Espindola
fffc1ce1d7
Fix PR9614 for functions with the always_inline attribute. Try to keep
...
the common case (-O0, no always_inline) fast.
llvm-svn: 143222
2011-10-28 20:43:56 +00:00
Fariborz Jahanian
2fa646d596
objective-c arc: type-casting of an objc pointer to
...
an rvalue retainable object type with life-time qualifier has no
effect and wil be diagnosed as error. // rdar://10244607
llvm-svn: 143219
2011-10-28 20:06:07 +00:00
Douglas Gregor
7ff1e7ed68
Deleted functions were in Clang 2.9, defaulted functions in
...
3.0. Fixses PR11252.
llvm-svn: 143216
2011-10-28 19:44:09 +00:00
Ted Kremenek
a98358ea13
[analyzer] ObjC message sends to nil receivers that return structs are now okay (compiler zeroes out the data). Fixes <rdar://problem/9151319>.
...
llvm-svn: 143215
2011-10-28 19:05:10 +00:00
David Chisnall
0cc83e7518
It turns out that the Objective-C message lookup functions can throw exceptions after all...
...
llvm-svn: 143205
2011-10-28 17:55:06 +00:00
Richard Smith
11562c5e10
Reinstate r142844 (reverted in r142872) now that lvalue-to-rvalue conversions
...
are present in all the necessary places:
In constant expression evaluation, evaluate lvalues as lvalues and rvalues as
rvalues. Remove special case for caching reference initialization and fix a
cyclic initialization crash in the process.
llvm-svn: 143204
2011-10-28 17:51:58 +00:00
Benjamin Kramer
f1b4e0052f
Use const_cast to make it obvious that it's just removing constness (and silence warnings).
...
llvm-svn: 143193
2011-10-28 13:37:11 +00:00
Benjamin Kramer
8dc5760eed
Reflow code. No intended functionality change.
...
llvm-svn: 143192
2011-10-28 13:21:18 +00:00
Nick Lewycky
c64f4a075f
Fix test for LLVM change r143186.
...
llvm-svn: 143187
2011-10-28 05:29:57 +00:00
Richard Smith
508ebf35ee
Add (hopefully) the last missing lvalue-to-rvalue conversion. Add an assertion
...
to catch some future implicit lvalue-to-rvalue casts of inappropriate kinds.
llvm-svn: 143182
2011-10-28 03:31:48 +00:00
John McCall
9a43e12117
Be sure to build a dependent expression when we see
...
a binary operator involving a dependently-typed overload set.
llvm-svn: 143172
2011-10-28 01:04:34 +00:00
Richard Trieu
03cf7b70e0
Fix for PR9751 to change the behavior of -Wformat warnings. If the format
...
string is part of the function call, then there is no difference. If the
format string is not, the warning will point to the call site and a note
will point to where the format string is.
Fix-it hints for strings are moved to the note if a note is emitted. This will
prevent changes to format strings that may be used in multiple places.
llvm-svn: 143168
2011-10-28 00:41:25 +00:00
Richard Smith
01ebacd80d
Add missing lvalue-to-rvalue conversion to vector splat casts.
...
llvm-svn: 143166
2011-10-27 23:31:58 +00:00
Dan Gohman
c8338b1b14
Remove the Alpha backend.
...
llvm-svn: 143165
2011-10-27 22:56:49 +00:00