]> granicus.if.org Git - clang/log
clang
12 years agoAdd support for MIPS' floating ABIs (hard, soft and single) to clang driver.
Akira Hatanaka [Fri, 23 Mar 2012 23:07:09 +0000 (23:07 +0000)]
Add support for MIPS' floating ABIs (hard, soft and single) to clang driver.

Patch by Simon Atanasyan.

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

12 years agoUpdate checker build.
Ted Kremenek [Fri, 23 Mar 2012 07:06:16 +0000 (07:06 +0000)]
Update checker build.

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

12 years agoAvoid applying retain/release effects twice in RetainCountChecker when a function...
Ted Kremenek [Fri, 23 Mar 2012 06:26:56 +0000 (06:26 +0000)]
Avoid applying retain/release effects twice in RetainCountChecker when a function call was inlined (i.e., we do not need to apply summaries in such cases).

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

12 years agoRemove the vestiges of the C backend.
Eric Christopher [Fri, 23 Mar 2012 05:51:52 +0000 (05:51 +0000)]
Remove the vestiges of the C backend.

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

12 years agoSupport for definitions of member enumerations of class templates outside the
Richard Smith [Fri, 23 Mar 2012 03:33:32 +0000 (03:33 +0000)]
Support for definitions of member enumerations of class templates outside the
class template's definition, and for explicit specializations of such enum
members.

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

12 years ago[libclang] For a CXCursor_ObjCInstanceMethodDecl/CXCursor_ObjCClassMethodDecl cursor,
Argyrios Kyrtzidis [Fri, 23 Mar 2012 03:33:19 +0000 (03:33 +0000)]
[libclang] For a CXCursor_ObjCInstanceMethodDecl/CXCursor_ObjCClassMethodDecl cursor,
return from clang_getCursorLocation the start location of the method name.

rdar://11105223

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

12 years agocorrected check::EndOfTranslationUnit checker name and added 'const' to declaration
Anton Yartsev [Fri, 23 Mar 2012 02:43:24 +0000 (02:43 +0000)]
corrected check::EndOfTranslationUnit checker name and added 'const' to declaration

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

12 years ago[CFG] Cache boolean evaluations of expressions to avoid multiple re-evaluations
Argyrios Kyrtzidis [Fri, 23 Mar 2012 00:59:17 +0000 (00:59 +0000)]
[CFG] Cache boolean evaluations of expressions to avoid multiple re-evaluations
during construction of branches for chained logical operators.

This makes -fsyntax-only for test/Sema/many-logical-ops.c about 32x times faster.

With measuring SemaExpr.cpp I see differences below the noise level.

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

12 years agoRemove unused bits.
Rafael Espindola [Fri, 23 Mar 2012 00:05:14 +0000 (00:05 +0000)]
Remove unused bits.

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

12 years agomodern objc translation of block literal expressions
Fariborz Jahanian [Fri, 23 Mar 2012 00:00:49 +0000 (00:00 +0000)]
modern objc translation of block literal expressions
declared at file scope.
// rdar://11006566

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

12 years agoSmall cleanup.
Bill Wendling [Thu, 22 Mar 2012 23:34:01 +0000 (23:34 +0000)]
Small cleanup.

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

12 years agoUse correct FileCheck regexp.
Bill Wendling [Thu, 22 Mar 2012 23:32:07 +0000 (23:32 +0000)]
Use correct FileCheck regexp.

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

12 years agoWhen an MMX output variable is tied to the input variable, we have to implicitly
Bill Wendling [Thu, 22 Mar 2012 23:25:07 +0000 (23:25 +0000)]
When an MMX output variable is tied to the input variable, we have to implicitly
cast the value to x86_mmx. This gives the ASM string the correct call signature.
<rdar://problem/10919182>

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

12 years agoline endings
Matt Beaumont-Gay [Thu, 22 Mar 2012 23:15:04 +0000 (23:15 +0000)]
line endings

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

12 years agoMake sure we correctly set the alignment for vector loads and stores associated with...
Eli Friedman [Thu, 22 Mar 2012 22:36:39 +0000 (22:36 +0000)]
Make sure we correctly set the alignment for vector loads and stores associated with vector element lvalues.  Patch by Kevin Schoedel (with some minor modifications by me).

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

