]> granicus.if.org Git - clang/log
clang
12 years agoAdd possibility to specify an include location for createFileIDForMemBuffer().
Axel Naumann [Mon, 31 Oct 2011 11:02:24 +0000 (11:02 +0000)]
Add possibility to specify an include location for createFileIDForMemBuffer().
Useful to set up a virtual include hierarchy, e.g. to order diagnostics for ambiguous overloads from MemoryBuffers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143347 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSimplify the set of directories we look for on multiarch systems.
Chandler Carruth [Mon, 31 Oct 2011 09:06:40 +0000 (09:06 +0000)]
Simplify the set of directories we look for on multiarch systems.
I don't have any Debian system with one of these currently, and it seems
unlikely for one to show up suddenly. We can add more patterns here if
they become necessary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143346 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd "just one more" include path to the monstrosity that is our header
Chandler Carruth [Mon, 31 Oct 2011 08:42:27 +0000 (08:42 +0000)]
Add "just one more" include path to the monstrosity that is our header
search logic. The Debian multiarch seems to have completely changed from
when these were originally added, and I'd like to remove a bunch of
them, but I'll be lazy and delay that until this logic is hoisted into
the driver where it belongs.

This should resolve PR11223.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143345 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix part of PR11223 and probably a few dups as well. This teaches the
Chandler Carruth [Mon, 31 Oct 2011 08:42:24 +0000 (08:42 +0000)]
Fix part of PR11223 and probably a few dups as well. This teaches the
library search logic to "properly" handle multiarch installations. I've
tested this on both Debian unstable and the latest Ubuntu which both use
this setup, and this appears to work largely the same way as GCC does.
It isn't exactly the same, but it is close enough and more principled in
its behavior where it differs. This should resolve any failures to find
'crt1.o' etc on Debian-based Linux distributions. If folks find more
cases where we fail, please file bugs and CC me.

Test cases for all of the debian silliness are waiting both to simplify
the process of merging these down into the 3.0 release, and because
they're so crazy I haven't yet been able to really produce a fake tree
that represents what we need to test for. I'll eventually add them
though.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143344 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix the source range for ObjCInterfaces that are forward decls.
Argyrios Kyrtzidis [Mon, 31 Oct 2011 07:20:23 +0000 (07:20 +0000)]
Fix the source range for ObjCInterfaces that are forward decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143343 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMove caching of code-completion results from ASTUnit::Reparse to ASTUnit::CodeComplete,
Argyrios Kyrtzidis [Mon, 31 Oct 2011 07:20:19 +0000 (07:20 +0000)]
Move caching of code-completion results from ASTUnit::Reparse to ASTUnit::CodeComplete,
so that it will happen when we are doing code-completion, not reparsing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143342 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[PCH] Now that we store the location of a decl outside its record
Argyrios Kyrtzidis [Mon, 31 Oct 2011 07:20:15 +0000 (07:20 +0000)]
[PCH] Now that we store the location of a decl outside its record
make sure that we keep track of locations of replaced decls as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143341 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[PCH] For ASTReader's FileDeclIDs also associate the Module that the
Argyrios Kyrtzidis [Mon, 31 Oct 2011 07:20:08 +0000 (07:20 +0000)]
[PCH] For ASTReader's FileDeclIDs also associate the Module that the
local DeclIDs came from.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143340 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIntroduce SourceManager::isLocalFileID/isLoadedFileID functions.
Argyrios Kyrtzidis [Mon, 31 Oct 2011 07:20:03 +0000 (07:20 +0000)]
Introduce SourceManager::isLocalFileID/isLoadedFileID functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143339 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoHave the ASTUnit associate the local declarations that get parsed with the file
Argyrios Kyrtzidis [Mon, 31 Oct 2011 07:19:59 +0000 (07:19 +0000)]
Have the ASTUnit associate the local declarations that get parsed with the file
that contains them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143338 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[libclang] Rename VisitIncludedPreprocessingEntries -> VisitIncludedEntities
Argyrios Kyrtzidis [Mon, 31 Oct 2011 07:19:54 +0000 (07:19 +0000)]
[libclang] Rename VisitIncludedPreprocessingEntries -> VisitIncludedEntities

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143337 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoC++11 generalized constant expression handling: evaluation support for
Richard Smith [Mon, 31 Oct 2011 05:52:43 +0000 (05:52 +0000)]
C++11 generalized constant expression handling: evaluation support for
materialized temporaries.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143335 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoC++11 generalized constant expressions: evaluate equality comparisons between
Richard Smith [Mon, 31 Oct 2011 05:11:32 +0000 (05:11 +0000)]
C++11 generalized constant expressions: evaluate equality comparisons between
arbitrary pointers, if those pointers don't point to weak objects or literals.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143334 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agocindex.py: Remove more ternary operator + whitespace fixes
Tobias Grosser [Mon, 31 Oct 2011 02:06:50 +0000 (02:06 +0000)]
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)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143330 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoC++11 generalized constant expressions: support pointer comparisons where the
Richard Smith [Mon, 31 Oct 2011 01:37:14 +0000 (01:37 +0000)]
C++11 generalized constant expressions: support pointer comparisons where the
result is not unspecified.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143329 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTurn on the new .file directive when appropriate, instead of turning it off.
Nick Lewycky [Mon, 31 Oct 2011 01:06:42 +0000 (01:06 +0000)]
Turn on the new .file directive when appropriate, instead of turning it off.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143327 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoclang.py: Remove use of ternary operators
Tobias Grosser [Mon, 31 Oct 2011 00:49:07 +0000 (00:49 +0000)]
clang.py: Remove use of ternary operators

