]> granicus.if.org Git - clang/log
clang
14 years agoKill CK_Unknown and flesh out the documentation for the existing CastKinds.
John McCall [Tue, 16 Nov 2010 05:46:29 +0000 (05:46 +0000)]
Kill CK_Unknown and flesh out the documentation for the existing CastKinds.

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

14 years agoTeach complex compound assignment IR-generation that the RHS of
John McCall [Tue, 16 Nov 2010 05:45:35 +0000 (05:45 +0000)]
Teach complex compound assignment IR-generation that the RHS of
a compound assignment is always already in the computation type.

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

14 years agoKill off the remaining places which generate CK_Unknown casts.
John McCall [Tue, 16 Nov 2010 02:32:08 +0000 (02:32 +0000)]
Kill off the remaining places which generate CK_Unknown casts.

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

14 years agoAdd CXString.cpp and CXString.h
Ted Kremenek [Tue, 16 Nov 2010 02:03:55 +0000 (02:03 +0000)]
Add CXString.cpp and CXString.h

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

14 years agoMove CXString creation/management routines into
Ted Kremenek [Tue, 16 Nov 2010 01:56:27 +0000 (01:56 +0000)]
Move CXString creation/management routines into
their own .cpp file and make the interpretation
of its flags private.

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

14 years agoUpdate checker build.
Ted Kremenek [Tue, 16 Nov 2010 01:56:23 +0000 (01:56 +0000)]
Update checker build.

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

14 years agoAdd an ExternalASTSource hook to complete a type on demand.
John McCall [Tue, 16 Nov 2010 01:44:35 +0000 (01:44 +0000)]
Add an ExternalASTSource hook to complete a type on demand.

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

14 years agoAdd a test for Neon vector mangling
Bob Wilson [Tue, 16 Nov 2010 00:32:31 +0000 (00:32 +0000)]
Add a test for Neon vector mangling

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

14 years agoAdd tests for new Neon vector type attributes.
Bob Wilson [Tue, 16 Nov 2010 00:32:28 +0000 (00:32 +0000)]
Add tests for new Neon vector type attributes.

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

14 years agoUpdate TypePrinter::PrintVector to handle new Neon vector types.
Bob Wilson [Tue, 16 Nov 2010 00:32:26 +0000 (00:32 +0000)]
Update TypePrinter::PrintVector to handle new Neon vector types.

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

14 years agoAdd support for "neon_vector_type" and "neon_polyvector_type" attributes
Bob Wilson [Tue, 16 Nov 2010 00:32:24 +0000 (00:32 +0000)]
Add support for "neon_vector_type" and "neon_polyvector_type" attributes
to create the special Neon vector types.  These are intended to be used in
Clang's version of <arm_neon.h> to define special Neon vector types that will
be mangled according to ARM's ABI.

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

14 years agoASTContext::getVectorType should preserve the vector kind for canonical types.
Bob Wilson [Tue, 16 Nov 2010 00:32:20 +0000 (00:32 +0000)]
ASTContext::getVectorType should preserve the vector kind for canonical types.
This is needed for Neon types when it is most natural to define them in terms
of a typedef.  For example, Neon poly8_t is a typedef for "signed char", and
we want to define polynomial vectors as vectors of that typedef.  Without this
change, the result will be a generic GCC-style vector.  I think this is safe
for other vector types as well, but I would appreciate a review of this.

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

14 years agoChange CXXNameMangler::mangleNeonVectorType to require the vector type to be
Bob Wilson [Tue, 16 Nov 2010 00:32:18 +0000 (00:32 +0000)]
Change CXXNameMangler::mangleNeonVectorType to require the vector type to be
one of the special Neon types.  We'll check for invalid Neon vectors when
they are created, so there's no point in handling them when mangling.

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

14 years agoFix a comment typo.
Bob Wilson [Tue, 16 Nov 2010 00:32:16 +0000 (00:32 +0000)]
Fix a comment typo.

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