12 years agoFix static analyzer crash on code taking the address of a field. Fixes PR 11146.
Ted Kremenek [Thu, 22 Mar 2012 21:42:31 +0000 (21:42 +0000)]
Fix static analyzer crash on code taking the address of a field.  Fixes PR 11146.

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

12 years ago[analyzer] Add the stat for the number of successfully explored paths.
Anna Zaks [Thu, 22 Mar 2012 21:06:06 +0000 (21:06 +0000)]
[analyzer] Add the stat for the number of successfully explored paths.

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

12 years ago[analyzer] Add stats useful for coverage investigations.
Anna Zaks [Thu, 22 Mar 2012 21:06:03 +0000 (21:06 +0000)]
[analyzer] Add stats useful for coverage investigations.

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

12 years ago[analyzer] Add inlining awareness to the block coverage computation
Anna Zaks [Thu, 22 Mar 2012 21:05:57 +0000 (21:05 +0000)]
[analyzer] Add inlining awareness to the block coverage computation
(Stats Checker).

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

12 years agomodern objc rewriter: until we can translate block literals
Fariborz Jahanian [Thu, 22 Mar 2012 19:54:39 +0000 (19:54 +0000)]
modern objc rewriter: until we can translate block literals
at global scope properly, issue diagnostics.

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

12 years agoFix a comment: kPropertyType = 'T' not 't'. <rdar://problem/11095729>
Bob Wilson [Thu, 22 Mar 2012 17:48:02 +0000 (17:48 +0000)]
Fix a comment: kPropertyType = 'T' not 't'.  <rdar://problem/11095729>

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

12 years agomodern objective-c rewriter: Fix up translation of
Fariborz Jahanian [Thu, 22 Mar 2012 17:39:35 +0000 (17:39 +0000)]
modern objective-c rewriter: Fix up translation of
property attributes. // rdar://11095151

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

12 years ago[PCH] When we are replacing a decl in a chained PCH that is also a DeclContext,
Argyrios Kyrtzidis [Thu, 22 Mar 2012 16:08:04 +0000 (16:08 +0000)]
[PCH] When we are replacing a decl in a chained PCH that is also a DeclContext,
make sure to fully load its external lexical and visible declarations before
re-writing it.

rdar://10914192

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

12 years agoUpdate front page to indicate that we do, in fact, support some of C++11.
Richard Smith [Thu, 22 Mar 2012 08:15:13 +0000 (08:15 +0000)]
Update front page to indicate that we do, in fact, support some of C++11.

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

12 years ago"Teach" RetainCountChecker about dispatch_set_context, which can indirectly free...
Ted Kremenek [Thu, 22 Mar 2012 06:29:41 +0000 (06:29 +0000)]
"Teach" RetainCountChecker about dispatch_set_context, which can indirectly free its argument later.  Fixes <rdar://problem/11059275>.

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

12 years agoRelax the FileCheck assertions in this test a touch. Previously the test
Chandler Carruth [Thu, 22 Mar 2012 06:22:13 +0000 (06:22 +0000)]
Relax the FileCheck assertions in this test a touch. Previously the test
relied on an artifact of how the inliner and subsequent passes in
clang's -O3 mode happen to treat basic blocks and the labels for the
basic blocks. In my work on the inliner, and changed this fundamental
assumption, and the label that was being checked on the entry basic
block will no longer appear in opt builds. There was no reason to expect
the label to always be present anyways, much to my regret.

I've changed the test to just ensure that we return an immediate
constant. If there are intervening instructions, that's bad, but not
really that relevant to the test.

I'd love it if others have a better way of checking that a function body
contains only a 'ret' instruction that isn't dependent on whether or not
the entry block receives a label...

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

12 years agoFix broken CFG when an initializer is a statement expression that starts with a while...
Ted Kremenek [Thu, 22 Mar 2012 05:57:43 +0000 (05:57 +0000)]
Fix broken CFG when an initializer is a statement expression that starts with a while loop (PR 12325).

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

