]> granicus.if.org Git - clang/log
clang
13 years agoAssociate the macro arguments location map with a FileID instead
Argyrios Kyrtzidis [Mon, 26 Sep 2011 08:01:50 +0000 (08:01 +0000)]
Associate the macro arguments location map with a FileID instead
of a ContentCache, since multiple FileIDs can have the same ContentCache
but the expanded macro arguments locations will be different.

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

13 years agoRemove SourceManager::getLocation().
Argyrios Kyrtzidis [Mon, 26 Sep 2011 08:01:45 +0000 (08:01 +0000)]
Remove SourceManager::getLocation().

It's not descriptive enough and it's just a call of translateFileLineCol()
followed by a call to getMacroArgExpandedLocation(), which is better to be
called explicitly since it has a certain cost and is not always required.

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

13 years agoDon't map a file:line:col triplet that is inside the preamble range to
Argyrios Kyrtzidis [Mon, 26 Sep 2011 08:01:41 +0000 (08:01 +0000)]
Don't map a file:line:col triplet that is inside the preamble range to
a "loaded" location of the precompiled preamble.

Instead, handle specially locations of preprocessed entities:
-When looking up for preprocessed entities, map main file locations inside the
 preamble range to a preamble loaded location.
-When getting the source range of a preprocessing cursor, map preamble loaded
 locations back to main file locations.

Fixes rdar://10175093 & http://llvm.org/PR10999

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

13 years agoProperly initialize Preprocessor::CurLexerKind to avoid use of uninitialized variable.
Zhongxing Xu [Mon, 26 Sep 2011 03:37:43 +0000 (03:37 +0000)]
Properly initialize Preprocessor::CurLexerKind to avoid use of uninitialized variable.

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

13 years agoTurns out we tested for this typo.
Benjamin Kramer [Mon, 26 Sep 2011 02:32:23 +0000 (02:32 +0000)]
Turns out we tested for this typo.

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

13 years agoAdd missing spaces in diagnostic messages.
Benjamin Kramer [Mon, 26 Sep 2011 02:14:16 +0000 (02:14 +0000)]
Add missing spaces in diagnostic messages.

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

13 years agoDon't print a stray ] at the end of diagnostics.
Benjamin Kramer [Mon, 26 Sep 2011 02:14:13 +0000 (02:14 +0000)]
Don't print a stray ] at the end of diagnostics.

Also remove an obsolete utostr call.

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

13 years agoMove VTable builder to AST
Peter Collingbourne [Mon, 26 Sep 2011 01:57:12 +0000 (01:57 +0000)]
Move VTable builder to AST

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

13 years agoHave CodeGenVTables::GenerateConstructionVTable use VTableLayout
Peter Collingbourne [Mon, 26 Sep 2011 01:57:04 +0000 (01:57 +0000)]
Have CodeGenVTables::GenerateConstructionVTable use VTableLayout

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

13 years agoMove vtable dumper call to VTableBuilder ctor
Peter Collingbourne [Mon, 26 Sep 2011 01:57:00 +0000 (01:57 +0000)]
Move vtable dumper call to VTableBuilder ctor

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

13 years agoImplement VTableContext::createConstructionVTableLayout
Peter Collingbourne [Mon, 26 Sep 2011 01:56:55 +0000 (01:56 +0000)]
Implement VTableContext::createConstructionVTableLayout

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

13 years agoMove all vtable layout data into new VTableLayout class
Peter Collingbourne [Mon, 26 Sep 2011 01:56:50 +0000 (01:56 +0000)]
Move all vtable layout data into new VTableLayout class

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

13 years agoMove VTableComponent to header file
Peter Collingbourne [Mon, 26 Sep 2011 01:56:45 +0000 (01:56 +0000)]
Move VTableComponent to header file

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

13 years agoMove vtable component accessors to VTableContext
Peter Collingbourne [Mon, 26 Sep 2011 01:56:41 +0000 (01:56 +0000)]
Move vtable component accessors to VTableContext

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

13 years agoRemove CodeGenVTables::ComputeVTableRelatedInformation dependency on CodeGen
Peter Collingbourne [Mon, 26 Sep 2011 01:56:36 +0000 (01:56 +0000)]
Remove CodeGenVTables::ComputeVTableRelatedInformation dependency on CodeGen

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