14 years agoUse getTypeSize() method.
Bob Wilson [Tue, 16 Nov 2010 00:32:12 +0000 (00:32 +0000)]
Use getTypeSize() method.

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

14 years agoAdd another case to the whitelist of cast kinds that can convert to bool.
John McCall [Tue, 16 Nov 2010 00:12:50 +0000 (00:12 +0000)]
Add another case to the whitelist of cast kinds that can convert to bool.
Fixes PR8608.

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

14 years agoCursorVisitor: cache worklists created for data-recursion to reduce malloc() traffic.
Ted Kremenek [Mon, 15 Nov 2010 23:31:32 +0000 (23:31 +0000)]
CursorVisitor: cache worklists created for data-recursion to reduce malloc() traffic.

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

14 years agoAdd a new expression kind, OpaqueValueExpr, which is useful for
John McCall [Mon, 15 Nov 2010 23:31:06 +0000 (23:31 +0000)]
Add a new expression kind, OpaqueValueExpr, which is useful for
certain internal type-checking procedures as well as for representing
certain implicitly-generated operations.  Uses to follow.

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

14 years agoAdds a README for the Clang static analyzer to document its design and work flow...
Zhanyong Wan [Mon, 15 Nov 2010 23:19:25 +0000 (23:19 +0000)]
Adds a README for the Clang static analyzer to document its design and work flow.  The contents are taken from email notes by kremenek and xuzhongxing.

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

14 years agoUse LLVM_ATTRIBUTE_NOINLINE instead of attribute((noinline)).
Ted Kremenek [Mon, 15 Nov 2010 23:11:54 +0000 (23:11 +0000)]
Use LLVM_ATTRIBUTE_NOINLINE instead of attribute((noinline)).

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

14 years agoTweak libclang's heuristics for building precompiled preambles and
Douglas Gregor [Mon, 15 Nov 2010 23:00:34 +0000 (23:00 +0000)]
Tweak libclang's heuristics for building precompiled preambles and
caching global code-completion results. In particular, don't perform
either operation the first time we parse, but do both after the first
reparse.

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

14 years agoRemove invalid assertion from CFG builder. When building the CFG pieces for a ternar...
Ted Kremenek [Mon, 15 Nov 2010 22:59:22 +0000 (22:59 +0000)]
Remove invalid assertion from CFG builder.  When building the CFG pieces for a ternary '?' expression,
it is possible for the confluence block to only have a single predecessor due to calls to 'noreturn'
functions.  Fixes assertion failure reported in PR 8619.

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

14 years agoCast pointers instead of returning a new value within RunVisitorWorkList().
Ted Kremenek [Mon, 15 Nov 2010 22:23:26 +0000 (22:23 +0000)]
Cast pointers instead of returning a new value within RunVisitorWorkList().

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

14 years agoAnnotate CursorVisitor::VisitDataRecursive() with attribute 'noinline'.
Ted Kremenek [Mon, 15 Nov 2010 22:23:24 +0000 (22:23 +0000)]
Annotate CursorVisitor::VisitDataRecursive() with attribute 'noinline'.
Clang currently uses a ridiculous amount of stack space when inlining
this function, which can lead to premature stack overflows.

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

14 years agoAdd method ParentMap::addStmt().
Ted Kremenek [Mon, 15 Nov 2010 20:54:24 +0000 (20:54 +0000)]
Add method ParentMap::addStmt().

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

14 years agoRelax assertion in SValuator so that we don't crash when analyzing a call via a funct...
Ted Kremenek [Mon, 15 Nov 2010 20:09:42 +0000 (20:09 +0000)]
Relax assertion in SValuator so that we don't crash when analyzing a call via a function pointer that
casts the return value to something completely different.  While we need better reasoning here,
we should definately not crash.

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

