]> granicus.if.org Git - clang/log
clang
13 years agoRemove warning for null characters in CFString literals. Clang handles them just...
Ted Kremenek [Tue, 15 Mar 2011 21:18:52 +0000 (21:18 +0000)]
Remove warning for null characters in CFString literals.  Clang handles them just fine, and GCC 4.2 doesn't warn here either.

We added this warning back in 2007 when we were comparing against GCC 4.0.

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

13 years agoDon't warn about null characters in Objective-C format string literals.
Ted Kremenek [Tue, 15 Mar 2011 21:18:48 +0000 (21:18 +0000)]
Don't warn about null characters in Objective-C format string literals.

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

13 years agoReorganize the emission of (unfoldable) constant casts a bit, and
John McCall [Tue, 15 Mar 2011 21:17:48 +0000 (21:17 +0000)]
Reorganize the emission of (unfoldable) constant casts a bit, and
make sure that upcasts of member pointer types are covered as constants.
Fixed rdar://problem/9130221

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

13 years agoCreate __has_feature(cxx_noexcept) and mark it as working.
Sebastian Redl [Tue, 15 Mar 2011 21:17:12 +0000 (21:17 +0000)]
Create __has_feature(cxx_noexcept) and mark it as working.
Find out that our C++0x status has only one field for noexcept expression and specification together, and that it was accidentally already marked as fully implemented.
This completes noexcept specification work.

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

13 years agoFix test case.
Sebastian Redl [Tue, 15 Mar 2011 21:15:06 +0000 (21:15 +0000)]
Fix test case.

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

13 years agoExtend the noexcept expression test to test noexcept specification functions.
Sebastian Redl [Tue, 15 Mar 2011 20:45:42 +0000 (20:45 +0000)]
Extend the noexcept expression test to test noexcept specification functions.

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

13 years agoMore robust check for the special C++0x operator new workaround.
Sebastian Redl [Tue, 15 Mar 2011 20:41:09 +0000 (20:41 +0000)]
More robust check for the special C++0x operator new workaround.

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

13 years agoImplement a hack to work around the changing exception specification of operator...
Sebastian Redl [Tue, 15 Mar 2011 19:52:30 +0000 (19:52 +0000)]
Implement a hack to work around the changing exception specification of operator new in C++0x.

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

13 years agoRemove bogus assertion in IdempotentOperationsChecker.
Ted Kremenek [Tue, 15 Mar 2011 19:27:57 +0000 (19:27 +0000)]
Remove bogus assertion in IdempotentOperationsChecker.

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

13 years agoReintroduce r127617: "Code generation for noexcept." with fixes.
Sebastian Redl [Tue, 15 Mar 2011 18:42:48 +0000 (18:42 +0000)]
Reintroduce r127617: "Code generation for noexcept." with fixes.

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

13 years agoDon't poke into redefined 'id' type looking for a property
Fariborz Jahanian [Tue, 15 Mar 2011 17:27:48 +0000 (17:27 +0000)]
Don't poke into redefined 'id' type looking for a property
declaration as this results in a confusing error message,
instead of message related to missing property declaration.
// rdar://9106929

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

13 years agoAppease GCC. I'm surprised Clang accepted this.
Ted Kremenek [Tue, 15 Mar 2011 05:30:12 +0000 (05:30 +0000)]
Appease GCC.  I'm surprised Clang accepted this.

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

13 years agoRemove duplicate group definition that snuck in due to a merge conflict.
Ted Kremenek [Tue, 15 Mar 2011 05:25:02 +0000 (05:25 +0000)]
Remove duplicate group definition that snuck in due to a merge conflict.

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

13 years agoTake 2: merge -Wuninitialized-experimental into -Wuninitialized. Only *must-be-unini...
Ted Kremenek [Tue, 15 Mar 2011 05:22:33 +0000 (05:22 +0000)]
Take 2: merge -Wuninitialized-experimental into -Wuninitialized.  Only *must-be-uninitialized* warnings are reported, with *maybe-uninitialized* under a separate flag.  I await any fallout/comments/feedback, although hopefully this will produce no noise for users.

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

13 years agoSplit warnings from -Wuninitialized-experimental into "must-be-initialized" and ...
Ted Kremenek [Tue, 15 Mar 2011 05:22:28 +0000 (05:22 +0000)]
Split warnings from -Wuninitialized-experimental into "must-be-initialized" and "may-be-initialized" warnings, each controlled by different flags.

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