12 years agoDuring the instantiation of a class template specialization, that
Richard Smith [Thu, 22 Mar 2012 03:35:28 +0000 (03:35 +0000)]
During the instantiation of a class template specialization, that
specialization is known to be incomplete. If we're asked to try to
complete it, don't attempt to instantiate it again -- that can lead
to stack overflow, and to rejects-valids if the class being incomplete
is not an error.

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

12 years agoSimplify DataRecursiveIntBinOpEvaluator::VisitBinOp() a bit and make sure we don't
Argyrios Kyrtzidis [Thu, 22 Mar 2012 02:13:06 +0000 (02:13 +0000)]
Simplify DataRecursiveIntBinOpEvaluator::VisitBinOp() a bit and make sure we don't
evaluate RHS if LHS could not be evaluated and keepEvaluatingAfterFailure() is false.

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

12 years ago[analyzer] Malloc: drop symbols captured by blocks.
Anna Zaks [Thu, 22 Mar 2012 00:57:20 +0000 (00:57 +0000)]
[analyzer] Malloc: drop symbols captured by blocks.

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

12 years agomodern objective-c translator: Change declaration of
Fariborz Jahanian [Wed, 21 Mar 2012 23:41:04 +0000 (23:41 +0000)]
modern objective-c translator: Change declaration of
all objc_msgSend unctions to void parameters and void return.
// rdar://11094890

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

12 years agoChange the binary operator data recursive evaluator to not stop at the first
Richard Trieu [Wed, 21 Mar 2012 23:30:30 +0000 (23:30 +0000)]
Change the binary operator data recursive evaluator to not stop at the first
non-constant value encountered.  This allows the evaluator to deduce that
expressions like (x < 5 || true) is equal to true.  Previously, it would visit
x and determined that the entire expression is could not evaluated to a
constant.

This fixes PR12318.

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

12 years agoRemove unused variable, fix indentation.
Benjamin Kramer [Wed, 21 Mar 2012 21:03:48 +0000 (21:03 +0000)]
Remove unused variable, fix indentation.

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

12 years agoFor enums with no tag name, display its location in
Fariborz Jahanian [Wed, 21 Mar 2012 20:56:29 +0000 (20:56 +0000)]
For enums with no tag name, display its location in
the diagnostic instead of displaying ''.
// rdar://11082110

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

12 years agofixes the diagnostic issued in // rdar://11069896
Fariborz Jahanian [Wed, 21 Mar 2012 20:28:39 +0000 (20:28 +0000)]
fixes the diagnostic issued in // rdar://11069896

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

12 years agoReport the natural alignment of unsigned long long, not the preferred alignment.
Chad Rosier [Wed, 21 Mar 2012 20:20:47 +0000 (20:20 +0000)]
Report the natural alignment of unsigned long long, not the preferred alignment.
rdar://11054144

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

12 years agoTry to get cpath.c passing on windows, using lit's new ${pathsep} variable.
Nico Weber [Wed, 21 Mar 2012 19:57:21 +0000 (19:57 +0000)]
Try to get cpath.c passing on windows, using lit's new ${pathsep} variable.

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

12 years ago[analyzer] Malloc: Utter the name of the leaked variable.
Anna Zaks [Wed, 21 Mar 2012 19:45:08 +0000 (19:45 +0000)]
[analyzer] Malloc: Utter the name of the leaked variable.
Specifically, we use the last store of the leaked symbol in the leak diagnostic.
(No support for struct fields since the malloc checker doesn't track those
yet.)

+ Infrastructure to track the regions used in store evaluations.
This approach is more precise than iterating the store to
obtain the region bound to the symbol, which is used in RetainCount
checker. The region corresponds to what is uttered in the code in the
last store and we do not rely on the store implementation to support
this functionality.

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

12 years ago[analyser] Factor out FindUniqueBinding from RetainCount checker.
Anna Zaks [Wed, 21 Mar 2012 19:45:01 +0000 (19:45 +0000)]
[analyser] Factor out FindUniqueBinding from RetainCount checker.

So that others could use it as well. No functionality change.

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