14 years agoSome cleanup of block API code.
Fariborz Jahanian [Mon, 15 Nov 2010 19:19:38 +0000 (19:19 +0000)]
Some cleanup of block API code.

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

14 years agoFixes PR8611.
Rafael Espindola [Mon, 15 Nov 2010 18:28:16 +0000 (18:28 +0000)]
Fixes PR8611.
Silence warning about -g not being used during linking. I couldn't find any
change in behavior in gcc liking when given -g. Please open another bug if
I missed something.

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

14 years agoRestore these tests. I think I fixed the problem.
Fariborz Jahanian [Mon, 15 Nov 2010 17:06:17 +0000 (17:06 +0000)]
Restore these tests. I think I fixed the problem.
We shall see.

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

14 years agoImplement C++0x [temp.func.order]p3 (aka DR532) properly. In
Douglas Gregor [Mon, 15 Nov 2010 15:41:16 +0000 (15:41 +0000)]
Implement C++0x [temp.func.order]p3 (aka DR532) properly. In
particular, we only add the implement object parameter type if only
one of the function templates is a non-static member function
template.

Moreover, since this DR differs from existing practice in C++98/03,
this commit implements the existing practice (which ignores the
first parameter of the function template that is not the non-static
member function template) in C++98/03 mode.

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

14 years agoSilence an unused variable warning during release builds by folding the
Chandler Carruth [Mon, 15 Nov 2010 13:54:43 +0000 (13:54 +0000)]
Silence an unused variable warning during release builds by folding the
expression into the assert.

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

14 years agoYes, vector conversions are bitcasts.
John McCall [Mon, 15 Nov 2010 10:08:00 +0000 (10:08 +0000)]
Yes, vector conversions are bitcasts.

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

14 years agoKill CK_Unknown references in the ObjC rewriter. The actual
John McCall [Mon, 15 Nov 2010 09:46:46 +0000 (09:46 +0000)]
Kill CK_Unknown references in the ObjC rewriter.  The actual
choice of cast doesn't matter here, but I've tried to choose
the right one anyway.

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

14 years agoFix a think-o. Fixes PR8606.
Chandler Carruth [Mon, 15 Nov 2010 09:28:23 +0000 (09:28 +0000)]
Fix a think-o. Fixes PR8606.

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

14 years agoAssorted work leading towards the elimination of CK_Unknown.
John McCall [Mon, 15 Nov 2010 09:13:47 +0000 (09:13 +0000)]
Assorted work leading towards the elimination of CK_Unknown.

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

14 years agoAdd driver support for Ubuntu 9.10.
Zhongxing Xu [Mon, 15 Nov 2010 09:01:52 +0000 (09:01 +0000)]
Add driver support for Ubuntu 9.10.

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

14 years agoAdd skeleton for handling other kinds of CFGElements.
Zhongxing Xu [Mon, 15 Nov 2010 08:48:43 +0000 (08:48 +0000)]
Add skeleton for handling other kinds of CFGElements.

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

14 years agoClean up some names and fix the handling of default sysroots on Windows and
Chandler Carruth [Mon, 15 Nov 2010 07:15:26 +0000 (07:15 +0000)]
Clean up some names and fix the handling of default sysroots on Windows and
other platforms where the textual default of '/' isn't the system's root
directory. We should probably still make the textual default platform specific,
but this should avoid the particularly bad problem with the previous state: we
applied a sysroot of '/' to '/usr/local/google' which added
'//usr/local/include' to the windows header search path, a share on another
machine named 'usr'. Oops.

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

14 years agoSwitch the sysroot logic to use the Path interface, resolving a FIXME and
Chandler Carruth [Mon, 15 Nov 2010 00:48:13 +0000 (00:48 +0000)]
Switch the sysroot logic to use the Path interface, resolving a FIXME and
making the code less gross.

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