13 years agoSplit warnings from -Wuninitialized-experimental into "must-be-initialized" and ...
Ted Kremenek [Tue, 15 Mar 2011 04:57:38 +0000 (04:57 +0000)]
Split warnings from -Wuninitialized-experimental into "must-be-initialized" and "may-be-initialized" warnings, each controlled by different flags.

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

13 years agoUninitializedValues: introduce ValueVector:reference class to forward to llvm::BitVec...
Ted Kremenek [Tue, 15 Mar 2011 04:57:32 +0000 (04:57 +0000)]
UninitializedValues: introduce ValueVector:reference class to forward to llvm::BitVector.  No real functionality change, but this is a stepping stone to moving to tri-state logic.

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

13 years agoUninitializedValues: wrap BitVector references in a new class ValueVector. No functi...
Ted Kremenek [Tue, 15 Mar 2011 04:57:29 +0000 (04:57 +0000)]
UninitializedValues: wrap BitVector references in a new class ValueVector.  No functionality change.  This defines the minimum interface that ValueVector needs to support when we no longer base it strictly on a direct interpretation of BitVector.

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

13 years agoSubstitue term "BitVector" with "ValueVector" to prep for further revisions. No...
Ted Kremenek [Tue, 15 Mar 2011 04:57:27 +0000 (04:57 +0000)]
Substitue term "BitVector" with "ValueVector" to prep for further revisions.  No functionality change.

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

13 years agoRename UninitializedValuesV2 to UninitializedValues.
Ted Kremenek [Tue, 15 Mar 2011 03:17:07 +0000 (03:17 +0000)]
Rename UninitializedValuesV2 to UninitializedValues.

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

13 years agoRemove old UninitializedValues analysis.
Ted Kremenek [Tue, 15 Mar 2011 03:17:01 +0000 (03:17 +0000)]
Remove old UninitializedValues analysis.

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

13 years agolib/Basic/Targets.cpp: __declspec(attr) should be provided on mingw as macro, alias...
NAKAMURA Takumi [Tue, 15 Mar 2011 02:32:50 +0000 (02:32 +0000)]
lib/Basic/Targets.cpp: __declspec(attr) should be provided on mingw as macro, alias of __attribute__.

On mingw without -fms-extensions, we can provide "as-is" __declspec.

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

13 years agolib/Headers/mm_malloc.h: On Windows, we can expect _mm_malloc would be provided as...
NAKAMURA Takumi [Tue, 15 Mar 2011 02:32:43 +0000 (02:32 +0000)]
lib/Headers/mm_malloc.h: On Windows, we can expect _mm_malloc would be provided as macro by <malloc.h>.

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

13 years agolib/Frontend/InitHeaderSearch.cpp: Introduce AddMinGW64CXXPaths(Base) for x86_64...
NAKAMURA Takumi [Tue, 15 Mar 2011 02:32:36 +0000 (02:32 +0000)]
lib/Frontend/InitHeaderSearch.cpp: Introduce AddMinGW64CXXPaths(Base) for x86_64-w64-mingw32.

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

13 years agoIntroduce a CharUnits FieldOffsetInChars variable in AppendField() to
Ken Dyck [Tue, 15 Mar 2011 01:09:02 +0000 (01:09 +0000)]
Introduce a CharUnits FieldOffsetInChars variable in AppendField() to
replace some uses of FieldOffsetInBytes. The remaining uses of
FieldOffsetInBytes will be replaced once NextFieldOffsetInBytes is converted
to CharUnits. No change in functionality intended.

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

13 years agoStop leaking file descriptors.
Argyrios Kyrtzidis [Tue, 15 Mar 2011 00:47:44 +0000 (00:47 +0000)]
Stop leaking file descriptors.

After the open+fstat optimization, files were already opened for FileManager::getBufferForFile() and we closed them after reading them.
The problem was that when -working-directory was passed, the code path that actually reuses & closes the already opened file descriptor
was not followed.

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

13 years agoRevert r127617: "Code generation for noexcept."
Jakob Stoklund Olesen [Tue, 15 Mar 2011 00:18:21 +0000 (00:18 +0000)]
Revert r127617: "Code generation for noexcept."

The tests fail in a -Asserts build.

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