This change is necessary to make this file python 2.4 compatible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143324 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agocindex.py: Allow to create a cursor from file/row/column
Tobias Grosser [Mon, 31 Oct 2011 00:31:32 +0000 (00:31 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143322 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agocindex.py: Add File.create_from_name()
Tobias Grosser [Mon, 31 Oct 2011 00:07:19 +0000 (00:07 +0000)]
cindex.py: Add File.create_from_name()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143321 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix assert on constant expression evaluation of floating point increment.
Richard Smith [Sun, 30 Oct 2011 23:17:09 +0000 (23:17 +0000)]
Fix assert on constant expression evaluation of floating point increment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143320 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd support for lazily linking bitcode files (using a new
Peter Collingbourne [Sun, 30 Oct 2011 17:30:44 +0000 (17:30 +0000)]
Add support for lazily linking bitcode files (using a new
-mlink-bitcode-file flag), and more generally llvm::Modules, before
running optimisations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143314 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd support for sse4a and enable it for amdfam10 cpu.
Roman Divacky [Sun, 30 Oct 2011 13:47:56 +0000 (13:47 +0000)]
Add support for sse4a and enable it for amdfam10 cpu.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143312 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFixed CXX struct and class initialization printing to support 'move'
Jim Goodnow II [Sun, 30 Oct 2011 11:17:39 +0000 (11:17 +0000)]
Fixed CXX struct and class initialization printing to support 'move'
type constructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143309 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd support for amdfam10 cpu.
Roman Divacky [Sun, 30 Oct 2011 07:48:46 +0000 (07:48 +0000)]
Add support for amdfam10 cpu.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143305 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoStop disabling integrated assembler with -static. <rdar://problem/10175391>
Bob Wilson [Sun, 30 Oct 2011 00:20:28 +0000 (00:20 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143304 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDon't crash if a GCC binary conditional is used in a constant expression on an
Richard Smith [Sat, 29 Oct 2011 22:55:55 +0000 (22:55 +0000)]
Don't crash if a GCC binary conditional is used in a constant expression on an
integer-cast pointer value.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143299 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoconstexpr evaluation: allow lvalue-to-rvalue conversion on any literal type, not
Richard Smith [Sat, 29 Oct 2011 21:53:17 +0000 (21:53 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143298 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoconstexpr function substitution:
Richard Smith [Sat, 29 Oct 2011 20:57:55 +0000 (20:57 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143296 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFixed FriendDecl source locations.
Abramo Bagnara [Sat, 29 Oct 2011 20:52:52 +0000 (20:52 +0000)]
Fixed FriendDecl source locations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143295 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUse LIBCLANG_NOTHREADS instead of CINDEXTEST_NOTHREADS inside libclang,
Argyrios Kyrtzidis [Sat, 29 Oct 2011 19:32:39 +0000 (19:32 +0000)]
Use LIBCLANG_NOTHREADS instead of CINDEXTEST_NOTHREADS inside libclang,
so the c-index-test one can be enabled without affecting libclang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143288 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRename Expr::Evaluate to Expr::EvaluateAsRValue to make it clear that it will
Richard Smith [Sat, 29 Oct 2011 00:50:52 +0000 (00:50 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143263 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoStart work on SerializedDiagnosticPrinter, a new DiagnosticConsumer that serializes...
Ted Kremenek [Sat, 29 Oct 2011 00:12:39 +0000 (00:12 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143259 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoobjc-arc: desugar certain type and improve on diagnostic for
Fariborz Jahanian [Sat, 29 Oct 2011 00:06:10 +0000 (00:06 +0000)]
objc-arc: desugar certain type and improve on diagnostic for
ownership qualifier cast which won't work.
// rdar://10244607

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143258 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd test missed from r143234.
Richard Smith [Sat, 29 Oct 2011 00:03:08 +0000 (00:03 +0000)]
Add test missed from r143234.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143257 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[PCH] Sort the file decls by file offset not raw source location.
Argyrios Kyrtzidis [Fri, 28 Oct 2011 23:57:47 +0000 (23:57 +0000)]
[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..

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143256 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[PCH] In ASTWriter::associateDeclWithFile don't bother finding the file loc
Argyrios Kyrtzidis [Fri, 28 Oct 2011 23:57:43 +0000 (23:57 +0000)]
[PCH] In ASTWriter::associateDeclWithFile don't bother finding the file loc
if we are not interested in the decl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143255 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix assertion in constant expression evaluation. The LHS of a floating-point
Richard Smith [Fri, 28 Oct 2011 23:26:52 +0000 (23:26 +0000)]
Fix assertion in constant expression evaluation. The LHS of a floating-point
binary operator isn't an rvalue if it's an assignment operator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143250 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMove -Wc++11-compat out of -Wall. It causes trouble for clients that
Douglas Gregor [Fri, 28 Oct 2011 23:11:43 +0000 (23:11 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143248 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoGive __STDC_VERSION__ the value 201001L when we're in C1x mode. The
Douglas Gregor [Fri, 28 Oct 2011 23:02:54 +0000 (23:02 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143245 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[libclang] Introduce use of CINDEXTEST_FAILONERROR environment variable which, if...
Argyrios Kyrtzidis [Fri, 28 Oct 2011 22:54:36 +0000 (22:54 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143243 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[libclang] Check for environment variable CINDEXTEST_NOTHREADS in clang_reparseTransl...
Argyrios Kyrtzidis [Fri, 28 Oct 2011 22:54:33 +0000 (22:54 +0000)]
[libclang] Check for environment variable CINDEXTEST_NOTHREADS in clang_reparseTranslationUnit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143242 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMake -error-on-deserialized-decl work correctly by correctly delegating to
Argyrios Kyrtzidis [Fri, 28 Oct 2011 22:54:31 +0000 (22:54 +0000)]
Make -error-on-deserialized-decl work correctly by correctly delegating to
the previous ASTDeserializationListener.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143241 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[ARC] Do not transfer ARC ownership if the cast is going to result in r-value,
Argyrios Kyrtzidis [Fri, 28 Oct 2011 22:54:28 +0000 (22:54 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143240 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd an alias option for -error-on-deserialized-decl with joined '='.
Argyrios Kyrtzidis [Fri, 28 Oct 2011 22:54:24 +0000 (22:54 +0000)]
Add an alias option for -error-on-deserialized-decl with joined '='.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143239 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[PCH] Keep track of file-level declarations that are contained by files.
Argyrios Kyrtzidis [Fri, 28 Oct 2011 22:54:21 +0000 (22:54 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143238 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoInitial support for C++11 constexpr function invocation substitution. Using
Richard Smith [Fri, 28 Oct 2011 22:34:42 +0000 (22:34 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143234 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIn case of template specialization, do not try to delay emitting debug info for concr...
Devang Patel [Fri, 28 Oct 2011 21:12:13 +0000 (21:12 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143227 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix this on the bots and make the test more complete by enabling optimizations.
Rafael Espindola [Fri, 28 Oct 2011 20:52:18 +0000 (20:52 +0000)]
Fix this on the bots and make the test more complete by enabling optimizations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143223 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix PR9614 for functions with the always_inline attribute. Try to keep
Rafael Espindola [Fri, 28 Oct 2011 20:43:56 +0000 (20:43 +0000)]
Fix PR9614 for functions with the always_inline attribute. Try to keep
the common case (-O0, no always_inline) fast.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143222 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoobjective-c arc: type-casting of an objc pointer to
Fariborz Jahanian [Fri, 28 Oct 2011 20:06:07 +0000 (20:06 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143219 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDeleted functions were in Clang 2.9, defaulted functions in
Douglas Gregor [Fri, 28 Oct 2011 19:44:09 +0000 (19:44 +0000)]
Deleted functions were in Clang 2.9, defaulted functions in
3.0. Fixses PR11252.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143216 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] ObjC message sends to nil receivers that return structs are now okay ...
Ted Kremenek [Fri, 28 Oct 2011 19:05:10 +0000 (19:05 +0000)]
[analyzer] ObjC message sends to nil receivers that return structs are now okay (compiler zeroes out the data).  Fixes <rdar://problem/9151319>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143215 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIt turns out that the Objective-C message lookup functions can throw exceptions after...
David Chisnall [Fri, 28 Oct 2011 17:55:06 +0000 (17:55 +0000)]
It turns out that the Objective-C message lookup functions can throw exceptions after all...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143205 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoReinstate r142844 (reverted in r142872) now that lvalue-to-rvalue conversions
Richard Smith [Fri, 28 Oct 2011 17:51:58 +0000 (17:51 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143204 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUse const_cast to make it obvious that it's just removing constness (and silence...
Benjamin Kramer [Fri, 28 Oct 2011 13:37:11 +0000 (13:37 +0000)]
Use const_cast to make it obvious that it's just removing constness (and silence warnings).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143193 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoReflow code. No intended functionality change.
Benjamin Kramer [Fri, 28 Oct 2011 13:21:18 +0000 (13:21 +0000)]
Reflow code. No intended functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143192 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix test for LLVM change r143186.
Nick Lewycky [Fri, 28 Oct 2011 05:29:57 +0000 (05:29 +0000)]
Fix test for LLVM change r143186.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143187 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd (hopefully) the last missing lvalue-to-rvalue conversion. Add an assertion
Richard Smith [Fri, 28 Oct 2011 03:31:48 +0000 (03:31 +0000)]
Add (hopefully) the last missing lvalue-to-rvalue conversion. Add an assertion
to catch some future implicit lvalue-to-rvalue casts of inappropriate kinds.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143182 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoBe sure to build a dependent expression when we see
John McCall [Fri, 28 Oct 2011 01:04:34 +0000 (01:04 +0000)]
Be sure to build a dependent expression when we see
a binary operator involving a dependently-typed overload set.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143172 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix for PR9751 to change the behavior of -Wformat warnings. If the format
Richard Trieu [Fri, 28 Oct 2011 00:41:25 +0000 (00:41 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143168 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd missing lvalue-to-rvalue conversion to vector splat casts.
Richard Smith [Thu, 27 Oct 2011 23:31:58 +0000 (23:31 +0000)]
Add missing lvalue-to-rvalue conversion to vector splat casts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143166 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove the Alpha backend.
Dan Gohman [Thu, 27 Oct 2011 22:56:49 +0000 (22:56 +0000)]
Remove the Alpha backend.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143165 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix some cases where a CK_IntegralCast was being used to convert an lvalue to an
Richard Smith [Thu, 27 Oct 2011 22:11:44 +0000 (22:11 +0000)]
Fix some cases where a CK_IntegralCast was being used to convert an lvalue to an
rvalue. An assertion to catch this is in ImpCastExprToType will follow, but
vector operations currently trip over this (due to omitting the usual arithmetic
conversions). Also add an assert to catch missing lvalue-to-rvalue conversions
on the LHS of ->.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143155 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMark these tests as requiring use of the shell.
Ted Kremenek [Thu, 27 Oct 2011 21:50:13 +0000 (21:50 +0000)]
Mark these tests as requiring use of the shell.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143150 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoobjc: fix an ir-gen crash caused by recent
Fariborz Jahanian [Thu, 27 Oct 2011 20:06:32 +0000 (20:06 +0000)]
objc: fix an ir-gen crash caused by recent
property refactoring. // rdar://10327068

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143139 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd mutex for accessing ASTUnit's global OnDisk data. This may be an issue as libcla...
Ted Kremenek [Thu, 27 Oct 2011 19:44:25 +0000 (19:44 +0000)]
Add mutex for accessing ASTUnit's global OnDisk data.  This may be an issue as libclang could be processing multiple ASTUnit's at once.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143138 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAnnotate imprecise FP division with fpaccuracy metadata
Peter Collingbourne [Thu, 27 Oct 2011 19:19:51 +0000 (19:19 +0000)]
Annotate imprecise FP division with fpaccuracy metadata

The OpenCL single precision division operation is only required to
be accurate to 2.5ulp.  Annotate the fdiv instruction with metadata
which signals to the backend that an imprecise divide instruction
may be used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143136 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[PCH] Pull the location out of the serialized declarations and put it in the array
Argyrios Kyrtzidis [Thu, 27 Oct 2011 18:47:35 +0000 (18:47 +0000)]
[PCH] Pull the location out of the serialized declarations and put it in the array
of decl bit offsets.

This allows us to easily get at the location of a decl without deserializing it.
It increases size of Cocoa PCH by only 0.2%.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143123 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMove ASTUnit's handling of temporary files and the preamble file into a lazily-create...
Ted Kremenek [Thu, 27 Oct 2011 17:55:18 +0000 (17:55 +0000)]
Move ASTUnit's handling of temporary files and the preamble file into a lazily-created static DenseMap.  This DenseMap is cleared (and the files erased) via an atexit routine in the case an ASTUnit is not destroyed.  Fixes <rdar://problem/10293367>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143115 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[libclang] Add comments.
Argyrios Kyrtzidis [Thu, 27 Oct 2011 17:36:12 +0000 (17:36 +0000)]
[libclang] Add comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143111 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMake the loading of information attached to an IdentifierInfo from an
Douglas Gregor [Thu, 27 Oct 2011 09:33:13 +0000 (09:33 +0000)]
Make the loading of information attached to an IdentifierInfo from an
AST file more lazy, so that we don't eagerly load that information for
all known identifiers each time a new AST file is loaded. The eager
reloading made some sense in the context of precompiled headers, since
very few identifiers were defined before PCH load time. With modules,
however, a huge amount of code can get parsed before we see an
@import, so laziness becomes important here.

The approach taken to make this information lazy is fairly simple:
when we load a new AST file, we mark all of the existing identifiers
as being out-of-date. Whenever we want to access information that may
come from an AST (e.g., whether the identifier has a macro definition,
or what top-level declarations have that name), we check the
out-of-date bit and, if it's set, ask the AST reader to update the
IdentifierInfo from the AST files. The update is a merge, and we now
take care to merge declarations before/after imports with declarations
from multiple imports.

The results of this optimization are fairly dramatic. On a small
application that brings in 14 non-trivial modules, this takes modules
from being > 3x slower than a "perfect" PCH file down to 30% slower
for a full rebuild. A partial rebuild (where the PCH file or modules
can be re-used) is down to 7% slower. Making the PCH file just a
little imperfect (e.g., adding two smallish modules used by a bunch of
.m files that aren't in the PCH file) tips the scales in favor of the
modules approach, with 24% faster partial rebuilds.

This is just a first step; the lazy scheme could possibly be improved
by adding versioning, so we don't search into modules we already
searched. Moreover, we'll need similar lazy schemes for all of the
other lookup data structures, such as DeclContexts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143100 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTeach format string analysis that "%zu" means size_t.
Hans Wennborg [Thu, 27 Oct 2011 08:29:09 +0000 (08:29 +0000)]
Teach format string analysis that "%zu" means size_t.

The code had it backwards, thinking size_t was signed, and using that for "%zd".

Also let the analysis get the types for (u)intmax_t while we are at it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143099 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMove these test from checking assembly to checking LLVM IR. Should fix fallout
Nick Lewycky [Thu, 27 Oct 2011 07:11:43 +0000 (07:11 +0000)]
Move these test from checking assembly to checking LLVM IR. Should fix fallout
from r143097.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143098 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Optimize by not generating empty transitions in CheckerContext
Anna Zaks [Thu, 27 Oct 2011 00:59:32 +0000 (00:59 +0000)]
[analyzer] Optimize by not generating empty transitions in CheckerContext

Go not generate a new transition by addTransition methods if nothing changed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143091 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Move enqueueEndOfFunction into CoreEngine.
Anna Zaks [Thu, 27 Oct 2011 00:59:28 +0000 (00:59 +0000)]
[analyzer] Move enqueueEndOfFunction into CoreEngine.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143090 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Make CoreEngine responsible for enqueueing Stmt Nodes.
Anna Zaks [Thu, 27 Oct 2011 00:59:23 +0000 (00:59 +0000)]
[analyzer] Make CoreEngine responsible for enqueueing Stmt Nodes.

Enqueue the nodes generated as the result of processing a statement
inside the Core Engine. This makes sure ExpEngine does not access
CoreEngine's private members and is more concise.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143089 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMake use of the parameter in Sema::ActOnObjCTemporaryExitContainerContext.
Argyrios Kyrtzidis [Thu, 27 Oct 2011 00:53:06 +0000 (00:53 +0000)]
Make use of the parameter in Sema::ActOnObjCTemporaryExitContainerContext.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143088 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix crash on an @interface nested inside @implementation, rdar://10336158
Argyrios Kyrtzidis [Thu, 27 Oct 2011 00:09:34 +0000 (00:09 +0000)]
Fix crash on an @interface nested inside @implementation, rdar://10336158

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143085 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFor the "'@end' is missing in implementation context" point at the location of '@'.
Argyrios Kyrtzidis [Thu, 27 Oct 2011 00:09:29 +0000 (00:09 +0000)]
For the "'@end' is missing in implementation context" point at the location of '@'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143084 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDo not warn when weak-import attribute is applied to enum
Fariborz Jahanian [Wed, 26 Oct 2011 23:59:12 +0000 (23:59 +0000)]
Do not warn when weak-import attribute is applied to enum
decl. in Darwin due to certain projects requirement.
// rdar://10277579

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143082 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDisalbe more Microsoft-specific stuff.
Douglas Gregor [Wed, 26 Oct 2011 23:19:04 +0000 (23:19 +0000)]
Disalbe more Microsoft-specific stuff.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143077 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Add getLocationContext to CheckerContext
Anna Zaks [Wed, 26 Oct 2011 21:06:44 +0000 (21:06 +0000)]
[analyzer] Add getLocationContext to CheckerContext

CheckerContext::getPredecessor is only used to get to the LocationContext
half of the times.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143061 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Remove EmitBasicReport form CheckerContext.
Anna Zaks [Wed, 26 Oct 2011 21:06:39 +0000 (21:06 +0000)]
[analyzer] Remove EmitBasicReport form CheckerContext.

The path sensitive checkers should use EmitBasicReport, which provides the
node information.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143060 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Rename generateNode -> addTransition in CheckerContext
Anna Zaks [Wed, 26 Oct 2011 21:06:34 +0000 (21:06 +0000)]
[analyzer] Rename generateNode -> addTransition in CheckerContext

Also document addTransition methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143059 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Remove forward declarations of GenericNodeBuilder
Anna Zaks [Wed, 26 Oct 2011 21:06:25 +0000 (21:06 +0000)]
[analyzer] Remove forward declarations of GenericNodeBuilder

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143058 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] GenericNodeBuilder -> NodeBuilder.
Anna Zaks [Wed, 26 Oct 2011 21:06:22 +0000 (21:06 +0000)]
[analyzer] GenericNodeBuilder -> NodeBuilder.

Remove GenericNodeBuilder and use a class inherited from NodeBuilder instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143057 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoObjective-c: fix an ir-gen crash where objc messag returns a _Complex
Fariborz Jahanian [Wed, 26 Oct 2011 20:53:59 +0000 (20:53 +0000)]
Objective-c: fix an ir-gen crash where objc messag returns a _Complex
value and ABI requires return slot to be passed as first
argument to message sent. // rdar://10331109

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143053 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix this tests on the bots.
Rafael Espindola [Wed, 26 Oct 2011 20:46:27 +0000 (20:46 +0000)]
Fix this tests on the bots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143052 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix pr9614 by not emitting an available_externally function when it calls
Rafael Espindola [Wed, 26 Oct 2011 20:41:06 +0000 (20:41 +0000)]
Fix pr9614 by not emitting an available_externally function when it calls
itself via an asm label.

available_externally functions are supposed to correspond to an external
function, and that is not the case in the examples in pr9614.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143049 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTry to appease the Windows builders
Douglas Gregor [Wed, 26 Oct 2011 20:33:43 +0000 (20:33 +0000)]
Try to appease the Windows builders

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143048 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPull out conversion on LHS of -> and . into its own function. This happens
Richard Smith [Wed, 26 Oct 2011 19:06:56 +0000 (19:06 +0000)]
Pull out conversion on LHS of -> and . into its own function. This happens
implicitly in LookupMemberExpr and explicitly in cases where template
instantiation doesn't redo the lookup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143046 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoEliminate a hang while loading a sequence of redeclarable entities. In
Douglas Gregor [Wed, 26 Oct 2011 17:53:41 +0000 (17:53 +0000)]
Eliminate a hang while loading a sequence of redeclarable entities. In
essence, the redeclaration chain for a class could end up in an
inconsistent state while deserializing multiple declarations in that
chain, where the circular linked list was not, in fact,
circular. Since only two redeclarations of the same entity will get
loaded when we're in this state, restore circularity when both have
been loaded. Fixes <rdar://problem/10324940> / PR11195.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143037 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDisable on Windows, for real.
Douglas Gregor [Wed, 26 Oct 2011 14:35:30 +0000 (14:35 +0000)]
Disable on Windows, for real.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143027 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoCompute the promoted integer type of fixed-width enums correctly. Found by inspection.
Eli Friedman [Wed, 26 Oct 2011 07:38:19 +0000 (07:38 +0000)]
Compute the promoted integer type of fixed-width enums correctly.  Found by inspection.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143021 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoCorrectly perform integral promotions on wchar_t/char16_t/char32_t in C++. <rdar...
Eli Friedman [Wed, 26 Oct 2011 07:22:48 +0000 (07:22 +0000)]
Correctly perform integral promotions on wchar_t/char16_t/char32_t in C++. <rdar://problem/10309088>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143019 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix crash due to missing array-to-pointer decay when instantiating an unresolved
Richard Smith [Wed, 26 Oct 2011 06:49:26 +0000 (06:49 +0000)]
Fix crash due to missing array-to-pointer decay when instantiating an unresolved
member expression. Refactoring to follow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143017 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUnresolvedMemberExprs need lvalue-to-rvalue conversions during template
Richard Smith [Wed, 26 Oct 2011 06:15:36 +0000 (06:15 +0000)]
UnresolvedMemberExprs need lvalue-to-rvalue conversions during template
instantiations too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143016 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTurn off delayed template parsing for this test
Douglas Gregor [Tue, 25 Oct 2011 20:12:15 +0000 (20:12 +0000)]
Turn off delayed template parsing for this test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142951 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Remove getEngine() form CheckerContext
Anna Zaks [Tue, 25 Oct 2011 19:57:11 +0000 (19:57 +0000)]
[analyzer] Remove getEngine() form CheckerContext

A step toward making sure that diagnostics report should only
be generated though the CheckerContext and not though BugReporter
or ExprEngine directly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142947 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Simplify CheckerContext
Anna Zaks [Tue, 25 Oct 2011 19:57:06 +0000 (19:57 +0000)]
[analyzer] Simplify CheckerContext

Remove dead members/parameters: ProgramState, respondsToCallback, autoTransition.
Remove addTransition method since it's the same as generateNode. Maybe we should
rename generateNode to genTransition (since a transition is always automatically
generated)?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142946 91177308-0d34-0410-b5e6-96231b3b80d8