12 years ago[analyzer] Re-enable the test disabled by r152969.
Anna Zaks [Wed, 21 Mar 2012 19:44:57 +0000 (19:44 +0000)]
[analyzer] Re-enable the test disabled by r152969.
(The fix was committed in r152982.)

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

12 years agoDuplicated code is bad. At least make it consistent.
Bob Wilson [Wed, 21 Mar 2012 17:19:12 +0000 (17:19 +0000)]
Duplicated code is bad.  At least make it consistent.

The getARMTargetCPU and getLLVMArchSuffixForARM functions exist in both
Toolchain.cpp and Tools.cpp.  This stuff needs a thorough overhaul.  In the
meantime, this patch at least makes them consistent.  One version had been
converted to use StringSwitch, and the other version had new Cortex M-series
processors added.

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

12 years agoAllow void blocks to return witn a void expression in
Fariborz Jahanian [Wed, 21 Mar 2012 16:45:13 +0000 (16:45 +0000)]
Allow void blocks to return witn a void expression in
c-mode to match behavior with void functions in c. Issue
warning with -pedantic. // rdar://11069896

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

12 years agoFor Darwin, do not let -mcpu override the -arch option. <rdar://11059238>
Bob Wilson [Wed, 21 Mar 2012 16:31:37 +0000 (16:31 +0000)]
For Darwin, do not let -mcpu override the -arch option.  <rdar://11059238>

On Darwin the architecture and the corresponding Mach-O slice is typically
specified with -arch.  If not, it defaults to the current host architecture.
Do not use -mcpu to override the -arch value.  This is only an issue when
people need to use specialized code for a non-default CPU (hopefully guarded
by run-time checks to detect the current processor).  The -mcpu option is
still used for the -target-cpu option to clang, but this patch causes it to
not be used to set the architecture in the target triple.

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

12 years agomodern objective-c rewriter: remove 'const' from
Fariborz Jahanian [Wed, 21 Mar 2012 16:23:16 +0000 (16:23 +0000)]
modern objective-c rewriter: remove 'const' from
pointer field declarations in several meta-data.
// rdar://11079898

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

12 years agoRemoved repeated word (of of).
Patrick Beard [Wed, 21 Mar 2012 16:22:53 +0000 (16:22 +0000)]
Removed repeated word (of of).

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

12 years agoUndo previous patch as I checked more than I intended.
Fariborz Jahanian [Wed, 21 Mar 2012 16:18:21 +0000 (16:18 +0000)]
Undo previous patch as I checked more than I intended.

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

12 years agomodern objective-c rewriter: remove 'const' from
Fariborz Jahanian [Wed, 21 Mar 2012 16:17:22 +0000 (16:17 +0000)]
modern objective-c rewriter: remove 'const' from
pointer field declarations in several meta-data.
// rdar://11079898

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

12 years agoFor the annals of subtle but terrible bugs: fix a longstanding bug
John McCall [Wed, 21 Mar 2012 06:57:19 +0000 (06:57 +0000)]
For the annals of subtle but terrible bugs:  fix a longstanding bug
in vtable layout where virtual methods inherited from virtual bases
could be assigned the same vcall adjustment slot if they shared
a name and parameter signature but differed in their
cv-qualification.  The code was already trying to handle this
case, but unfortunately used the ordinary type qualifiers
(which are always empty here) instead of the method qualifiers.
This seems like something that the API should discourage, but
I don't know how to carry that principle out in this instance.

Eliminate this function's need for an ASTContext while we're at it.