13 years agoDisable 'auto' type deduction in Objective-C. It likes 'id' a bit too
Douglas Gregor [Mon, 14 Mar 2011 21:43:30 +0000 (21:43 +0000)]
Disable 'auto' type deduction in Objective-C. It likes 'id' a bit too
much to be useful.

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

13 years agoSort
Joerg Sonnenberger [Mon, 14 Mar 2011 21:20:46 +0000 (21:20 +0000)]
Sort

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

13 years agoWhen synthesizing a label declaration based on a goto statement that
Douglas Gregor [Mon, 14 Mar 2011 21:19:51 +0000 (21:19 +0000)]
When synthesizing a label declaration based on a goto statement that
cannot yet be resolved, be sure to push the new label declaration into
the right place within the identifier chain. Otherwise, name lookup in
C++ gets confused when searching for names that are lexically closer
than the label. Fixes PR9463.

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

13 years agoSwitch from internal to linker_private linkage, it is sufficient to please the new...
Rafael Espindola [Mon, 14 Mar 2011 21:08:19 +0000 (21:08 +0000)]
Switch from internal to linker_private linkage, it is sufficient to please the new linker.

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

13 years agoCode generation for noexcept.
Sebastian Redl [Mon, 14 Mar 2011 20:33:20 +0000 (20:33 +0000)]
Code generation for noexcept.

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

13 years ago__clear_cache() is varargs and people will occasionally write it without
Eric Christopher [Mon, 14 Mar 2011 20:30:34 +0000 (20:30 +0000)]
__clear_cache() is varargs and people will occasionally write it without
arguments. Process only the arguments that people write, but process
all of them.

Fixes rdar://8900346

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

13 years agoTweak VariadicMethodTypeChecker to only create one ExplodedNode when issuing multiple...
Ted Kremenek [Mon, 14 Mar 2011 19:50:37 +0000 (19:50 +0000)]
Tweak VariadicMethodTypeChecker to only create one ExplodedNode when issuing multiple warnings for the same message expression.

Also add a test case showing that we correctly report multiple warnings for the same message expression.

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

13 years agoIncorporate source ranges for RangeBugReport when coelescing reports into equivalence...
Ted Kremenek [Mon, 14 Mar 2011 19:50:34 +0000 (19:50 +0000)]
Incorporate source ranges for RangeBugReport when coelescing reports into equivalence classes.

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

13 years agoImplement instantiation of noexcept spec and add a test case.
Sebastian Redl [Mon, 14 Mar 2011 18:51:50 +0000 (18:51 +0000)]
Implement instantiation of noexcept spec and add a test case.

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

13 years agoAdd another, pretty trivial, exception spec test case.
Sebastian Redl [Mon, 14 Mar 2011 18:51:44 +0000 (18:51 +0000)]
Add another, pretty trivial, exception spec test case.

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

13 years agoMake deallocation functions implicitly noexcept in C++0x.
Sebastian Redl [Mon, 14 Mar 2011 18:08:30 +0000 (18:08 +0000)]
Make deallocation functions implicitly noexcept in C++0x.

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

13 years agoFix link of libxul with LTO and the linker in xcode4. It is not clear if this
Rafael Espindola [Mon, 14 Mar 2011 17:55:00 +0000 (17:55 +0000)]
Fix link of libxul with LTO and the linker in xcode4. It is not clear if this
is working around a bug in ld or if the new linker has a reasonable reason
for wanting the string constant to be linker visible.

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

13 years ago-fwritable-strings should silence warnings about the deprecated string
Douglas Gregor [Mon, 14 Mar 2011 16:13:32 +0000 (16:13 +0000)]
-fwritable-strings should silence warnings about the deprecated string
-literal to char* conversion. Make it so.

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

13 years agoBlock return type of the initialized must be
Fariborz Jahanian [Mon, 14 Mar 2011 16:07:00 +0000 (16:07 +0000)]
Block return type of the initialized must be
be more speciaclized than that of the initializer,
when matching protocol qualifier list.
// rdar:// 9118343.

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

13 years agoSupport Ubuntu hardy and intrepid, from Thomas Gamper!
Douglas Gregor [Mon, 14 Mar 2011 15:39:50 +0000 (15:39 +0000)]
Support Ubuntu hardy and intrepid, from Thomas Gamper!

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

13 years agoAdd include paths for Gentoo Linux, from Marcin Mirosław!
Douglas Gregor [Mon, 14 Mar 2011 15:33:44 +0000 (15:33 +0000)]
Add include paths for Gentoo Linux, from Marcin MirosÅ‚aw!

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

