]> granicus.if.org Git - clang/log
clang
13 years agoremove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
Chris Lattner [Sat, 23 Jul 2011 10:55:15 +0000 (10:55 +0000)]
remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
them into the clang namespace.

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

13 years agoclean up forward declarations of raw_ostream to use the new LLVM.h
Chris Lattner [Sat, 23 Jul 2011 10:35:09 +0000 (10:35 +0000)]
clean up forward declarations of raw_ostream to use the new LLVM.h
patch by Jon Mulder!

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

13 years agoMigrate 2007-10-01-BuildArrayRef.c from llvm/test/FrontendC.
Eric Christopher [Sat, 23 Jul 2011 02:16:25 +0000 (02:16 +0000)]
Migrate 2007-10-01-BuildArrayRef.c from llvm/test/FrontendC.

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

13 years agoMove TargetAsmParser.h TargetAsmBackend.h and TargetAsmLexer.h to MC where they belong.
Evan Cheng [Sat, 23 Jul 2011 00:45:53 +0000 (00:45 +0000)]
Move TargetAsmParser.h TargetAsmBackend.h and TargetAsmLexer.h to MC where they belong.

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

13 years agoAdd ext_backslash_newline_eof to Wnewline-eof group.
Anna Zaks [Sat, 23 Jul 2011 00:36:52 +0000 (00:36 +0000)]
Add ext_backslash_newline_eof to Wnewline-eof group.

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

13 years agoThis patch (thanks to Doug Gregor) fixes a
Sean Callanan [Fri, 22 Jul 2011 23:46:03 +0000 (23:46 +0000)]
This patch (thanks to Doug Gregor) fixes a
problem where Clang was setting the
hasExternalVisibleDecls() bit for all
DeclContexts it imported.  This caused Clang
to make unnecessary calls to
findExternalVisibleDecls() when an external
AST source was installed.

In fact, Clang sometimes interpreted a failure
by one of these spurious calls to find a
Decl as meaning the Decl didn't exist, even
though findExternalLexicalDecls() did locate
that decl.  This produced amusing errors of
the form:

-
error: no member named 'b' in 'A'; did you
mean 'b'?
-

Now, if hasExternalVisibleDecls() or
hasExternalLexicalDecls() should be set, the
external AST source must do so itself.

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

13 years agoExpose no newline at end of file warning under Wnewline-eof flag.
Anna Zaks [Fri, 22 Jul 2011 23:08:19 +0000 (23:08 +0000)]
Expose no newline at end of file warning under Wnewline-eof flag.

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

13 years agoMatch LLVM API change.
Evan Cheng [Fri, 22 Jul 2011 21:59:11 +0000 (21:59 +0000)]
Match LLVM API change.

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

13 years agokill a FIXME in IsIntegralPromotion
David Majnemer [Fri, 22 Jul 2011 21:09:04 +0000 (21:09 +0000)]
kill a FIXME in IsIntegralPromotion

IsIntegralPromotion should consider the signedness of FromType when
calculating promotions. This, as of now, cannot be exercised on any
platform so there is no corresponding test.

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

13 years agoRemove prepending of '$' to module names.
Jonathan D. Turner [Fri, 22 Jul 2011 17:25:03 +0000 (17:25 +0000)]
Remove prepending of '$' to module names.

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

13 years agoSwitch all of the "isysroot" const char*'s throughout the AST reader
Douglas Gregor [Fri, 22 Jul 2011 16:35:34 +0000 (16:35 +0000)]
Switch all of the "isysroot" const char*'s throughout the AST reader
and writer to StringRef or std::string, as appropriate.

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

13 years agoRename ASTReader::PerFileData to serialization::Module, pulling it out
Douglas Gregor [Fri, 22 Jul 2011 16:00:58 +0000 (16:00 +0000)]
Rename ASTReader::PerFileData to serialization::Module, pulling it out
of ASTReader so it can become its own full-fledged class
(eventually). No functionality change.

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

13 years agoUse -ffreestanding with clang_cc1 to make the test picks the clang builtin include.
Francois Pichet [Fri, 22 Jul 2011 10:49:54 +0000 (10:49 +0000)]
Use -ffreestanding with clang_cc1 to make the test picks the clang builtin include.

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