13 years agoCreate a VTableContext class and start moving CodeGenVTables methods to it
Peter Collingbourne [Mon, 26 Sep 2011 01:56:30 +0000 (01:56 +0000)]
Create a VTableContext class and start moving CodeGenVTables methods to it

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

13 years agoMove VTT builder to AST
Peter Collingbourne [Mon, 26 Sep 2011 01:56:24 +0000 (01:56 +0000)]
Move VTT builder to AST

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

13 years agoMove BaseSubobject class to AST
Peter Collingbourne [Mon, 26 Sep 2011 01:56:16 +0000 (01:56 +0000)]
Move BaseSubobject class to AST

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

13 years agoRemove CodeGenModule field from VTTBuilder
Peter Collingbourne [Mon, 26 Sep 2011 01:56:10 +0000 (01:56 +0000)]
Remove CodeGenModule field from VTTBuilder

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

13 years agoMake the VTTBuilder class independent of LLVM core
Peter Collingbourne [Mon, 26 Sep 2011 01:56:06 +0000 (01:56 +0000)]
Make the VTTBuilder class independent of LLVM core

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

13 years agoRemove support for splitting word-wrapped diagnostic messages on newline
Chandler Carruth [Mon, 26 Sep 2011 01:44:29 +0000 (01:44 +0000)]
Remove support for splitting word-wrapped diagnostic messages on newline
characters. I could find no newline character in a diagnostic message,
and adding an assert to this code never fires in the testsuite.

I think this code is essentially dead, and was previously used for
a different purpose. If I just don't understand how it is we can end up
with a newline here please let me know (with a test case?) and I'll
revert.

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

13 years agoMove the word wrapped printing routine down to all the other helper
Chandler Carruth [Mon, 26 Sep 2011 01:44:27 +0000 (01:44 +0000)]
Move the word wrapped printing routine down to all the other helper
printing routines, clean up its doxyments and switch it to a camelCase
name as well. No functionality changed here.

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

13 years agoSwitch some of my recently added helper functions to use the proper
Chandler Carruth [Mon, 26 Sep 2011 01:30:09 +0000 (01:30 +0000)]
Switch some of my recently added helper functions to use the proper
style, and add doxyments.

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

13 years agoRewrite the printing of diagnostic options, categories, etc to actually
Chandler Carruth [Mon, 26 Sep 2011 01:21:58 +0000 (01:21 +0000)]
Rewrite the printing of diagnostic options, categories, etc to actually
use the ostream interface and avoid lots of temporary strings.

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

13 years agoRename DiagnosticInfo to Diagnostic as per issue 5397
David Blaikie [Mon, 26 Sep 2011 01:18:08 +0000 (01:18 +0000)]
Rename DiagnosticInfo to Diagnostic as per issue 5397

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

13 years agoRename PathDiagnosticClient to PathDiagnosticConsumer as per issue 5397
David Blaikie [Mon, 26 Sep 2011 00:51:36 +0000 (00:51 +0000)]
Rename PathDiagnosticClient to PathDiagnosticConsumer as per issue 5397

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

13 years agoDelete an extraneous line I missed.
Chandler Carruth [Mon, 26 Sep 2011 00:45:02 +0000 (00:45 +0000)]
Delete an extraneous line I missed.

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

13 years agoA direct extraction of the rest of the option printing into a helper.
Chandler Carruth [Mon, 26 Sep 2011 00:44:09 +0000 (00:44 +0000)]
A direct extraction of the rest of the option printing into a helper.
This needs to be cleaned up to better use the ostream object, WIP.

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

13 years agoRename VerifyDiagnosticsClient to VerifyDiagnosticConsumer as per issue 5397
David Blaikie [Mon, 26 Sep 2011 00:38:03 +0000 (00:38 +0000)]
Rename VerifyDiagnosticsClient to VerifyDiagnosticConsumer as per issue 5397

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

13 years agoStart a more correct pattern for factoring out the name printing. Slowly
Chandler Carruth [Mon, 26 Sep 2011 00:37:30 +0000 (00:37 +0000)]
Start a more correct pattern for factoring out the name printing. Slowly
I'm planning to switch a bunch of these over to use a raw_ostream
instead of += on a string object.

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