13 years agoFix incorrect linkage specifiers for selectors.
David Chisnall [Mon, 14 Mar 2011 15:01:16 +0000 (15:01 +0000)]
Fix incorrect linkage specifiers for selectors.

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

13 years agoFix LIBCLANG_LINK_FLAGS for Darwin.
Oscar Fuentes [Mon, 14 Mar 2011 14:32:16 +0000 (14:32 +0000)]
Fix LIBCLANG_LINK_FLAGS for Darwin.

The previous syntax created a list with the usual semicolon as
separator, which breaks the link command.

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

13 years agoGet rid of the static FileManager::FixupRelativePath.
Anders Carlsson [Mon, 14 Mar 2011 01:13:54 +0000 (01:13 +0000)]
Get rid of the static FileManager::FixupRelativePath.

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

13 years agoAdd an Objective-C checker that checks that arguments passed to some variadic Objecti...
Anders Carlsson [Sun, 13 Mar 2011 20:35:21 +0000 (20:35 +0000)]
Add an Objective-C checker that checks that arguments passed to some variadic Objective-C methods are of Objective-C pointer types.

Ted or Argiris, I'd appreciate a review!

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

13 years agoChange GetNullarySelector and GetUnarySelector to take a StringRef.
Anders Carlsson [Sun, 13 Mar 2011 20:32:45 +0000 (20:32 +0000)]
Change GetNullarySelector and GetUnarySelector to take a StringRef.

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

13 years agoInstead of storing an ASTContext* in FunctionProtoTypes with computed noexcept specif...
Sebastian Redl [Sun, 13 Mar 2011 17:09:40 +0000 (17:09 +0000)]
Instead of storing an ASTContext* in FunctionProtoTypes with computed noexcept specifiers, unique FunctionProtoTypes with a ContextualFoldingSet, as suggested by John McCall.

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

13 years agoBuild libclang as a static library too. Now tested on Windows!
Oscar Fuentes [Sun, 13 Mar 2011 15:10:24 +0000 (15:10 +0000)]
Build libclang as a static library too. Now tested on Windows!

On Windows only the shared library is created. The reason for this is
that clang.lib the static library would clash with clang.lib the
export library of the dll.

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

13 years agoReverting "Build libclang as a static library too."
Oscar Fuentes [Sun, 13 Mar 2011 04:28:29 +0000 (04:28 +0000)]
Reverting "Build libclang as a static library too."

This reverts commit r127556. It breaks the build for MSVC.

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

13 years agoFix CFG assertion failure reported in PR 9467. This was due to recent changes in...
Ted Kremenek [Sun, 13 Mar 2011 03:48:04 +0000 (03:48 +0000)]
Fix CFG assertion failure reported in PR 9467.  This was due to recent changes in optimizing CFGs for switch statements.

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

13 years agoXFAIL this on windows where <vector> contains surprises.
Jakob Stoklund Olesen [Sun, 13 Mar 2011 00:55:43 +0000 (00:55 +0000)]
XFAIL this on windows where <vector> contains surprises.

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

13 years agoBuild libclang as a static library too.
Oscar Fuentes [Sat, 12 Mar 2011 22:01:58 +0000 (22:01 +0000)]
Build libclang as a static library too.

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

13 years agoPlace duplicate argument declaration in in
Fariborz Jahanian [Sat, 12 Mar 2011 18:54:30 +0000 (18:54 +0000)]
Place duplicate argument declaration in in
method prototypes under the -Wduplicate-method-arg and
turn it off by default.

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

13 years agoRevert "Disable delegating constructors for 2.9"
Sebastian Redl [Sat, 12 Mar 2011 13:53:51 +0000 (13:53 +0000)]
Revert "Disable delegating constructors for 2.9"
It is only meant for the release branch.

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

13 years agoDisable delegating constructors for 2.9
Sebastian Redl [Sat, 12 Mar 2011 13:53:47 +0000 (13:53 +0000)]
Disable delegating constructors for 2.9

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

13 years agoRevert "Disable inherited constructors for 2.9."
Sebastian Redl [Sat, 12 Mar 2011 13:44:32 +0000 (13:44 +0000)]
Revert "Disable inherited constructors for 2.9."
It is only meant for the release branch.

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

13 years agoDisable inherited constructors for 2.9.
Sebastian Redl [Sat, 12 Mar 2011 13:44:23 +0000 (13:44 +0000)]
Disable inherited constructors for 2.9.

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