13 years agoAdd a missing forward declaration and namespace qualifier to this
Chandler Carruth [Fri, 22 Jul 2011 10:16:15 +0000 (10:16 +0000)]
Add a missing forward declaration and namespace qualifier to this
header. This showed up in client code that has a different include
ordering after Chris's shuffle of raw_ostream. All of the Clang code
ends up with a header included before this one that provides the needed
type and using declaration.

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

13 years agoDocument the existing objc_precise_lifetime attribute.
John McCall [Fri, 22 Jul 2011 08:53:00 +0000 (08:53 +0000)]
Document the existing objc_precise_lifetime attribute.
Introduce and document a new objc_returns_inner_pointer
attribute, and consume it by performing a retain+autorelease
on message receivers when they're not immediately loaded from
an object with precise lifetime.

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

13 years agoFix test on MSVC: since the test includes a system header it cannot use clang_cc1.
Francois Pichet [Fri, 22 Jul 2011 08:52:55 +0000 (08:52 +0000)]
Fix test on MSVC: since the test includes a system header it cannot use clang_cc1.

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

13 years agoConvert IRBuilder::CreateGEP and IRBuilder::CreateInBoundsGEP to use
Jay Foad [Fri, 22 Jul 2011 08:16:57 +0000 (08:16 +0000)]
Convert IRBuilder::CreateGEP and IRBuilder::CreateInBoundsGEP to use
ArrayRef.

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

13 years agoBring over a test from llvm/test/FrontendC that is for Sema and not CodeGen.
Eric Christopher [Fri, 22 Jul 2011 07:26:22 +0000 (07:26 +0000)]
Bring over a test from llvm/test/FrontendC that is for Sema and not CodeGen.

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

13 years agofix PR10384: C++ allows external arrays of incomplete type as well.
Chris Lattner [Fri, 22 Jul 2011 06:27:26 +0000 (06:27 +0000)]
fix PR10384: C++ allows external arrays of incomplete type as well.
Many thanks to Eli for reducing this great testcase.

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

13 years agorename test.
Chris Lattner [Fri, 22 Jul 2011 06:26:12 +0000 (06:26 +0000)]
rename test.

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

13 years agoIntroduce a global bit-offset continuous range map into the ASTReader,
Douglas Gregor [Fri, 22 Jul 2011 06:10:01 +0000 (06:10 +0000)]
Introduce a global bit-offset continuous range map into the ASTReader,
so that we have one, simple way to map from global bit offsets to
local bit offsets. Eliminates a number of loops over the chain, and
generalizes for more interesting bit remappings.

Also, as an amusing oddity, we were computing global bit offsets
*backwards* for preprocessed entities (e.g., the directly included PCH
file in the chain would start at offset zero, rather than the original
PCH that occurs first in translation unit). Even more amusingly, it
made precompiled preambles work, because we were forgetting to adjust
the local bit offset to a global bit offset when storing preprocessed
entity offsets in the ASTUnit. Two wrongs made a right, and now
they're both right.

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

13 years agoFix an embarrassing bug in relocatable PCH support, where we were
Douglas Gregor [Fri, 22 Jul 2011 06:03:18 +0000 (06:03 +0000)]
Fix an embarrassing bug in relocatable PCH support, where we were
passing a temporary const char* down as the "isysroot" parameter and
then accessing it later. Fixes <rdar://problem/9035180>.

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

13 years agoMove duplicate uninitialized warning suppression into the
Chandler Carruth [Fri, 22 Jul 2011 05:27:52 +0000 (05:27 +0000)]
Move duplicate uninitialized warning suppression into the
AnalysisBasedWarnings Sema layer and out of the Analysis library itself.
This returns the uninitialized values analysis to a more pure form,
allowing its original logic to correctly detect some categories of
definitely uninitialized values. Fixes PR10358 (again).

Thanks to Ted for reviewing and updating this patch after his rewrite of
several portions of this analysis.

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

13 years agoIn ARC, non-atomic getters do not need to retain and autorelease
John McCall [Fri, 22 Jul 2011 05:23:13 +0000 (05:23 +0000)]
In ARC, non-atomic getters do not need to retain and autorelease
their loaded values, although it still worth doing this for __weak
properties to get the autoreleased-return-value optimization.

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