13 years agoRevert r140484. That was *not* ready to be committed! Only halfway done,
Chandler Carruth [Mon, 26 Sep 2011 00:26:47 +0000 (00:26 +0000)]
Revert r140484. That was *not* ready to be committed! Only halfway done,
and completely broken at that.

Sorry, must remember to stash rather than commit. =]

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

13 years agoFix a formatting goof.
Chandler Carruth [Mon, 26 Sep 2011 00:21:50 +0000 (00:21 +0000)]
Fix a formatting goof.

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

13 years agoRename ChainedDiagnosticClient to ChainedDiagnosticConsumer as per issue 5397
David Blaikie [Mon, 26 Sep 2011 00:21:47 +0000 (00:21 +0000)]
Rename ChainedDiagnosticClient to ChainedDiagnosticConsumer as per issue 5397

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

13 years agoExtract the diagnostic message formatting into a helper routine.
Chandler Carruth [Mon, 26 Sep 2011 00:21:47 +0000 (00:21 +0000)]
Extract the diagnostic message formatting into a helper routine.

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

13 years agoRename StoredDiagnosticClient to StoredDiagnosticConsumer as per issue 5397
David Blaikie [Mon, 26 Sep 2011 00:01:39 +0000 (00:01 +0000)]
Rename StoredDiagnosticClient to StoredDiagnosticConsumer as per issue 5397

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

13 years agoRename CaptureDiagnosticClient to CaptureDiagnosticConsumer as per issue 5397
David Blaikie [Sun, 25 Sep 2011 23:54:33 +0000 (23:54 +0000)]
Rename CaptureDiagnosticClient to CaptureDiagnosticConsumer as per issue 5397

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

13 years agoExtract the logic for printing a colorful level name into a helper
Chandler Carruth [Sun, 25 Sep 2011 23:51:01 +0000 (23:51 +0000)]
Extract the logic for printing a colorful level name into a helper
function.

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

13 years agoRename IgnoringDiagClient to IgnoringDiagConsumer as per issue 5397
David Blaikie [Sun, 25 Sep 2011 23:44:35 +0000 (23:44 +0000)]
Rename IgnoringDiagClient to IgnoringDiagConsumer as per issue 5397

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

13 years agoRename DiagnosticClient to DiagnosticConsumer as per issue 5397
David Blaikie [Sun, 25 Sep 2011 23:39:51 +0000 (23:39 +0000)]
Rename DiagnosticClient to DiagnosticConsumer as per issue 5397

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

13 years agoRename Diagnostic to DiagnosticsEngine as per issue 5397
David Blaikie [Sun, 25 Sep 2011 23:23:43 +0000 (23:23 +0000)]
Rename Diagnostic to DiagnosticsEngine as per issue 5397

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

13 years agoInline this method now that its completely trivial, and prepare for
Chandler Carruth [Sun, 25 Sep 2011 23:01:05 +0000 (23:01 +0000)]
Inline this method now that its completely trivial, and prepare for
hoisting parts of the text diagnostic.

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

13 years agoShuffle some names around. 'CaretDiagnostic' is inaccurate as this needs
Chandler Carruth [Sun, 25 Sep 2011 22:54:56 +0000 (22:54 +0000)]
Shuffle some names around. 'CaretDiagnostic' is inaccurate as this needs
to handle non-caret diagnostics as well in order to be fully useful in
libclang etc. Also sketch out some more of my plans on this refactoring.

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

13 years agoActually remove the members of CaretDiagnostic no longer in use for
Chandler Carruth [Sun, 25 Sep 2011 22:31:58 +0000 (22:31 +0000)]
Actually remove the members of CaretDiagnostic no longer in use for
tracking the start and stop of macro expansion suppression. Also remove
the Columns variable which was just a convenience variable based on
DiagOpts. Instead we materialize it in the one piece of code that cared.

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

13 years agoSink the logic for suppressing some macro expansion notes from the
Chandler Carruth [Sun, 25 Sep 2011 22:27:52 +0000 (22:27 +0000)]
Sink the logic for suppressing some macro expansion notes from the
TextDiagnosticPrinter into the CaretDiagnostic class. Several
interesting results from this:

- This removes a significant per-diagnostic bit of state from the
  CaretDiagnostic class, which should eventually allow us to re-use the
  object.
- It removes a redundant recursive walk of the macro expansion stack
  just to compute the depth. We don't need the depth until we're
  unwinding anyways, so we can just mark when we reach it.