13 years agoUse CharUnits for argument passed to AppendPadding() from AppendBitField().
Ken Dyck [Sat, 12 Mar 2011 12:03:11 +0000 (12:03 +0000)]
Use CharUnits for argument passed to AppendPadding() from AppendBitField().
No change in functionality intended.

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

13 years agoPropagate the new exception information to FunctionProtoType.
Sebastian Redl [Sat, 12 Mar 2011 11:50:43 +0000 (11:50 +0000)]
Propagate the new exception information to FunctionProtoType.
Change the interface to expose the new information and deal with the enormous fallout.
Introduce the new ExceptionSpecificationType value EST_DynamicNone to more easily deal with empty throw specifications.
Update the tests for noexcept and fix the various bugs uncovered, such as lack of tentative parsing support.

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

13 years agoForgotten part of previous commit.
Abramo Bagnara [Sat, 12 Mar 2011 11:17:06 +0000 (11:17 +0000)]
Forgotten part of previous commit.

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

13 years agoFixed type and declaration source range in presence of typeQuals.
Abramo Bagnara [Sat, 12 Mar 2011 11:02:00 +0000 (11:02 +0000)]
Fixed type and declaration source range in presence of typeQuals.

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

13 years agoRenamed OffsetOfNode::getRange to getSourceRange for uniformity.
Abramo Bagnara [Sat, 12 Mar 2011 09:45:03 +0000 (09:45 +0000)]
Renamed OffsetOfNode::getRange to getSourceRange for uniformity.

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

13 years agoTweak test to hopefully appease FreeBSD buildbot.
Ted Kremenek [Sat, 12 Mar 2011 08:19:43 +0000 (08:19 +0000)]
Tweak test to hopefully appease FreeBSD buildbot.

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

13 years agoRemove stray output file.
Ted Kremenek [Sat, 12 Mar 2011 06:15:01 +0000 (06:15 +0000)]
Remove stray output file.

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

13 years agoRe-enable the IdempotentOperations checker for --analyze, and put it and the DeadStor...
Ted Kremenek [Sat, 12 Mar 2011 06:14:28 +0000 (06:14 +0000)]
Re-enable the IdempotentOperations checker for --analyze, and put it and the DeadStores checker into the "deadcode" group.

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

13 years agoDon't have side-effects (or rather non-trivial computation) in StringSwitch "cases."
Ted Kremenek [Sat, 12 Mar 2011 04:08:07 +0000 (04:08 +0000)]
Don't have side-effects (or rather non-trivial computation) in StringSwitch "cases."

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

13 years agoAdd initial version of "IteratorsChecker", a checker to find misues uses of C++ itera...
Ted Kremenek [Sat, 12 Mar 2011 02:49:15 +0000 (02:49 +0000)]
Add initial version of "IteratorsChecker", a checker to find misues uses of C++ iterators.

This checker was created by Jim Goodnow II, and I migrated it to the
new Checker interface (recent changes by Argiris).

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

13 years agoFix comments, and force auto progagation in VisitAggExpr.
Ted Kremenek [Sat, 12 Mar 2011 02:49:11 +0000 (02:49 +0000)]
Fix comments, and force auto progagation in VisitAggExpr.

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

13 years agostatic analyzer: Handle 'ExprWithCleanups' in ExprEngine by essentially ignoring...
Ted Kremenek [Sat, 12 Mar 2011 02:49:09 +0000 (02:49 +0000)]
static analyzer: Handle 'ExprWithCleanups' in ExprEngine by essentially ignoring them.

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

13 years agoFixes for some more expressions containing function templateids that
Douglas Gregor [Sat, 12 Mar 2011 01:48:56 +0000 (01:48 +0000)]
Fixes for some more expressions containing function templateids that
should be resolvable, from Faisal Vali!

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

13 years agoWhen we're determining whether to complain about a conversion from one
Douglas Gregor [Sat, 12 Mar 2011 00:14:31 +0000 (00:14 +0000)]
When we're determining whether to complain about a conversion from one
enumeration type to another in C, classify enumeration constants as if
they had the type of their enclosing enumeration. Fixes
<rdar://problem/9116337>.

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

13 years agoChange parameter to AppendPadding from bytes to CharUnits. No change in
Ken Dyck [Fri, 11 Mar 2011 23:42:54 +0000 (23:42 +0000)]
Change parameter to AppendPadding from bytes to CharUnits. No change in
functionality intended.

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