14 years agoMake sysroot only apply to baked in paths which start with a '/'.
Chandler Carruth [Mon, 15 Nov 2010 00:05:18 +0000 (00:05 +0000)]
Make sysroot only apply to baked in paths which start with a '/'.

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

14 years agoRevert r119045. It was failing on Windows.
Ted Kremenek [Sun, 14 Nov 2010 17:53:34 +0000 (17:53 +0000)]
Revert r119045.  It was failing on Windows.

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

14 years ago"Fix" some unintentional fallout from converting
Ted Kremenek [Sun, 14 Nov 2010 17:47:35 +0000 (17:47 +0000)]
"Fix" some unintentional fallout from converting
the Stmt* visitation in CursorVisitor to be
data-recursive.

Since AnnotationTokensWorker explicitly calls
CursorVisitor::VisitChildren(), it essentially
transforms the data-recursive algorithm in
CursorVisitor back into a non-data recursive one.
This is particularly bad because the data-recursive
algorithm uses more stack space per stack frame,
which can cause us to blow the stack in some cases.

"Fix" this by making the stack that AnnotationTokensWorker
runs in really huge.  The real fix is to modify
AnnotationTokensWorker not to do the explicit
recursive call.

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

14 years agoClean up initialization of LangOptions object by splitting part of it into a parent...
Ted Kremenek [Sun, 14 Nov 2010 17:04:23 +0000 (17:04 +0000)]
Clean up initialization of LangOptions object by splitting part of it into a parent class
'LangOptionsBase' that default initializes all flags to 0.  Now the ctor of LangOptions
only initializes the flags that might be non-zero (significantly simplifying things).

This also appeases Valgrind on Mac OS X, which no longer reports that one of the flags
may be uninitialized.

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

14 years agoRevert r118991.
Zhongxing Xu [Sun, 14 Nov 2010 15:23:50 +0000 (15:23 +0000)]
Revert r118991.

Elidable CXXConstructExpr should inhibit calling destructor for temporary
that is copied, not the one created. This is because eliding copy constructor
means that the object that was to be copied will be constructed directly in
memory the copy would be constructed in.

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

14 years agoAlways emit full loads from volatile complex l-values.
John McCall [Sun, 14 Nov 2010 09:40:28 +0000 (09:40 +0000)]
Always emit full loads from volatile complex l-values.
Return the result of a complex assignment with the original values,
not by performing a load from the l-value;  this is the correct
semantics in C, although not in C++.

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

14 years agoAdd a few more complex-related cast kinds that arise due to arbitrary
John McCall [Sun, 14 Nov 2010 08:17:51 +0000 (08:17 +0000)]
Add a few more complex-related cast kinds that arise due to arbitrary
implicit conversions;  the last batch was specific to promotions.
I think this is the full set we need.  I do think dividing the cast
kinds into floating and integral is probably a good idea.

Annotate a *lot* more C casts with useful cast kinds.

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

14 years agotypo2
Chris Lattner [Sun, 14 Nov 2010 07:30:46 +0000 (07:30 +0000)]
typo2

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

14 years agofix typo
Chris Lattner [Sun, 14 Nov 2010 07:09:32 +0000 (07:09 +0000)]
fix typo

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

14 years agoCursorVisitor: make data-recursion algorithm the default except for the few remaining...
Ted Kremenek [Sun, 14 Nov 2010 05:45:47 +0000 (05:45 +0000)]
CursorVisitor: make data-recursion algorithm the default except for the few remaining Exprs still
covered by the normal recursive visitation.

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

14 years agoRemove stale #include.
Ted Kremenek [Sun, 14 Nov 2010 05:28:43 +0000 (05:28 +0000)]
Remove stale #include.

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

14 years agoRemoved unnecessary initialization of a flag which
Fariborz Jahanian [Sun, 14 Nov 2010 05:25:15 +0000 (05:25 +0000)]
Removed unnecessary initialization of a flag which
somehow got several block tests fail with a linux built
compiler.

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