- It also paves the way for several simplifications we can do to how we
  implement the suppression.

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

13 years agoSplit the recursive macro expansion walk out from the routine which
Chandler Carruth [Sun, 25 Sep 2011 06:59:38 +0000 (06:59 +0000)]
Split the recursive macro expansion walk out from the routine which
emits a source snippet and caret line.

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

13 years agoAdd a missing increment to avoid infinite looping in the regression test.
Benjamin Kramer [Sun, 25 Sep 2011 02:41:26 +0000 (02:41 +0000)]
Add a missing increment to avoid infinite looping in the regression test.

Also make sure we set the error flag when correcting a typo.

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

13 years agoUpdate CMake build.
Benjamin Kramer [Sat, 24 Sep 2011 18:21:37 +0000 (18:21 +0000)]
Update CMake build.

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

13 years agoAdd a special note for overload resolution when an initializer list argument
Sebastian Redl [Sat, 24 Sep 2011 17:48:32 +0000 (17:48 +0000)]
Add a special note for overload resolution when an initializer list argument
cannot be converted.
This is in preparation for overload resolution of initializer lists.
Currently, you will always get this message when you try to pass an init
list to an overloaded function.

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

13 years agoCorrectly parse braced member initializers (even in delayed parsing) and correctly...
Sebastian Redl [Sat, 24 Sep 2011 17:48:25 +0000 (17:48 +0000)]
Correctly parse braced member initializers (even in delayed parsing) and correctly pass
the information on to Sema. There's still an incorrectness in the way template instantiation
works now, but that is due to a far larger underlying representational problem.
Also add a test case for various list initialization cases of scalars, which test this
commit as well as the previous one.

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

13 years agoTreat list-initialization of scalars as a first-class citizen in C++11.
Sebastian Redl [Sat, 24 Sep 2011 17:48:14 +0000 (17:48 +0000)]
Treat list-initialization of scalars as a first-class citizen in C++11.
Allow empty initializer lists for scalars, which mean value-initialization.
Constant evaluation for single-element and empty initializer lists for scalars.
Codegen for empty initializer lists for scalars.
Test case comes in next commit.

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

13 years agoFix the expected error for narrowing conversions in generalized-initializers.cpp to
Sebastian Redl [Sat, 24 Sep 2011 17:48:06 +0000 (17:48 +0000)]
Fix the expected error for narrowing conversions in generalized-initializers.cpp to
match what the actual implementation of the error looks like.

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

13 years agoGive InitListChecker a verification-only mode, where it neither emits diagnostics nor
Sebastian Redl [Sat, 24 Sep 2011 17:48:00 +0000 (17:48 +0000)]
Give InitListChecker a verification-only mode, where it neither emits diagnostics nor
builds a semantic (structured) initializer list, just reports on whether it can match
the given list to the target type.
Use this mode for doing init list checking in the initial step of initialization, which
will eventually allow us to do overload resolution based on the outcome.

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