13 years agoDon't ask if a depenendent CXXRecordDecl has any dependent bases
Douglas Gregor [Fri, 11 Mar 2011 23:27:41 +0000 (23:27 +0000)]
Don't ask if a depenendent CXXRecordDecl has any dependent bases
unless we already know that it has a definition. Fixes
PR9449/<rdar://problem/9115785>.

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

13 years agoImplement a hack intended to allow Clang to parse libstdc++ 4.5's
Douglas Gregor [Fri, 11 Mar 2011 23:10:44 +0000 (23:10 +0000)]
Implement a hack intended to allow Clang to parse libstdc++ 4.5's
headers, which use C++0x generalized initializer lists. Per PR7069, it
appears that the only use is as the return type of a function, so this
commit enables this extension just in that narrow case. If it's enough
for libstdc++ 4.5, or if it can be trivially extended to work with
libstdc++ 4.5, we'll keep it. Otherwise, or if this breaks anything,
we'll revert and wait for the real feature.

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

13 years agoUse a slightly more semantic interface for emitting call arguments.
John McCall [Fri, 11 Mar 2011 20:59:21 +0000 (20:59 +0000)]
Use a slightly more semantic interface for emitting call arguments.

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

13 years agoOpenCL: if double precision floating point constant encountered
Peter Collingbourne [Fri, 11 Mar 2011 19:24:59 +0000 (19:24 +0000)]
OpenCL: if double precision floating point constant encountered
without cl_khr_fp64, warn and cast to single precision

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

13 years agoAdd support for the OpenCL vec_step operator, by generalising and
Peter Collingbourne [Fri, 11 Mar 2011 19:24:49 +0000 (19:24 +0000)]
Add support for the OpenCL vec_step operator, by generalising and
extending the existing support for sizeof and alignof.  Original
patch by Guy Benyei.

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

13 years agoFix PR9453 by not trying to print a warning about ignored qualifiers
Rafael Espindola [Fri, 11 Mar 2011 04:56:58 +0000 (04:56 +0000)]
Fix PR9453 by not trying to print a warning about ignored qualifiers
in conversion functions.

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

13 years agoWhen comparing a null pointer and something else, always cast the null
John McCall [Fri, 11 Mar 2011 04:25:25 +0000 (04:25 +0000)]
When comparing a null pointer and something else, always cast the null
pointer instead of the other operand.

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

13 years agoConvert the RecordSize parameter of AppendTailPadding() to CharUnits to
Ken Dyck [Fri, 11 Mar 2011 02:17:05 +0000 (02:17 +0000)]
Convert the RecordSize parameter of AppendTailPadding() to CharUnits to
avoid converting to bits and back again. No change in functionality
intended.

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

13 years agoOverload IntExprEvaluator::Success() with a function that takes a CharUnits
Ken Dyck [Fri, 11 Mar 2011 02:13:43 +0000 (02:13 +0000)]
Overload IntExprEvaluator::Success() with a function that takes a CharUnits
parameter to tidy up the places where the expression is a size.

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

13 years agoTweak ccc-analyzer's 'Analyze' function to not mutate the original arguments list.
Ted Kremenek [Thu, 10 Mar 2011 21:10:08 +0000 (21:10 +0000)]
Tweak ccc-analyzer's 'Analyze' function to not mutate the original arguments list.

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

13 years agoProfiling showed that 'CheckImplicitConversions' was very slow because of the call...
Ted Kremenek [Thu, 10 Mar 2011 20:03:42 +0000 (20:03 +0000)]
Profiling showed that 'CheckImplicitConversions' was very slow because of the call to getSpellingLoc().  On 'aes.c'
in the LLVM test suite, this function was consuming 7.4% of -fsyntax-only time.  This change fixes this issue
by delaying the check that the warning would be issued within a system macro by as long as possible.  The
main negative of this change is now the logic for this check is done in multiple places in this function instead
of just in one place up front.

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

13 years agolib/CodeGen/CGCall.cpp: Don't invoke multiple Builder.CreateBitCast() on Builder...
NAKAMURA Takumi [Thu, 10 Mar 2011 14:02:21 +0000 (14:02 +0000)]
lib/CodeGen/CGCall.cpp: Don't invoke multiple Builder.CreateBitCast() on Builder.CreateMemCpy. Or we would see sideeffect incompatibility among gcc and clang.

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