14 years agoMakefile: Follow r118918, to add configuration "ENABLE_DOCS".
NAKAMURA Takumi [Sun, 14 Nov 2010 03:29:27 +0000 (03:29 +0000)]
Makefile: Follow r118918, to add configuration "ENABLE_DOCS".

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

14 years agotest/CodeGenCXX/dyncast.cpp: Remove XFAIL:win32 with tweaking llvm/utils/FileCheck...
NAKAMURA Takumi [Sun, 14 Nov 2010 03:29:22 +0000 (03:29 +0000)]
test/CodeGenCXX/dyncast.cpp: Remove XFAIL:win32 with tweaking llvm/utils/FileCheck in r119023, due to DOSish crlf issue.

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

14 years agoInitialize couple of fields.
Fariborz Jahanian [Sat, 13 Nov 2010 23:48:30 +0000 (23:48 +0000)]
Initialize couple of fields.

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

14 years agoRemoving these test till redo them so they won't depend
Fariborz Jahanian [Sat, 13 Nov 2010 23:04:46 +0000 (23:04 +0000)]
Removing these test till redo them so they won't depend
on the built compiler.

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

14 years agoBlock API patch to do copy ctor of copied-in cxx objects in
Fariborz Jahanian [Sat, 13 Nov 2010 21:53:34 +0000 (21:53 +0000)]
Block API patch to do copy ctor of copied-in cxx objects in
copy helper function and dtor of copied cxx objects
in dispose helper functions. __block variables
TBD next.

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

14 years agoWhen complaining about ambiguous overload resolution for a unary or
Douglas Gregor [Sat, 13 Nov 2010 20:06:38 +0000 (20:06 +0000)]
When complaining about ambiguous overload resolution for a unary or
binary operator, provide the types.

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

14 years agoWhen we're type-checking the result of calling a conversion function
Douglas Gregor [Sat, 13 Nov 2010 19:36:57 +0000 (19:36 +0000)]
When we're type-checking the result of calling a conversion function
(while computing user conversion sequences), make sure that a result
of class type is a complete class type. Had we gone through
ActOnCallExpr, this would have happened when we built the CallExpr.

Fixes PR8425.

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

14 years agoDriver: Support -Oz as an alias for -Os.
Daniel Dunbar [Sat, 13 Nov 2010 18:17:11 +0000 (18:17 +0000)]
Driver: Support -Oz as an alias for -Os.

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

14 years agoSwitch to using %clang_cc1 properly rather than manually passing the -cc1 flag.
Chandler Carruth [Sat, 13 Nov 2010 10:19:35 +0000 (10:19 +0000)]
Switch to using %clang_cc1 properly rather than manually passing the -cc1 flag.

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

14 years agoIntroduce five new cast kinds for various conversions into and
John McCall [Sat, 13 Nov 2010 09:02:35 +0000 (09:02 +0000)]
Introduce five new cast kinds for various conversions into and
between complex types.

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

14 years agoBring UsualArithmeticConversionsType back into Sema and cast the
John McCall [Sat, 13 Nov 2010 08:17:45 +0000 (08:17 +0000)]
Bring UsualArithmeticConversionsType back into Sema and cast the
operands appropriately.  There are a lot of missing complex-related
cast kinds.

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

14 years agoDo not add implicit dtors for CXXBindTemporaryExpr with elidable
Zhongxing Xu [Sat, 13 Nov 2010 07:30:59 +0000 (07:30 +0000)]
Do not add implicit dtors for CXXBindTemporaryExpr with elidable
CXXConstructExpr.

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

14 years agoRewrite reverse iteration loop in a more natural countdown manner.
Ted Kremenek [Sat, 13 Nov 2010 05:55:56 +0000 (05:55 +0000)]
Rewrite reverse iteration loop in a more natural countdown manner.

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