13 years agoIn Initialization, add step kind SK_ListConstructorCall (list-initialization
Sebastian Redl [Sat, 24 Sep 2011 17:47:52 +0000 (17:47 +0000)]
In Initialization, add step kind SK_ListConstructorCall (list-initialization
resolves to a constructor call in C++11) and failure kind
FK_ListInitializationFailed (early InitListChecker run failed).

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

13 years agoInline Sema::CheckInitList into its only user.
Sebastian Redl [Sat, 24 Sep 2011 17:47:46 +0000 (17:47 +0000)]
Inline Sema::CheckInitList into its only user.

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

13 years agoFix typos and non-doxygen-ness in a few comments.
Sebastian Redl [Sat, 24 Sep 2011 17:47:39 +0000 (17:47 +0000)]
Fix typos and non-doxygen-ness in a few comments.

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

13 years ago[microsoft] In Microsoft mode, if we are inside a template class member function...
Francois Pichet [Sat, 24 Sep 2011 10:38:05 +0000 (10:38 +0000)]
[microsoft] In Microsoft mode, if we are inside a template class member function and we can't resolve an identifier then assume the identifier is type dependent. The goal is to postpone name lookup to instantiation time to be able to search into type dependent base classes.

This fixes a few errors when parsing MFC code with clang.
BTW clang trunk is now about 5 patches away to be able the parse the default wizard-generated MFC project.

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

13 years agoFix comment typo.
Benjamin Kramer [Sat, 24 Sep 2011 03:04:03 +0000 (03:04 +0000)]
Fix comment typo.

Patch by Rui Paulo!

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

13 years agoobjc - redeclaration of property in extension class
Fariborz Jahanian [Sat, 24 Sep 2011 00:56:59 +0000 (00:56 +0000)]
objc - redeclaration of property in extension class
must match property type declaration in its
primary class. // rdar://10142679

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

13 years agoDon't translate CRLF files into LF files. Fixes PR6870, from Aaron Ballman!
Douglas Gregor [Fri, 23 Sep 2011 23:43:36 +0000 (23:43 +0000)]
Don't translate CRLF files into LF files. Fixes PR6870, from Aaron Ballman!

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

13 years agoDriver: Use sys::Process::SetWorkingDirectory, for consistency.
Daniel Dunbar [Fri, 23 Sep 2011 23:32:02 +0000 (23:32 +0000)]
Driver: Use sys::Process::SetWorkingDirectory, for consistency.

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

13 years agoobjc - fixes a crash when undefined typed property
Fariborz Jahanian [Fri, 23 Sep 2011 23:11:38 +0000 (23:11 +0000)]
objc - fixes a crash when undefined typed property
followed by it implementation crashes when attempt
is made to access the synthesized ivar.
// rdar://10177744

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

13 years agoFix a crash-on-invalid.
Matt Beaumont-Gay [Fri, 23 Sep 2011 22:39:23 +0000 (22:39 +0000)]
Fix a crash-on-invalid.

The token stream was not getting properly reset when leaving
ParseLexedMethodDef in some error cases. In the testcase, that caused later
accesses to the token stream to touch memory which had been freed as we
finished parsing the class definition. Major hat-tip to AddressSanitizer for
helping pinpoint the use-after-free, including the allocation and deallocation
points:

==21510== ERROR: AddressSanitizer heap-use-after-free on address 0x7feb3de87848 at pc 0x249f4e2 bp 0x7fff15a89df0 sp 0x7fff15a89ce0
READ of size 1 at 0x7feb3de87848 thread T0
  #0 0x249f4e2 clang::TokenLexer::Lex()
  #1 0x1c834a0 clang::Parser::ConsumeToken()
  #2 0x1c7dc0f clang::Parser::ParseDeclarationOrFunctionDefinition()
  #3 0x1c7e16b clang::Parser::ParseDeclarationOrFunctionDefinition()
<snip>
0x7feb3de87848 is located 1992 bytes inside of 3816-byte region [0x7feb3de87080,0x7feb3de87f68)
freed by thread T0 here:
  #0 0x3a22c19 free
  #1 0x1d136a1 clang::Parser::LexedMethod::~LexedMethod()
  #2 0x1cef528 clang::Parser::DeallocateParsedClasses()
  #3 0x1cef676 clang::Parser::PopParsingClass()
  #4 0x1cea094 clang::Parser::ParseCXXMemberSpecification()
  #5 0x1ce7ae5 clang::Parser::ParseClassSpecifier()
  #6 0x1cfe588 clang::Parser::ParseDeclarationSpecifiers()
  #7 0x1c7dbe8 clang::Parser::ParseDeclarationOrFunctionDefinition()
  #8 0x1c7e16b clang::Parser::ParseDeclarationOrFunctionDefinition()
<snip>
previously allocated by thread T0 here:
  #0 0x3a2302d realloc
  #1 0x39d7c97 llvm::SmallVectorBase::grow_pod()
  #2 0x1ac588e llvm::SmallVectorImpl<>::push_back()
  #3 0x1d12d8b clang::Parser::ConsumeAndStoreUntil()
  #4 0x1c9c24d clang::Parser::ConsumeAndStoreUntil()
  #5 0x1d12c1e clang::Parser::ConsumeAndStoreUntil()
  #6 0x1c9c24d clang::Parser::ConsumeAndStoreUntil()
  #7 0x1d10042 clang::Parser::ParseCXXInlineMethodDef()
  #8 0x1cec51a clang::Parser::ParseCXXClassMemberDeclaration()
  #9 0x1ce9de5 clang::Parser::ParseCXXMemberSpecification()
  #10 0x1ce7ae5 clang::Parser::ParseClassSpecifier()
  #11 0x1cfe588 clang::Parser::ParseDeclarationSpecifiers()
  #12 0x1c7dbe8 clang::Parser::ParseDeclarationOrFunctionDefinition()
  #13 0x1c7e16b clang::Parser::ParseDeclarationOrFunctionDefinition()
<snip>

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

13 years agoFix up assertion a bit more
Douglas Gregor [Fri, 23 Sep 2011 22:07:41 +0000 (22:07 +0000)]
Fix up assertion a bit more

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

13 years agoDriver: Explicitly include <unistd.h>, libstdc++'s <map> pulls it in, libc++ doesn't.
Benjamin Kramer [Fri, 23 Sep 2011 21:03:19 +0000 (21:03 +0000)]
Driver: Explicitly include <unistd.h>, libstdc++'s <map> pulls it in, libc++ doesn't.

Also, on windows, chdir seems to live in <direct.h>.

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

13 years agoAdd DiagGroups to a couple of warnings.
Matt Beaumont-Gay [Fri, 23 Sep 2011 20:56:58 +0000 (20:56 +0000)]
Add DiagGroups to a couple of warnings.

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

13 years agoDriver: Test case that was supposed to go with previous commit.
Daniel Dunbar [Fri, 23 Sep 2011 20:35:31 +0000 (20:35 +0000)]
Driver: Test case that was supposed to go with previous commit.

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

13 years agoDriver: Add a --working-directory option which can be used to cause the compiler
Daniel Dunbar [Fri, 23 Sep 2011 20:33:41 +0000 (20:33 +0000)]
Driver: Add a --working-directory option which can be used to cause the compiler
to operate "as if" in a certain working directory.
 - For now, we just implement this by changing the actual working directory, but
   eventually we would want to handle this transparently. This is useful to
   avoid an extra exec() pair in some situations, and will be something we would
   want to support for more flexibility in using the Clang libraries.

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

13 years agoAdd a test triple. Who knew that all the world wasn't darwin?
Douglas Gregor [Fri, 23 Sep 2011 20:28:32 +0000 (20:28 +0000)]
Add a test triple. Who knew that all the world wasn't darwin?

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

13 years agoRemoving a bunch of dead returns/breaks after llvm_unreachables.
David Blaikie [Fri, 23 Sep 2011 20:26:49 +0000 (20:26 +0000)]
Removing a bunch of dead returns/breaks after llvm_unreachables.

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

13 years agoDon't propagate the 'availability' attribute through declaration
Douglas Gregor [Fri, 23 Sep 2011 20:23:42 +0000 (20:23 +0000)]
Don't propagate the 'availability' attribute through declaration
merging for overrides. One might want to make a method's availability
in a superclass different from that of its subclass. Fixes
<rdar://problem/10166223>.

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

13 years agoAdd a new warning to -Wliteral-conversion to catch cases where a string literal
Richard Trieu [Fri, 23 Sep 2011 20:10:00 +0000 (20:10 +0000)]
Add a new warning to -Wliteral-conversion to catch cases where a string literal
is cast to a boolean.  An exception has been made for string literals in
logical expressions to allow the common case of use in assert statements.

bool x;
x = "hi";  // Warn here
void foo(bool x);
foo("hi");  // Warn here
assert(0 && "error");
assert("error);  // Warn here

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

13 years agoClean up parsing the category names in interfaces slightly, using
Douglas Gregor [Fri, 23 Sep 2011 19:19:41 +0000 (19:19 +0000)]
Clean up parsing the category names in interfaces slightly, using
MatchRHSPunctuation appropriately and giving a useful source location
for the complaint about attributes being added to a category.

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

13 years agoMove immutable map canonization out of the removeDeadBindings loop (via using Immutab...
Anna Zaks [Fri, 23 Sep 2011 19:14:09 +0000 (19:14 +0000)]
Move immutable map canonization out of the removeDeadBindings loop (via using ImmutableMapRef). Gives ~2% speedup.

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

13 years agoWhen checking for weak vtables, check whether the actual definition of
Douglas Gregor [Fri, 23 Sep 2011 19:04:03 +0000 (19:04 +0000)]
When checking for weak vtables, check whether the actual definition of
the key function is inline, rather than the original
declaration. Perhaps FunctionDecl::isInlined() is poorly named. Fixes
<rdar://problem/9979458>.

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

13 years agoobjc-gc: Fix a corner case where clang fails to generate GC
Fariborz Jahanian [Fri, 23 Sep 2011 18:57:30 +0000 (18:57 +0000)]
objc-gc: Fix a corner case where clang fails to generate GC
write barrier with captured pointer to object. // rdar://10150823

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

13 years agoFix up comment now that 'new' is no longer a virt-specifier, from Aaron Ballman
Douglas Gregor [Fri, 23 Sep 2011 16:58:49 +0000 (16:58 +0000)]
Fix up comment now that 'new' is no longer a virt-specifier, from Aaron Ballman

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

13 years agoEliminate an MSVC comparison warning, from Aaron Ballman
Douglas Gregor [Fri, 23 Sep 2011 16:57:55 +0000 (16:57 +0000)]
Eliminate an MSVC comparison warning, from Aaron Ballman

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

13 years agoFix wrong comment about reentering template scope for -fdelayed-template-parsing.
Francois Pichet [Fri, 23 Sep 2011 16:02:49 +0000 (16:02 +0000)]
Fix wrong comment about reentering template scope for -fdelayed-template-parsing.

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

13 years agoMore missing header inclusions from llvm_unreachable migration.
David Blaikie [Fri, 23 Sep 2011 05:57:42 +0000 (05:57 +0000)]
More missing header inclusions from llvm_unreachable migration.

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

13 years agoFix missing includes for llvm_unreachable
David Blaikie [Fri, 23 Sep 2011 05:35:21 +0000 (05:35 +0000)]
Fix missing includes for llvm_unreachable

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

13 years agoSwitch assert(0/false) llvm_unreachable.
David Blaikie [Fri, 23 Sep 2011 05:06:16 +0000 (05:06 +0000)]
Switch assert(0/false) llvm_unreachable.

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

13 years agoReenable -cxx-isystem for Objective C++, until I come up with a better solution
Benjamin Kramer [Fri, 23 Sep 2011 02:25:14 +0000 (02:25 +0000)]
Reenable -cxx-isystem for Objective C++, until I come up with a better solution

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

13 years agounittests/Basic/FileManagerTest.cpp: Suppress warnings on gcc.
NAKAMURA Takumi [Fri, 23 Sep 2011 01:53:05 +0000 (01:53 +0000)]
unittests/Basic/FileManagerTest.cpp: Suppress warnings on gcc.

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

13 years agoCMake: Define ${LLVM_TABLEGEN_EXE} with explicit ${CMAKE_EXECUTABLE_SUFFIX} on standa...
NAKAMURA Takumi [Fri, 23 Sep 2011 00:52:55 +0000 (00:52 +0000)]
CMake: Define ${LLVM_TABLEGEN_EXE} with explicit ${CMAKE_EXECUTABLE_SUFFIX} on standalone build. Or build might fail with NMake.

Thanks to Nicolas Le Gland!

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

13 years agoDon't finalize checking of base and member initializers for a
Douglas Gregor [Thu, 22 Sep 2011 23:04:35 +0000 (23:04 +0000)]
Don't finalize checking of base and member initializers for a
constructor template. Fixes PR10457.

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

13 years ago[microsoft] Fix a bug in -fdelayed-template-parsing mode where we were not reentering...
Francois Pichet [Thu, 22 Sep 2011 22:14:56 +0000 (22:14 +0000)]
[microsoft] Fix a bug in -fdelayed-template-parsing mode where we were not reentering the delayed function context correctly. The problem was that all template params were reintroduced inside the same scope. So if we had a situation where we had 2 template params with the same name at different scope then clang would generate an error about ambiguous name.

The solution is to create a new ParseScope(Scope::TemplateParamScope) for each template scope that we want to reenter. (from the outmost to the innermost scope)

This fixes some errors when parsing MFC code with clang.

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

13 years agoDon't test unix path seperators, that will fail on windows.
Benjamin Kramer [Thu, 22 Sep 2011 22:14:48 +0000 (22:14 +0000)]
Don't test unix path seperators, that will fail on windows.

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

13 years agoSee if going through env pacifies the windows buildbots.
Benjamin Kramer [Thu, 22 Sep 2011 22:08:09 +0000 (22:08 +0000)]
See if going through env pacifies the windows buildbots.

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

13 years agoAdd support for CPATH and friends.
Benjamin Kramer [Thu, 22 Sep 2011 21:41:16 +0000 (21:41 +0000)]
Add support for CPATH and friends.

This moves the existing code for CPATH into the driver and adds the environment lookup and path splitting there.
The paths are then passed down to cc1 with -I options (CPATH), added after the normal user-specified include dirs.
Language specific paths are passed via -LANG-isystem and the actual filtering is performed in the frontend.

I tried to match GCC's behavior as close as possible

Fixes PR8971.

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

13 years agoDo manual binary search for preprocessing entities because their end locations
Argyrios Kyrtzidis [Thu, 22 Sep 2011 21:17:02 +0000 (21:17 +0000)]
Do manual binary search for preprocessing entities because their end locations
may be unordered and MSVC's debug-mode doesn't like it.

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

13 years agoDon't remove filters.
Bill Wendling [Thu, 22 Sep 2011 20:32:54 +0000 (20:32 +0000)]
Don't remove filters.

It's not valid to remove filters from landingpad instructions, even if we catch
the type. The metadata won't be set up correctly.

Testcase is projects/llvm-test/SingleSource/UnitTests/EH/filter-2.cpp.

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

13 years agoOnly trigger the initialize-an-array-via-elementwise-copy/move code
Douglas Gregor [Thu, 22 Sep 2011 20:32:43 +0000 (20:32 +0000)]
Only trigger the initialize-an-array-via-elementwise-copy/move code
generation when we're dealing with an implicitly-defined copy or move
constructor. And, actually set the implicitly-defined bit for
implicitly-defined constructors and destructors. Should fix self-host.

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

13 years agoDon't use TemplateArgumentListInfo inside AST nodes because it may leak.
Argyrios Kyrtzidis [Thu, 22 Sep 2011 20:07:09 +0000 (20:07 +0000)]
Don't use TemplateArgumentListInfo inside AST nodes because it may leak.
Use ASTTemplateArgumentListInfo instead.

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

13 years agoRename ExplicitTemplateArgumentList -> ASTTemplateArgumentListInfo, no functionality...
Argyrios Kyrtzidis [Thu, 22 Sep 2011 20:07:03 +0000 (20:07 +0000)]
Rename ExplicitTemplateArgumentList -> ASTTemplateArgumentListInfo, no functionality change.

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

13 years agoPlace diagnostic warn_ivar_use_hidden under the flag -Wshadow-ivar.
Ted Kremenek [Thu, 22 Sep 2011 19:24:22 +0000 (19:24 +0000)]
Place diagnostic warn_ivar_use_hidden under the flag -Wshadow-ivar.

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

13 years agoST->scanReachableSymbols() is creating a SubRegionMap (SRM) on every call since one...
Anna Zaks [Thu, 22 Sep 2011 18:10:41 +0000 (18:10 +0000)]
ST->scanReachableSymbols() is creating a SubRegionMap (SRM) on every call since one SRM is created in each ScanReachableSymbols instance. Creating the object just once and calling only scan inside the loop gives ~ 14% speed up of the StaticAnalyzer run (Release+Asserts).

Pull out the declaration of the ScanReachableSymbols so that it can be used directly. Document ProgramState::scanReachableSymbols() methods.

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

13 years agoPTX: Clean up target options code
Justin Holewinski [Thu, 22 Sep 2011 17:57:40 +0000 (17:57 +0000)]
PTX: Clean up target options code

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

13 years agoFix the ASTImporter's lookup for anonymous structs/unions that get a
Douglas Gregor [Thu, 22 Sep 2011 17:51:56 +0000 (17:51 +0000)]
Fix the ASTImporter's lookup for anonymous structs/unions that get a
linkage name via typedef. Patch from/fixes PR10958.

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

13 years agoDon't allow template argument deduction to deduce a placeholder type,
Douglas Gregor [Thu, 22 Sep 2011 15:57:07 +0000 (15:57 +0000)]
Don't allow template argument deduction to deduce a placeholder type,
ever. Fixes PR10939.

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

13 years agoExplicitly-defaulted copy/move constructors are not "implicit", but
Douglas Gregor [Thu, 22 Sep 2011 15:15:51 +0000 (15:15 +0000)]
Explicitly-defaulted copy/move constructors are not "implicit", but
they still need the logic to cope with array member
initialization. Fixes PR10720.

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