13 years agoMove this ObjCImplementationDecl member function into libAST
John McCall [Fri, 22 Jul 2011 04:15:06 +0000 (04:15 +0000)]
Move this ObjCImplementationDecl member function into libAST
where it belongs.

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

13 years agoIn Objective-C, pull arbitrary attributes from overridden
John McCall [Fri, 22 Jul 2011 02:45:48 +0000 (02:45 +0000)]
In Objective-C, pull arbitrary attributes from overridden
methods, including indirectly overridden methods like those
declared in protocols and categories.  There are mismatches
that we would like to diagnose but aren't yet, but this
is fine for now.

I looked at approaches that avoided doing this lookup
unless we needed it, but the infer-related-result-type
checks were doing it anyway, so I left it with the same
fast-path check for no previous declartions of that
selector.

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

13 years agoAdd a const overload for ObjCInterfaceDecl::all_declared_ivar_begin.
Jordy Rose [Fri, 22 Jul 2011 02:08:32 +0000 (02:08 +0000)]
Add a const overload for ObjCInterfaceDecl::all_declared_ivar_begin.
This was previously not-const only because it has to lazily construct a chain
of ivars the first time it is called (and after the chain is invalidated).
In practice, all the clients were just const_casting their const Decls;
all those now-unnecessary const_casts have been removed.

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