14 years agoCursorVisitor: migrate CXXNewExpr and CXXDefaultArgExpr over to data-recursive algorithm.
Ted Kremenek [Sat, 13 Nov 2010 05:55:53 +0000 (05:55 +0000)]
CursorVisitor: migrate CXXNewExpr and CXXDefaultArgExpr over to data-recursive algorithm.

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

14 years agoPre-compute all possible usual-arithmetic-conversions results for the
John McCall [Sat, 13 Nov 2010 05:51:15 +0000 (05:51 +0000)]
Pre-compute all possible usual-arithmetic-conversions results for the
promoted arithmetic types for which builtin operator candidates are
emitted.  A few of these need further analysis.

Removes all the uses of UsualArithmeticConversionsType except the
core function in SemaExpr.cpp.

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

14 years agoCursorVisitor: special-case CompoundStmt in data-recursion algorithm so we don't...
Ted Kremenek [Sat, 13 Nov 2010 05:38:03 +0000 (05:38 +0000)]
CursorVisitor: special-case CompoundStmt in data-recursion algorithm so we don't have to enqueue
its children and then reverse them.

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

14 years agoRefine IdempotentOperationChecker::PathWasCompletelyAnalyzed() to also check
Ted Kremenek [Sat, 13 Nov 2010 05:12:26 +0000 (05:12 +0000)]
Refine IdempotentOperationChecker::PathWasCompletelyAnalyzed() to also check
BlockEdges, BlockEntrances, and BlockExits for the target block value.

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

14 years agoTeach IdempotentOperations::PathWasCompletelyAnalyzed to also consider items remainin...
Ted Kremenek [Sat, 13 Nov 2010 05:04:52 +0000 (05:04 +0000)]
Teach IdempotentOperations::PathWasCompletelyAnalyzed to also consider items remaining in the
worklist that could have impacted the evaluation of a block.

Fixes <rdar://problem/8663596>.

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

14 years agoAdd GRWorkList::VisitItemsInWorkList() to allow a client to introspect the contents...
Ted Kremenek [Sat, 13 Nov 2010 05:04:49 +0000 (05:04 +0000)]
Add GRWorkList::VisitItemsInWorkList() to allow a client to introspect the contents of a worklist.
This API required changing the BFS worklist to use a deque instead of a queue, but that is better
for performance reasons anyway.

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

14 years agoStore the list of arithmetic types as a static array of member pointers
John McCall [Sat, 13 Nov 2010 02:01:09 +0000 (02:01 +0000)]
Store the list of arithmetic types as a static array of member pointers
instead of copying them all out at the start.  Not a significant
optimization.

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

14 years agoIntroduce a null-to-pointer implicit cast kind.
John McCall [Sat, 13 Nov 2010 01:35:44 +0000 (01:35 +0000)]
Introduce a null-to-pointer implicit cast kind.

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

14 years agoCursorVisitor: Migrate BlockExpr, CXXTemporaryOBjectExpr, and ObjCEncodeExpr to data...
Ted Kremenek [Sat, 13 Nov 2010 01:09:29 +0000 (01:09 +0000)]
CursorVisitor: Migrate BlockExpr, CXXTemporaryOBjectExpr, and ObjCEncodeExpr to data-recursive algorithm.

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

14 years agoCursorVisitor: Migrate DeclRefExpr over to data-recursion algorithm.
Ted Kremenek [Sat, 13 Nov 2010 00:58:18 +0000 (00:58 +0000)]
CursorVisitor: Migrate DeclRefExpr over to data-recursion algorithm.

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

14 years agoCursorVisitor: migrate GotoStmt to data-recursive algorithm.
Ted Kremenek [Sat, 13 Nov 2010 00:58:15 +0000 (00:58 +0000)]
CursorVisitor: migrate GotoStmt to data-recursive algorithm.

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