This bug affects the ABI, and fixing it brings us into accord with
the Itanium ABI (and GCC's implementation of it), but, obviously,
technically breaks full compatibility with previous releases of Clang.
Just letting you know.

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

12 years agoclang-interpreter/Makefile: [PR12313] Update USEDLIBS to add clangEdit.
NAKAMURA Takumi [Wed, 21 Mar 2012 06:25:42 +0000 (06:25 +0000)]
clang-interpreter/Makefile: [PR12313] Update USEDLIBS to add clangEdit.

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

12 years agoRewriteModernObjC.cpp: Don't expose temporary std::string with StringRef. (StringRef...
NAKAMURA Takumi [Wed, 21 Mar 2012 03:21:46 +0000 (03:21 +0000)]
RewriteModernObjC.cpp: Don't expose temporary std::string with StringRef. (StringRef)getName() can be used here.

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

12 years agoTest case for rdar://problem/11055105, a bug with the instantiation
John McCall [Wed, 21 Mar 2012 00:45:33 +0000 (00:45 +0000)]
Test case for rdar://problem/11055105, a bug with the instantiation
of references to function template parameters in noexcept clauses when
the instantiation is forced from a point during parsing when a block
is in scope.

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

12 years agoClose the paren.
Fariborz Jahanian [Wed, 21 Mar 2012 00:01:15 +0000 (00:01 +0000)]
Close the paren.
// rdar://11076938

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

12 years agoUpdate comment.
Eric Christopher [Tue, 20 Mar 2012 23:28:32 +0000 (23:28 +0000)]
Update comment.

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

12 years agonumberWithFloat -> numberWithDouble.
Patrick Beard [Tue, 20 Mar 2012 22:24:08 +0000 (22:24 +0000)]
numberWithFloat -> numberWithDouble.

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

12 years agomodern objective-c translator: insert couple of pragmas for optimization.
Fariborz Jahanian [Tue, 20 Mar 2012 22:24:05 +0000 (22:24 +0000)]
modern objective-c translator: insert couple of pragmas for optimization.
// rdar://11079898

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

12 years agoFixed typo.
Patrick Beard [Tue, 20 Mar 2012 21:52:11 +0000 (21:52 +0000)]
Fixed typo.

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

12 years agoAdded summary section for Object Literals and Subscripting, which contains the extern...
Patrick Beard [Tue, 20 Mar 2012 21:51:03 +0000 (21:51 +0000)]
Added summary section for Object Literals and Subscripting, which contains the external link.

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

12 years agomodern objective-c translator: add static function to initialize
Fariborz Jahanian [Tue, 20 Mar 2012 21:41:28 +0000 (21:41 +0000)]
modern objective-c translator: add static function to initialize
the class pointer in the category structure.
// rdar://11076938

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

12 years agoMore careful consideration of C++11 13.3.3.1p4. Fixes PR12257.
Sebastian Redl [Tue, 20 Mar 2012 21:24:14 +0000 (21:24 +0000)]
More careful consideration of C++11 13.3.3.1p4. Fixes PR12257.

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

12 years agoFix the other place where C++98 work for initializer lists was necessary.
Sebastian Redl [Tue, 20 Mar 2012 21:24:03 +0000 (21:24 +0000)]
Fix the other place where C++98 work for initializer lists was necessary.

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

12 years agomore modern objective-c meta-data stuff.
Fariborz Jahanian [Tue, 20 Mar 2012 21:09:58 +0000 (21:09 +0000)]
more modern objective-c meta-data stuff.

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

12 years agoFixed typos.
Patrick Beard [Tue, 20 Mar 2012 21:09:25 +0000 (21:09 +0000)]
Fixed typos.

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

12 years agoLink to Objective-C literals documentation.
Patrick Beard [Tue, 20 Mar 2012 20:51:09 +0000 (20:51 +0000)]
Link to Objective-C literals documentation.

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

12 years agoObjective-C literals documentation.
Patrick Beard [Tue, 20 Mar 2012 20:50:45 +0000 (20:50 +0000)]
Objective-C literals documentation.

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

12 years agoDon't include FixIts with a null replacement range. Fixes <rdar://problem/11040133>.
Ted Kremenek [Tue, 20 Mar 2012 20:49:45 +0000 (20:49 +0000)]
Don't include FixIts with a null replacement range.  Fixes <rdar://problem/11040133>.

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

12 years agoFix a use-after-free in thunk emission. EmitThunk may call RAUW on Init, invalidating...
Benjamin Kramer [Tue, 20 Mar 2012 20:18:13 +0000 (20:18 +0000)]
Fix a use-after-free in thunk emission. EmitThunk may call RAUW on Init, invalidating the pointer.

Fixes PR12284. The test case only triggered under asan/valgrind, but it's better than nothing.

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

12 years agomodern objective-c translator: provide meta-data initialization
Fariborz Jahanian [Tue, 20 Mar 2012 19:54:33 +0000 (19:54 +0000)]
modern objective-c translator: provide meta-data initialization
via functions for certain pointer initialization
fields. // rdar://11076938

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

12 years agoDebug info: Tighten up uses of plain MDNode pointers which don't survive replaceOpera...
Benjamin Kramer [Tue, 20 Mar 2012 19:49:14 +0000 (19:49 +0000)]
Debug info: Tighten up uses of plain MDNode pointers which don't survive replaceOperandWith.

TrackingVH notices when it gets RAUW'd. Fixes PR12305 and PR12315.

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

12 years agomodern objective-c translator: couple of minor
Fariborz Jahanian [Tue, 20 Mar 2012 17:34:50 +0000 (17:34 +0000)]
modern objective-c translator: couple of minor
changes to how meta-data is declared.
// rdar://11076938

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

12 years agoTest commit.
Patrick Beard [Tue, 20 Mar 2012 17:25:17 +0000 (17:25 +0000)]
Test commit.

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

12 years agoobjective-c modern translator: Refactor intername ivar names to
Fariborz Jahanian [Tue, 20 Mar 2012 17:13:39 +0000 (17:13 +0000)]
objective-c modern translator: Refactor intername ivar names to
one place and use it throughout. Also, change ivar name to avoid
name collisions. // rdar://11079366

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

12 years ago[avx] Define the _mm256_loadu2_xxx and _mm256_storeu2_xxx intrinsics.
Chad Rosier [Tue, 20 Mar 2012 16:40:00 +0000 (16:40 +0000)]
[avx] Define the _mm256_loadu2_xxx and _mm256_storeu2_xxx intrinsics.

From the Intel Optimization Reference Manual, Section 11.6.2.  When data cannot
be aligned or alignment is not known, 16-byte memory accesses may provide better
performance.
rdar://11076953

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

12 years agoAdd missing bitcast that was breaking Objective-C++ exception typeinfo (GNUstep runtime).
David Chisnall [Tue, 20 Mar 2012 16:25:52 +0000 (16:25 +0000)]
Add missing bitcast that was breaking Objective-C++ exception typeinfo (GNUstep runtime).

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

12 years agoAdd test case for <rdar://problem/10553686>, which illustrates RetainCount checker...
Ted Kremenek [Tue, 20 Mar 2012 00:10:35 +0000 (00:10 +0000)]
Add test case for <rdar://problem/10553686>, which illustrates RetainCount checker working with inlined C++ template functions.

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

12 years agoFix crash when querying the CFG reported when using the thread safety analysis
Ted Kremenek [Mon, 19 Mar 2012 23:48:41 +0000 (23:48 +0000)]
Fix crash when querying the CFG reported when using the thread safety analysis
on code using multi-dimensional arrays.  Fix by DeLesley Hutchins, and reported in
PR 12271.

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

12 years ago[libclang] Have clang_getCursorExtent() return the range of the main file when
Argyrios Kyrtzidis [Mon, 19 Mar 2012 23:17:58 +0000 (23:17 +0000)]
[libclang] Have clang_getCursorExtent() return the range of the main file when
the passed cursor is the translation unit cursor.

Patch by Clint Caywood!

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

12 years agoremoved unused code in the modern objc rewriter file.
Fariborz Jahanian [Mon, 19 Mar 2012 20:38:08 +0000 (20:38 +0000)]
removed unused code in the modern objc rewriter file.

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

12 years agoLanguageExtensions: Manually word wrap a line to reduce horizontal scrolling.
Benjamin Kramer [Mon, 19 Mar 2012 19:12:30 +0000 (19:12 +0000)]
LanguageExtensions: Manually word wrap a line to reduce horizontal scrolling.

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

12 years agoline endings
Matt Beaumont-Gay [Mon, 19 Mar 2012 18:47:12 +0000 (18:47 +0000)]
line endings

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

12 years agoUse a simpler pluralization construct
Matt Beaumont-Gay [Mon, 19 Mar 2012 18:36:28 +0000 (18:36 +0000)]
Use a simpler pluralization construct

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

12 years agomodern objective-c translator: fix type of objc_exception_throw
Fariborz Jahanian [Mon, 19 Mar 2012 18:11:32 +0000 (18:11 +0000)]
modern objective-c translator: fix type of objc_exception_throw
declaration and its siblings.

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

12 years agotest/Driver/cpath.c: Mark this as XFAIL:mingw32,win32 for now.
NAKAMURA Takumi [Mon, 19 Mar 2012 16:07:58 +0000 (16:07 +0000)]
test/Driver/cpath.c: Mark this as XFAIL:mingw32,win32 for now.

On Win32 hosts, ';' is used for path separator.

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

12 years agoFix a regression where ':' in CPLUS_INCLUDE_PATH and friends would no longer separate...
Nico Weber [Mon, 19 Mar 2012 15:00:03 +0000 (15:00 +0000)]
Fix a regression where ':' in CPLUS_INCLUDE_PATH and friends would no longer separate paths.

This regressed in r152583. Also add a test to make sure it doesn't regress again.

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

12 years agoAdd the missing compatibility warning for braced initializers as default arguments.
Sebastian Redl [Sun, 18 Mar 2012 22:25:45 +0000 (22:25 +0000)]
Add the missing compatibility warning for braced initializers as default arguments.

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

12 years agoAn error can't be in a warning group.
Benjamin Kramer [Sun, 18 Mar 2012 13:01:31 +0000 (13:01 +0000)]
An error can't be in a warning group.

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

12 years ago[analyzer] Mark a failed-realloc's result as an interesting symbol between the reallo...
Jordy Rose [Sun, 18 Mar 2012 07:43:35 +0000 (07:43 +0000)]
[analyzer] Mark a failed-realloc's result as an interesting symbol between the realloc call and the null check, so we get nicer path notes. Fixes a regression introduced by the diagnostic pruning added in r152361.

This is accomplished by calling markInteresting /during/ path diagnostic generation, and as such relies on deterministic ordering of BugReporterVisitors -- namely, that BugReporterVisitors are run in /reverse/ order from how they are added. (Right now that's a consequence of storing visitors in an ImmutableList, where new items are added to the front.) It's a little hacky, but it works for now.

I think this is the best we can do without storing the relation between the old and new symbols, and that would be a hit whether or not there ends up being an error.

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

12 years agoTurns #import in MS Mode into an error.
Aaron Ballman [Sun, 18 Mar 2012 03:10:37 +0000 (03:10 +0000)]
Turns #import in MS Mode into an error.

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

12 years agoUse character literals for vexing initialization fixit hints.
David Blaikie [Sun, 18 Mar 2012 02:56:47 +0000 (02:56 +0000)]
Use character literals for vexing initialization fixit hints.

Instead of suggesting " = 0" for "char c();", suggest " = '\0'", and similarly
for other char types (wide, 16, and 32). Add tests for all these, and since
this means testing such hints under C++0x, add tests for some untested C++0x
hint cases in the existing code, including suggesting nullptr for pointer
initialization.

This sets up the initialization helper to provide better type fidelity that
will be especially helpful for non-assignment cases (such as fixit-correcting
NULL usage in function calls (eg: foo(char) + foo(NULL) => foo('\0') instead
of the less informative foo(0)))

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

12 years ago[analyzer] Use a FoldingSet to cache simple RetainSummary instances, rather than...
Jordy Rose [Sun, 18 Mar 2012 01:26:10 +0000 (01:26 +0000)]
[analyzer] Use a FoldingSet to cache simple RetainSummary instances, rather than explicitly keeping DoNothing and StopTracking summaries and nothing else.

I tried to test the effects of this change on memory usage and run time, but what I saw on retain-release.m was indistinguishable from noise (debug and release builds). Even so, some caveman profiling showed 101 cache hits that we would have generated new summaries for before (i.e. not default or stop summaries), and the more code we analyze, the more memory we should save.

Maybe we should have a standard project for benchmarking the retain count checker's memory and time?

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

12 years agoReplace a FIXME with a diagnostic when we can't resolve the
Douglas Gregor [Sun, 18 Mar 2012 00:15:42 +0000 (00:15 +0000)]
Replace a FIXME with a diagnostic when we can't resolve the
nested-name-specifier for a class template declaration. Fixes PR12291.

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

12 years agoDiagnose tag and class template declarations with qualified
Douglas Gregor [Sat, 17 Mar 2012 23:06:31 +0000 (23:06 +0000)]
Diagnose tag and class template declarations with qualified
declarator-ids that occur at class scope. Fixes PR8019.

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

12 years ago[analyzer] Unify retain-count summary generation for class and instance methods....
Jordy Rose [Sat, 17 Mar 2012 21:13:07 +0000 (21:13 +0000)]
[analyzer] Unify retain-count summary generation for class and instance methods. No functionality change.

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

12 years agoKill cocoa::deriveNamingConvention and cocoa::followsFundamentalRule. They are now...
Jordy Rose [Sat, 17 Mar 2012 20:51:32 +0000 (20:51 +0000)]
Kill cocoa::deriveNamingConvention and cocoa::followsFundamentalRule. They are now just simple wrappers around method families, and method decls can cache method family lookups. Also, no one is using them right now.

The one difference between ObjCMethodDecl::getMethodFamily and Selector::getMethodFamily is that the former will do some additional sanity checking, and since CoreFoundation types don't look like Objective-C objects, an otherwise interesting method will get a method family of OMF_None. Future clients that use method families should consider how they want to handle CF types.

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

12 years ago[analyzer] Remove duplicate work on deriving method behavior. No functionality change.
Jordy Rose [Sat, 17 Mar 2012 19:53:04 +0000 (19:53 +0000)]
[analyzer] Remove duplicate work on deriving method behavior. No functionality change.

The cocoa::deriveNamingConventions helper is just using method families anyway now, and the way RetainSummaryTemplate works means we're allocating an extra summary for every method with a relevant family.

Also, fix RetainSummaryTemplate to do the right thing w/r/t annotating an /existing/ summary. This was probably the real cause of <rdar://problem/10824732> and the fix in r152448.

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

12 years agomodern objective-c rewriter: further improvement in
Fariborz Jahanian [Sat, 17 Mar 2012 17:46:02 +0000 (17:46 +0000)]
modern objective-c rewriter: further improvement in
writing @synchronized statement; do not call locking
expression more than once and support early exits in
@synchronized's statement block (such as return).

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

12 years agoStaticAnalyzer: Fix abuse of StringRef in r152962.
NAKAMURA Takumi [Sat, 17 Mar 2012 13:06:05 +0000 (13:06 +0000)]
StaticAnalyzer: Fix abuse of StringRef in r152962.

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

12 years agoWhen determining the availability of an enum constant, also consider
Douglas Gregor [Sat, 17 Mar 2012 06:39:06 +0000 (06:39 +0000)]
When determining the availability of an enum constant, also consider
the availability of the enumeration type itself. Fixes
<rdar://problem/10996386>.

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

12 years ago[analyzer] Don't claim an object was returned with +1 retain count before counting...
Jordy Rose [Sat, 17 Mar 2012 05:49:15 +0000 (05:49 +0000)]
[analyzer] Don't claim an object was returned with +1 retain count before counting autoreleases. Fixes PR10376.

(Also, 80-column violations.)

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

12 years ago[analyzer] Add test case from PR10794 for using 'new' with Obj-C objects.
Jordy Rose [Sat, 17 Mar 2012 03:53:59 +0000 (03:53 +0000)]
[analyzer] Add test case from PR10794 for using 'new' with Obj-C objects.

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

12 years ago[analyzer] This test is breaking windows bots, make it darwin-specific.
Anna Zaks [Sat, 17 Mar 2012 01:53:32 +0000 (01:53 +0000)]
[analyzer] This test is breaking windows bots, make it darwin-specific.

(The plist output does not match the one we expect, specifically we do
not detect that the interesting symbol is returned by a call.)

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