13 years agoAvoid do drop outer template parameter lists on the floor.
Abramo Bagnara [Thu, 10 Mar 2011 13:28:31 +0000 (13:28 +0000)]
Avoid do drop outer template parameter lists on the floor.

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

13 years agoFixed class type generation for MemberPointerType.
Abramo Bagnara [Thu, 10 Mar 2011 10:18:27 +0000 (10:18 +0000)]
Fixed class type generation for MemberPointerType.

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

13 years agoWhen doing reachability analysis for warnings issued under DiagRuntimeBehavior, don...
Ted Kremenek [Thu, 10 Mar 2011 03:50:34 +0000 (03:50 +0000)]
When doing reachability analysis for warnings issued under DiagRuntimeBehavior, don't construct a ParentMap or CFGStmtMap.
Instead, create a small set of Stmt* -> CFGBlock* mappings during CFG construction for only the statements we care about
relating to the diagnostics we want to check for reachability.

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

13 years agoInstead of round up sizes to '8', round them up to the alignment of the char
Ken Dyck [Thu, 10 Mar 2011 02:00:35 +0000 (02:00 +0000)]
Instead of round up sizes to '8', round them up to the alignment of the char
type.

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

13 years agoRound up the non-virtual size to the next char instead of rounding down.
Ken Dyck [Thu, 10 Mar 2011 01:53:59 +0000 (01:53 +0000)]
Round up the non-virtual size to the next char instead of rounding down.

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

13 years agoRequire AddStmtChoice::alwaysAdd() to take a CFGBuilder& and Stmt*. Prep for functio...
Ted Kremenek [Thu, 10 Mar 2011 01:14:11 +0000 (01:14 +0000)]
Require AddStmtChoice::alwaysAdd() to take a CFGBuilder& and Stmt*.  Prep for functionality changes.

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

13 years agoRemove unused 'AddStmtChoice' argument to CFGBuilder::appendStmt().
Ted Kremenek [Thu, 10 Mar 2011 01:14:08 +0000 (01:14 +0000)]
Remove unused 'AddStmtChoice' argument to CFGBuilder::appendStmt().

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

13 years agoRework interaction between AnalysisContext and CFG::BuildOptions to keep a BuildOptio...
Ted Kremenek [Thu, 10 Mar 2011 01:14:05 +0000 (01:14 +0000)]
Rework interaction between AnalysisContext and CFG::BuildOptions to keep a BuildOptions object around instead of keeping a copy of the flags.

Moreover, change AnalysisContext to use an OwningPtr for created analysis objects instead
of directly managing them.

Finally, add a 'forcedBlkExprs' entry to CFG::BuildOptions that will be used by the
CFGBuilder to force specific expressions to be block-level expressions.

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

13 years agoRevert r127206 "Detect attempts to provide a specialization of a function within
Daniel Dunbar [Wed, 9 Mar 2011 23:24:34 +0000 (23:24 +0000)]
Revert r127206 "Detect attempts to provide a specialization of a function within
a...", it appears to cause us to reject various valid codes.

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

13 years agoSilence gcc warnings.
Argyrios Kyrtzidis [Wed, 9 Mar 2011 23:15:22 +0000 (23:15 +0000)]
Silence gcc warnings.

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

13 years agoProperty setter/getter must be looked up in property type's
Fariborz Jahanian [Wed, 9 Mar 2011 22:17:12 +0000 (22:17 +0000)]
Property setter/getter must be looked up in property type's
list of protocols as well. // rdar://9078584

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

13 years agoFix CMake build.
Argyrios Kyrtzidis [Wed, 9 Mar 2011 21:12:34 +0000 (21:12 +0000)]
Fix CMake build.

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

13 years agoLookup selector in protocol list of qualified objc type
Fariborz Jahanian [Wed, 9 Mar 2011 20:18:06 +0000 (20:18 +0000)]
Lookup selector in protocol list of qualified objc type
to avoid a bogus warning. // rdar:// 9072298

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

13 years agoIntroduce '-chain-include' option to specify headers that will be converted to chaine...
Argyrios Kyrtzidis [Wed, 9 Mar 2011 17:21:42 +0000 (17:21 +0000)]
Introduce '-chain-include' option to specify headers that will be converted to chained PCHs in memory
without having to use multiple runs and intermediate files.

Intended for testing & debugging of chained PCH.

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