14 years agoCursorVisitor: migrate DeclStmt over to data-recursive algorithm.
Ted Kremenek [Sat, 13 Nov 2010 00:36:50 +0000 (00:36 +0000)]
CursorVisitor: migrate DeclStmt over to data-recursive algorithm.

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

14 years agoCursorVisitor: Convert logic for populating data-recursion worklist from a switch...
Ted Kremenek [Sat, 13 Nov 2010 00:36:47 +0000 (00:36 +0000)]
CursorVisitor: Convert logic for populating data-recursion worklist from a switch statement to a StmtVisitor.  No functionality change.

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

14 years agoUse dyn_cast result instead of re-casting. Fixes -Werror build with:
Nick Lewycky [Fri, 12 Nov 2010 23:52:43 +0000 (23:52 +0000)]
Use dyn_cast result instead of re-casting. Fixes -Werror build with:
/llvm/tools/clang/tools/libclang/CIndex.cpp:1823: error: unused variable 'E' [-Wunused-variable]

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

14 years agoImplement C++ [over.match.funcs]p4 as it concerns partial ordering of
Douglas Gregor [Fri, 12 Nov 2010 23:44:13 +0000 (23:44 +0000)]
Implement C++ [over.match.funcs]p4 as it concerns partial ordering of
function templates. Fixes PR8130.

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

14 years agoCursorVisitor: Pull ObjCMessageExpr and explicit casts into data-recursion algorithm.
Ted Kremenek [Fri, 12 Nov 2010 22:24:57 +0000 (22:24 +0000)]
CursorVisitor: Pull ObjCMessageExpr and explicit casts into data-recursion algorithm.

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

14 years agoCursorVisitor: migrate ObjCMessageExpr over to data-recursion algorithm.
Ted Kremenek [Fri, 12 Nov 2010 22:24:55 +0000 (22:24 +0000)]
CursorVisitor: migrate ObjCMessageExpr over to data-recursion algorithm.

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

14 years agoCursorVisitor: migrate UnresolvedMemberExpr and UnresolvedLookupExpr over to data...
Ted Kremenek [Fri, 12 Nov 2010 21:34:16 +0000 (21:34 +0000)]
CursorVisitor: migrate UnresolvedMemberExpr and UnresolvedLookupExpr over to data-recursion algorithm.

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

14 years agoCursorVisitor: migrate CompoundLiteralExpr over to data-recursion algorithm.
Ted Kremenek [Fri, 12 Nov 2010 21:34:12 +0000 (21:34 +0000)]
CursorVisitor: migrate CompoundLiteralExpr over to data-recursion algorithm.

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

14 years agoCursorVisitor: add data-recursion support for InitListExprs.
Ted Kremenek [Fri, 12 Nov 2010 21:34:09 +0000 (21:34 +0000)]
CursorVisitor: add data-recursion support for InitListExprs.

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

14 years agoReduce string thrashing.
Benjamin Kramer [Fri, 12 Nov 2010 18:45:23 +0000 (18:45 +0000)]
Reduce string thrashing.

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

14 years agoCursorVisitor: migrate 'DoStmt', 'ForStmt', and 'WhileStmt' over to data-recursion...
Ted Kremenek [Fri, 12 Nov 2010 18:27:04 +0000 (18:27 +0000)]
CursorVisitor: migrate 'DoStmt', 'ForStmt', and 'WhileStmt' over to data-recursion algorithm.

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

14 years agoCursorVisitor: use 'WLAddStmt' and 'WLAddDecl' for adding to data-recursion worklist.
Ted Kremenek [Fri, 12 Nov 2010 18:27:01 +0000 (18:27 +0000)]
CursorVisitor: use 'WLAddStmt' and 'WLAddDecl' for adding to data-recursion worklist.

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

14 years agoCursorVisitor: migrate 'IfStmt' over to data-recursive algorithm.
Ted Kremenek [Fri, 12 Nov 2010 18:26:58 +0000 (18:26 +0000)]
CursorVisitor: migrate 'IfStmt' over to data-recursive algorithm.

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