13 years agoobjective-c: Any use of @synthesize or @dynamic lexically after a method (or C functi...
Fariborz Jahanian [Fri, 22 Jul 2011 01:06:53 +0000 (01:06 +0000)]
objective-c: Any use of @synthesize or @dynamic lexically after a method (or C function) implementation
will be rejected with a compilation error in ARC mode, and a compiler warning otherwise.
This may cause breakage in non-arc (and arc) tests which don't expect warning/error. Feel free
to fix the tests, or reverse the patch, if I am unavailable. // rdar://9818354 - WIP

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

13 years agoIn the AST reader, factor out the mapping of local type IDs to global
Douglas Gregor [Fri, 22 Jul 2011 00:38:23 +0000 (00:38 +0000)]
In the AST reader, factor out the mapping of local type IDs to global
type IDs into a single place, and make sure that all of the callers
use the appropriate functions to do the mapping. Since the mapping is
still the identity function, this is essentially a no-op.

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

13 years agoAvoid warning on "clang -c -Dfoo test.i". Lines like these are created
Rafael Espindola [Thu, 21 Jul 2011 23:40:37 +0000 (23:40 +0000)]
Avoid warning on "clang -c -Dfoo test.i". Lines like these are created
when using ccache and libtool.m4 assumes that the compiler cannot print
warnings about options it knows about.

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

13 years agoClean up the rest of the local -> global declaration ID mappings
Douglas Gregor [Thu, 21 Jul 2011 23:29:11 +0000 (23:29 +0000)]
Clean up the rest of the local -> global declaration ID mappings
within the ASTReader (I hope).

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

13 years agoIn the ASTReader, factor out the loading of (local) declaration IDs,
Douglas Gregor [Thu, 21 Jul 2011 22:35:25 +0000 (22:35 +0000)]
In the ASTReader, factor out the loading of (local) declaration IDs,
such that every declaration ID loaded from an AST file will go through
a central local -> global mapping function. At present, this change
does nothing, since the local -> global mapping function is the
identity function.

This is the mechanical part of the refactoring; a follow-up patch will
address a few remaining areas where it's not obvious whether we're
dealing with local or global IDs.

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

13 years agoAdd a missing test for the limits on wchar
Sean Hunt [Thu, 21 Jul 2011 22:01:12 +0000 (22:01 +0000)]
Add a missing test for the limits on wchar

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

13 years agoFix diagnostic when loading a PCH which has different enabled/disabled state of ...
Argyrios Kyrtzidis [Thu, 21 Jul 2011 21:56:04 +0000 (21:56 +0000)]
Fix diagnostic when loading a PCH which has different enabled/disabled state of -fobjc-arc. rdar://9818341

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

13 years agoCleaning up more of the ID situation in the AST reader. This patch relaxes and gener...
Jonathan D. Turner [Thu, 21 Jul 2011 21:15:19 +0000 (21:15 +0000)]
Cleaning up more of the ID situation in the AST reader.  This patch relaxes and generalizes how CXX base specifiers are identified and loaded by using a ContinuousRangeMap.  This also adds a global bit offset (or base) to the PerFileData.

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

13 years agoAdd some debugging output to the AST reader, so we can see the global remappings...
Douglas Gregor [Thu, 21 Jul 2011 19:50:14 +0000 (19:50 +0000)]
Add some debugging output to the AST reader, so we can see the global remappings we generate

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

13 years agoIn the AST reader, keep track of the total number of source locations
Douglas Gregor [Thu, 21 Jul 2011 18:46:38 +0000 (18:46 +0000)]
In the AST reader, keep track of the total number of source locations
entries incrementally, rather than iterating over the chain when
loading a single AST file.

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

13 years agoFor ASTUnit::Save, write the AST to a temporary and then rename it to the actual...
Argyrios Kyrtzidis [Thu, 21 Jul 2011 18:44:49 +0000 (18:44 +0000)]
For ASTUnit::Save, write the AST to a temporary and then rename it to the actual filename.
Should avoid race conditions. Addresses rdar://9788943.

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

13 years agoCut down one open/close pair of system calls by using Path's makeUnique instead of...
Argyrios Kyrtzidis [Thu, 21 Jul 2011 18:44:46 +0000 (18:44 +0000)]
Cut down one open/close pair of system calls by using Path's makeUnique instead of createTemporaryFileOnDisk.

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

13 years agoUpdate cxx_status page on www: clang has had full support for in-class initializers...
Richard Smith [Thu, 21 Jul 2011 18:02:57 +0000 (18:02 +0000)]
Update cxx_status page on www: clang has had full support for in-class initializers since r132890.

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

13 years agoClean up the C++ status page by eliminating the utterly unnecessary set of projects...
Douglas Gregor [Thu, 21 Jul 2011 17:46:15 +0000 (17:46 +0000)]
Clean up the C++ status page by eliminating the utterly unnecessary set of projects. C++98/03 is sooooo yesterday

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

13 years agoUpdate C++0x nullptr status, from Jonathan Sauer
Douglas Gregor [Thu, 21 Jul 2011 17:41:00 +0000 (17:41 +0000)]
Update C++0x nullptr status, from Jonathan Sauer

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

13 years agoAdd FixIt hint for missing 'id' type.
Fariborz Jahanian [Thu, 21 Jul 2011 17:38:14 +0000 (17:38 +0000)]
Add FixIt hint for missing 'id' type.
// rdar://9615045

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

13 years agoobjc - Diagnose missing method return type specifier under
Fariborz Jahanian [Thu, 21 Jul 2011 17:00:47 +0000 (17:00 +0000)]
objc - Diagnose missing method return type specifier under
a warning flag. // rdar://9615045

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

13 years agoOne last RandomAccessIterator operator for PreprocessingRecord::iterator
Douglas Gregor [Thu, 21 Jul 2011 16:37:44 +0000 (16:37 +0000)]
One last RandomAccessIterator operator for PreprocessingRecord::iterator

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

13 years agoAdd the remaining RandomAccessIterator operations to
Douglas Gregor [Thu, 21 Jul 2011 16:35:41 +0000 (16:35 +0000)]
Add the remaining RandomAccessIterator operations to
PreprocessingRecord::iterator. Where's concept_map when I need it?

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

13 years agoDefine the _MIPS_SIM builtin macro on MIPS platforms. Patch by Robert Millan!
Bruno Cardoso Lopes [Thu, 21 Jul 2011 15:10:57 +0000 (15:10 +0000)]
Define the _MIPS_SIM builtin macro on MIPS platforms. Patch by Robert Millan!

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

13 years agoConvert ConstantExpr::getGetElementPtr and
Jay Foad [Thu, 21 Jul 2011 14:31:17 +0000 (14:31 +0000)]
Convert ConstantExpr::getGetElementPtr and
ConstantExpr::getInBoundsGetElementPtr to use ArrayRef.

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

13 years agoFor some reason I don't fully comprehend, the MSVC debug build will fail with a huge...
Francois Pichet [Thu, 21 Jul 2011 06:26:00 +0000 (06:26 +0000)]
For some reason I don't fully comprehend, the MSVC debug build will fail with a huge 50+ lines template error message if PreprocessingRecord::iterator has no operator<()

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

13 years agoSpeculatively revert 135649 to bring back the g++ testing bots.
Eric Christopher [Thu, 21 Jul 2011 05:34:24 +0000 (05:34 +0000)]
Speculatively revert 135649 to bring back the g++ testing bots.

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

13 years agoMove AnalysisManager constructor out of line. No functionality change (yet).
Ted Kremenek [Thu, 21 Jul 2011 05:22:52 +0000 (05:22 +0000)]
Move AnalysisManager constructor out of line.  No functionality change (yet).

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

13 years agoSimplify passing of CFGBuildOptions around for AnalysisContext. No functionality...
Ted Kremenek [Thu, 21 Jul 2011 05:22:47 +0000 (05:22 +0000)]
Simplify passing of CFGBuildOptions around for AnalysisContext.  No functionality change.

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

13 years agoFix a test in warn-sign-conversion.cpp. Removed a part of a directory path so that...
Richard Trieu [Thu, 21 Jul 2011 03:20:52 +0000 (03:20 +0000)]
Fix a test in warn-sign-conversion.cpp.  Removed a part of a directory path so that the directory seperator, which may change on different platforms, is no longer part of the string checked for.

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

13 years agoRemove warning for conditional operands of differend signedness from -Wsign-compare...
Richard Trieu [Thu, 21 Jul 2011 02:46:28 +0000 (02:46 +0000)]
Remove warning for conditional operands of differend signedness from -Wsign-compare.  Cases that previously warn on this will have a different warning emitted from -Wsign-conversion.

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

13 years agoNew libclang API to expose container type for code completion, from
Douglas Gregor [Thu, 21 Jul 2011 01:05:26 +0000 (01:05 +0000)]
New libclang API to expose container type for code completion, from
Connor Wakamo!

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

13 years agoWhen copping out on a friend template declaration, be sure to mark its
Sean Hunt [Thu, 21 Jul 2011 00:59:23 +0000 (00:59 +0000)]
When copping out on a friend template declaration, be sure to mark its
access specifier as public.

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

13 years agoRework the detailed preprocessing record to separate preprocessing
Douglas Gregor [Thu, 21 Jul 2011 00:47:40 +0000 (00:47 +0000)]
Rework the detailed preprocessing record to separate preprocessing
entities generated directly by the preprocessor from those loaded from
the external source (e.g., the ASTReader). By separating these two
sets of entities into different vectors, we allow both to grow
independently, and eliminate the need for preallocating all of the
loaded preprocessing entities. This is similar to the way the recent
SourceManager refactoring treats FileIDs and the source location
address space.

As part of this, switch over to building a continuous range map to
track preprocessing entities.

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

13 years agoAddressing code review comments for commit 135509 - Add FixItHints in case a C++...
Anna Zaks [Thu, 21 Jul 2011 00:34:39 +0000 (00:34 +0000)]
Addressing code review comments for commit 135509 - Add FixItHints in case a C++ function call is missing * or & operators on

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

13 years agoRemoves a comment.
Fariborz Jahanian [Wed, 20 Jul 2011 23:53:57 +0000 (23:53 +0000)]
Removes a comment.

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

13 years agoobjc-arc: Fixes a crash @throw'ing an objc message.
Fariborz Jahanian [Wed, 20 Jul 2011 23:39:56 +0000 (23:39 +0000)]
objc-arc: Fixes a crash @throw'ing an objc message.
// pr10411

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

13 years agoContinuing to improve and generalize how IDs are handled in ASTReader. This patch...
Jonathan D. Turner [Wed, 20 Jul 2011 21:31:32 +0000 (21:31 +0000)]
Continuing to improve and generalize how IDs are handled in ASTReader.  This patch cleans up and generalizes TypeID loading and uses a similar table-lookup to Doug's previous Decl patch.

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

13 years agoTemporarily revert r135614 while I fix the cmake build.
Chad Rosier [Wed, 20 Jul 2011 21:16:17 +0000 (21:16 +0000)]
Temporarily revert r135614 while I fix the cmake build.

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

13 years agoRemove extraneous period.
Bill Wendling [Wed, 20 Jul 2011 21:02:28 +0000 (21:02 +0000)]
Remove extraneous period.

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

13 years agoWhen the compiler crashes, the compiler driver now produces diagnostic information
Chad Rosier [Wed, 20 Jul 2011 20:26:32 +0000 (20:26 +0000)]
When the compiler crashes, the compiler driver now produces diagnostic information
including the fully preprocessed source file(s) and command line arguments.  The
developer is asked to attach this diagnostic information to a bug report.

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

13 years agoMatch MCContext change.
Evan Cheng [Wed, 20 Jul 2011 19:53:19 +0000 (19:53 +0000)]
Match MCContext change.

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

13 years agoFix -Wuninitialized regression involving functions invalidating parameters passed...
Ted Kremenek [Wed, 20 Jul 2011 19:49:47 +0000 (19:49 +0000)]
Fix -Wuninitialized regression involving functions invalidating parameters passed by reference.

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

13 years agoWhitespace.
Chad Rosier [Wed, 20 Jul 2011 19:27:01 +0000 (19:27 +0000)]
Whitespace.

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

13 years agoIf -ccc-host-triple i386-pc-win32-macho or -ccc-host-triple
Chad Rosier [Wed, 20 Jul 2011 19:14:30 +0000 (19:14 +0000)]
If -ccc-host-triple i386-pc-win32-macho or -ccc-host-triple
x86_64-pc-win32-macho is used in conjunction with -no-integrated-as go ahead and
use the Darwin system assembler.
rdar://9785470

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

13 years agoarc-objc++: Issue an arc specific diagnostic when overload resolution
Fariborz Jahanian [Wed, 20 Jul 2011 17:14:09 +0000 (17:14 +0000)]
arc-objc++: Issue an arc specific diagnostic when overload resolution
fails because of lifetime differences of parameter and argument type.
// rdar://9790531

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

13 years agotest/CMakeLists.txt: Re-indent.
NAKAMURA Takumi [Wed, 20 Jul 2011 16:35:49 +0000 (16:35 +0000)]
test/CMakeLists.txt: Re-indent.

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

13 years agoUnbreak build after API change.
Benjamin Kramer [Wed, 20 Jul 2011 14:43:06 +0000 (14:43 +0000)]
Unbreak build after API change.

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

13 years agoarrayref should now move in here, and redundant #includes of <cassert> can go
Chris Lattner [Wed, 20 Jul 2011 07:13:40 +0000 (07:13 +0000)]
arrayref should now move in here, and redundant #includes of <cassert> can go
away (since it comes in through Casting.h).  This will have to wait for another
day when I'm unmotivated though, or someone else to pick it up :)

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

13 years agoremove some now-redundant forward declarations.
Chris Lattner [Wed, 20 Jul 2011 07:12:43 +0000 (07:12 +0000)]
remove some now-redundant forward declarations.

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

13 years agoadd raw_ostream and Twine to LLVM.h, eliminating a ton of llvm:: qualifications.
Chris Lattner [Wed, 20 Jul 2011 07:06:53 +0000 (07:06 +0000)]
add raw_ostream and Twine to LLVM.h, eliminating a ton of llvm:: qualifications.

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

13 years agonow that we have a centralized place to do so, add some using declarations for
Chris Lattner [Wed, 20 Jul 2011 06:58:45 +0000 (06:58 +0000)]
now that we have a centralized place to do so, add some using declarations for
some common llvm types: stringref and smallvector.  This cleans up the codebase
quite a bit.

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

13 years agointroduce a centralized place to introduce and inject llvm types into the
Chris Lattner [Wed, 20 Jul 2011 06:37:11 +0000 (06:37 +0000)]
introduce a centralized place to introduce and inject llvm types into the
clang namespace.  There are a number of LLVM types that are used pervasively
and it doesn't make sense to keep qualifying them.  Start with casting
operators.

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

13 years agofix rdar://9780211 - Clang crashes with an assertion failure building WKView.mm from...
Chris Lattner [Wed, 20 Jul 2011 06:29:00 +0000 (06:29 +0000)]
fix rdar://9780211 - Clang crashes with an assertion failure building WKView.mm from WebKit

This is something of a hack, the problem is as follows:

1. we instantiate both copied of RetainPtr with the two different argument types
   (an id and protocol-qualified id).
2. We refer to the ctor of one of the instantiations when introducing global "x",
   this causes us to emit an llvm::Function for a prototype whose "this" has type
   "RetainPtr<id<bork> >*".
3. We refer to the ctor of the other instantiation when introducing global "y",
   however, because it *mangles to the same name as the other ctor* we just use
   a bitcasted version of the llvm::Function we previously emitted.
4. We emit deferred declarations, causing us to emit the body of the ctor, however
   the body we emit is for RetainPtr<id>, which expects its 'this' to have an IR
   type of "RetainPtr<id>*".

Because of the mangling collision, we don't have this case, and explode.

This is really some sort of weird AST invariant violation or something, but hey
a bitcast makes the pain go away.

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

13 years agofix a case where we're using ConvertType for a memory object.
Chris Lattner [Wed, 20 Jul 2011 06:23:59 +0000 (06:23 +0000)]
fix a case where we're using ConvertType for a memory object.
It doesn't matter in practice, but it is good to be tidy.

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

13 years agoMatch LLVM API change.
Evan Cheng [Wed, 20 Jul 2011 06:22:27 +0000 (06:22 +0000)]
Match LLVM API change.

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

13 years agoas eli points out, we're not doing memory stuff here. While ConvertType
Chris Lattner [Wed, 20 Jul 2011 04:59:57 +0000 (04:59 +0000)]
as eli points out, we're not doing memory stuff here.  While ConvertType
and ConvertTypeForMem are the same for pointers, it is best to just
use ConvertType.  Thanks Eli!

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

13 years agofix PR10395 - array decay can produce an interesting type when
Chris Lattner [Wed, 20 Jul 2011 04:31:01 +0000 (04:31 +0000)]
fix PR10395 - array decay can produce an interesting type when
decaying an array of incomplete type (which has type [0 x i8]*) to a
normal pointer (which has incompletetype*).

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

13 years agoUse a ContinuousRangeMap to map from the global macro definition ID in
Douglas Gregor [Wed, 20 Jul 2011 01:29:15 +0000 (01:29 +0000)]
Use a ContinuousRangeMap to map from the global macro definition ID in
the AST reader down to the AST file + local ID, rather than walking
the PCH chain. More cleanup/generalization, although there is more
work to do for preprocessed entities. In particular, the
"preallocation" scheme for preprocessed entities is not going to work
well with late loading of PCH files, and it's likely we'll have to do
something akin to the SourceManager's negative/positive loading.

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

13 years agoUse a ContinuousRangeMap to map from the global selector ID in the AST
Douglas Gregor [Wed, 20 Jul 2011 01:10:58 +0000 (01:10 +0000)]
Use a ContinuousRangeMap to map from the global selector ID in the AST
reader down to the AST file + local ID, rather than walking the PCH
chain. No functionality change; this is generalization and cleanup.

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

13 years agoPR10392: "#pragma GCC visibility" must not expand macros in its
Joerg Sonnenberger [Wed, 20 Jul 2011 01:03:50 +0000 (01:03 +0000)]
PR10392: "#pragma GCC visibility" must not expand macros in its
arguments.

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

13 years agoUse a ContinuousRangeMap to map from the global identifier ID in the
Douglas Gregor [Wed, 20 Jul 2011 00:59:32 +0000 (00:59 +0000)]
Use a ContinuousRangeMap to map from the global identifier ID in the
AST reader down to the AST file + local ID, rather than walking the
PCH chain. No functionality change; this is generalization and cleanup.

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

13 years agoTry to appease MSVC's standard library.
Douglas Gregor [Wed, 20 Jul 2011 00:31:58 +0000 (00:31 +0000)]
Try to appease MSVC's standard library.

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

13 years agoUse a ContinuousRangeMap to map from the global declaration ID in the
Douglas Gregor [Wed, 20 Jul 2011 00:27:43 +0000 (00:27 +0000)]
Use a ContinuousRangeMap to map from the global declaration ID in the
AST reader down to the AST file + local ID within that file, rather
than lamely walking the PCH chain. There's no actual functionality
change now, but this is cleaner and more general.

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

13 years agoSpelling
Joerg Sonnenberger [Wed, 20 Jul 2011 00:14:37 +0000 (00:14 +0000)]
Spelling

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

13 years agoReplace r134583's fix for PR10290 with one which also works for non-value-dependent...
Richard Smith [Wed, 20 Jul 2011 00:12:52 +0000 (00:12 +0000)]
Replace r134583's fix for PR10290 with one which also works for non-value-dependent cases.

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

13 years agoUse the zero from the correct enumeration when initializing this variable.
Richard Smith [Wed, 20 Jul 2011 00:10:13 +0000 (00:10 +0000)]
Use the zero from the correct enumeration when initializing this variable.

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

13 years agoThis fix (thanks to Doug Gregor) corrects a bug
Sean Callanan [Tue, 19 Jul 2011 22:38:25 +0000 (22:38 +0000)]
This fix (thanks to Doug Gregor) corrects a bug
in ImportDefinition when replacing a previously
forward-declared CXXRecordDecl with its full
definition.  The forward-declared type's
DefinitionData had not been intialized for the
forward-declared type, so adding fields to the
Decl caused CXXRecordDecl::addedMember() to
crash when accessing the DefinitionData.

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

13 years agoFix false negative in -Wuninitialized involving a () wrapping an lvalue-to-rvalue...
Ted Kremenek [Tue, 19 Jul 2011 21:41:51 +0000 (21:41 +0000)]
Fix false negative in -Wuninitialized involving a () wrapping an lvalue-to-rvalue conversion in a DeclStmt.

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

13 years agoFix assertion failure in UninitializedValues.cpp where an lvalue to rvalue conversion...
Ted Kremenek [Tue, 19 Jul 2011 20:33:49 +0000 (20:33 +0000)]
Fix assertion failure in UninitializedValues.cpp where an lvalue to rvalue conversion is wrapped in a parenthesis.

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

13 years ago[analyzer] Very minor cleanup in PthreadLockChecker. No functionality change.
Jordy Rose [Tue, 19 Jul 2011 20:31:42 +0000 (20:31 +0000)]
[analyzer] Very minor cleanup in PthreadLockChecker. No functionality change.

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

13 years ago[analysis] Add checks for double-locking and lock order reversal bugs for
Jordy Rose [Tue, 19 Jul 2011 20:21:41 +0000 (20:21 +0000)]
[analysis] Add checks for double-locking and lock order reversal bugs for
pthread and XNU locks. Patch by Rui Paulo!

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

13 years agoRefactor r135502 to avoid an empty if else condition, per Eric's suggestion (good...
Chad Rosier [Tue, 19 Jul 2011 20:00:06 +0000 (20:00 +0000)]
Refactor r135502 to avoid an empty if else condition, per Eric's suggestion (good call!).

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

13 years agoAdd FixItHints in case a C++ function call is missing * or & operators on one/several...
Anna Zaks [Tue, 19 Jul 2011 19:49:12 +0000 (19:49 +0000)]
Add FixItHints in case a C++ function call is missing * or & operators on one/several of it's parameters (addresses http://llvm.org/PR5941).

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

13 years agoClang asserts "Invalid environment!" when using -ccc-host-triple
Chad Rosier [Tue, 19 Jul 2011 19:36:03 +0000 (19:36 +0000)]
Clang asserts "Invalid environment!" when using -ccc-host-triple
arch-pc-win32-macho (e.g., x86_64-pc-win32-macho), which appears to be a false
positive.
rdar://9786307

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

13 years agoUpdate CMake build.
Benjamin Kramer [Tue, 19 Jul 2011 17:26:28 +0000 (17:26 +0000)]
Update CMake build.

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

13 years ago[arcmt] Add some additional driver flags to optionally emit or save the pre-migration...
Argyrios Kyrtzidis [Tue, 19 Jul 2011 17:20:03 +0000 (17:20 +0000)]
[arcmt] Add some additional driver flags to optionally emit or save the pre-migration ARC errors.

-arcmt-migrate-emit-errors : Emits the pre-migration ARC errors but it doesn't affect anything else
-arcmt-migrate-report-output : Writes out the pre-migration ARC errors to the provided plist file

rdar://9791454

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