14 years agoCursorVisitor: migrate handling of SwitchStmt and CaseStmt over to general data-recur...
Ted Kremenek [Fri, 12 Nov 2010 18:26:56 +0000 (18:26 +0000)]
CursorVisitor: migrate handling of SwitchStmt and CaseStmt over to general data-recursion algorithm.

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

14 years agoGeneralize ASTContext::areCompatibleVectorTypes to handle new Neon vector types.
Bob Wilson [Fri, 12 Nov 2010 17:24:54 +0000 (17:24 +0000)]
Generalize ASTContext::areCompatibleVectorTypes to handle new Neon vector types.

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

14 years agoIncrease VectorTypeBitfields::VecKind field from 2 to 3 bits.
Bob Wilson [Fri, 12 Nov 2010 17:24:52 +0000 (17:24 +0000)]
Increase VectorTypeBitfields::VecKind field from 2 to 3 bits.
With the addition of 2 enum values for Neon vectors, this field must now
hold 6 different values and so requires 3 bits.  Make the NumElements field
one bit smaller to compensate.

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

14 years agoUse ASTContext::getTypeInfo to find the vector element size.
Bob Wilson [Fri, 12 Nov 2010 17:24:49 +0000 (17:24 +0000)]
Use ASTContext::getTypeInfo to find the vector element size.

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

14 years agoAdd a separate NeonPolyVector kind to distinguish polynomial vector types.
Bob Wilson [Fri, 12 Nov 2010 17:24:46 +0000 (17:24 +0000)]
Add a separate NeonPolyVector kind to distinguish polynomial vector types.
Add support for mangling those types according to ARM's ABI.

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

14 years agoAdd special-case mangling for Neon vector types.
Bob Wilson [Fri, 12 Nov 2010 17:24:43 +0000 (17:24 +0000)]
Add special-case mangling for Neon vector types.

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

14 years agoUse a twine.
Benjamin Kramer [Fri, 12 Nov 2010 15:42:18 +0000 (15:42 +0000)]
Use a twine.

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

14 years agoReplace one hack with a different hack: strip out the ObjectType
John McCall [Fri, 12 Nov 2010 08:19:04 +0000 (08:19 +0000)]
Replace one hack with a different hack:  strip out the ObjectType
parameters to the Transform*Type functions and instead call out
the specific cases where an object type and the unqualified lookup
results are important.  Fixes an assert and failed compile on
a testcase from PR7248.

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

14 years agoAPI enhancements to TypeLocBuilder.
John McCall [Fri, 12 Nov 2010 07:35:56 +0000 (07:35 +0000)]
API enhancements to TypeLocBuilder.

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

14 years agoMake sure to always check the result of
Douglas Gregor [Fri, 12 Nov 2010 07:15:47 +0000 (07:15 +0000)]
Make sure to always check the result of
SourceManager::getPresumedLoc(), so that we don't try to make use of
an invalid presumed location. Doing so can cause crashes.

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

14 years agoFix use of an uninitialized SourceLocation because DeclarationNameLoc failed to compl...
Ted Kremenek [Fri, 12 Nov 2010 04:25:07 +0000 (04:25 +0000)]
Fix use of an uninitialized SourceLocation because DeclarationNameLoc failed to completely zero-initialize itself.
Now we explicitly memset all of its values.

This bug was uncovered by the 'Index/recursive-cxx-member-calls.cpp', which exhibited an assertion
on an i386 darwin build of clang.  Adding this test case back since the assertion is now resolved.

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

14 years agoWhen performing initialization of a copy of a temporary object, use
Douglas Gregor [Fri, 12 Nov 2010 03:34:06 +0000 (03:34 +0000)]
When performing initialization of a copy of a temporary object, use
direct-initialization (rather than copy-initialization) to initialize
the temporary, allowing explicit constructors. Fixes PR8342.

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