]> granicus.if.org Git - clang/log
clang
12 years agoWhen diagnosing an invalid out-of-line redeclaration, don't permit
Douglas Gregor [Mon, 26 Mar 2012 16:54:18 +0000 (16:54 +0000)]
When diagnosing an invalid out-of-line redeclaration, don't permit
typo correction to introduce a nested-name-specifier; we aren't
prepared to handle it here. Fixes PR12297 / <rdar://problem/11075219>.

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

12 years agoobjective-c modern translator: extern "C" exported
Fariborz Jahanian [Mon, 26 Mar 2012 16:29:49 +0000 (16:29 +0000)]
objective-c modern translator: extern "C" exported
symbols. // rdar://11103982

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

12 years agoCanonicalize the declaration we write to a PCH file for an
Douglas Gregor [Mon, 26 Mar 2012 15:52:37 +0000 (15:52 +0000)]
Canonicalize the declaration we write to a PCH file for an
InjectedClassNameType; otherwise, it won't be properly wired to the
original (canonical) declaration when it is deserialized. Fixes
<rdar://problem/11112464>.

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

12 years agoDriver: Factor string vector push_back into a helper class and optimize it.
Benjamin Kramer [Mon, 26 Mar 2012 15:39:31 +0000 (15:39 +0000)]
Driver: Factor string vector push_back into a helper class and optimize it.

Due to lack of move semantics we would create a temporary std::string from the
string literal, copy it into the vector and discard the temporary. This leads
to massive code bloat, optimizing it saves 50k on i386-linux-Release+Asserts.

While there add a two-element overload for push_back, simplifying code a bit.

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

12 years agoThreadSafetyReporter: Manage diagnostics in a std::list.
Benjamin Kramer [Mon, 26 Mar 2012 14:05:40 +0000 (14:05 +0000)]
ThreadSafetyReporter: Manage diagnostics in a std::list.

std::list is expensive, but so is std::sorting a SmallVector of SmallVectors of
heavyweight PartialDiagnostics.

Saves ~30k in a i386-linux-Release+Asserts clang build.

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

12 years agoHandle instantiations of redeclarations of forward-declared enumerations within
Richard Smith [Mon, 26 Mar 2012 04:58:10 +0000 (04:58 +0000)]
Handle instantiations of redeclarations of forward-declared enumerations within
templated functions. Build a redeclaration chain, and only instantiate the
definition of the enum when visiting the defining declaration.

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

12 years agoDelay checking of dependent underlying types for redeclarations of member
Richard Smith [Mon, 26 Mar 2012 04:08:46 +0000 (04:08 +0000)]
Delay checking of dependent underlying types for redeclarations of member
enumerations in templates until the template is instantiated.

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

12 years agoSince this change is generating a considerable amount of discussion (and possibly...
Aaron Ballman [Sun, 25 Mar 2012 22:46:17 +0000 (22:46 +0000)]
Since this change is generating a considerable amount of discussion (and possibly even a regression for known bad versions), I'm reverting it.

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

12 years agoNo longer hard coding paths to the MinGW include directories; using a regular express...
Aaron Ballman [Sun, 25 Mar 2012 15:47:41 +0000 (15:47 +0000)]
No longer hard coding paths to the MinGW include directories; using a regular expression instead.

Patch thanks to Nikola Smiljanic

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

12 years agoclang/lib/Analysis/CFG.cpp: Get rid of early insertion of placeholder to the map.
NAKAMURA Takumi [Sun, 25 Mar 2012 06:30:37 +0000 (06:30 +0000)]
clang/lib/Analysis/CFG.cpp: Get rid of early insertion of placeholder to the map.

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

12 years agoclang/lib/Analysis/CFG.cpp: Fix memory leak since r153297.
NAKAMURA Takumi [Sun, 25 Mar 2012 06:30:32 +0000 (06:30 +0000)]
clang/lib/Analysis/CFG.cpp: Fix memory leak since r153297.

evaluateAsBooleanConditionNoCache(S) might update the map and invalidate the iterator.

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

12 years agotest/Driver/cpath.c: Escape a few args that contain %{pathsep}.
NAKAMURA Takumi [Sun, 25 Mar 2012 03:42:26 +0000 (03:42 +0000)]
test/Driver/cpath.c: Escape a few args that contain %{pathsep}.

On msys bash, with %pathsep==os.pathsep==';', I can see lines like below in this script;

    env DIR=X:/foo%{pathsep}X:/bar

Then it is expanded to;

    env DIR=X:/foo;X:/bar

It should be with quote;

    env "DIR=X:/foo;X:/bar"

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

12 years agoSimplify some users of DenseMap::erase.
Benjamin Kramer [Sat, 24 Mar 2012 18:22:12 +0000 (18:22 +0000)]
Simplify some users of DenseMap::erase.

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

12 years agoremove declaration of _objc_empty_vtable no longer
Fariborz Jahanian [Sat, 24 Mar 2012 16:57:13 +0000 (16:57 +0000)]
remove declaration of _objc_empty_vtable no longer
used in modern objc translator. // rdar://11105680

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

12 years agoFix copy and pasto.
Rafael Espindola [Sat, 24 Mar 2012 16:57:10 +0000 (16:57 +0000)]
Fix copy and pasto.

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

12 years agomoderin objc translator: remove 'const' from remaining
Fariborz Jahanian [Sat, 24 Mar 2012 16:53:16 +0000 (16:53 +0000)]
moderin objc translator: remove 'const' from remaining
fields in _class_ro_t metadata. //  rdar://11079898

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

12 years agoAdd back r153360 with a fix for enums that cover all the 32 bit values.
Rafael Espindola [Sat, 24 Mar 2012 16:50:34 +0000 (16:50 +0000)]
Add back r153360 with a fix for enums that cover all the 32 bit values.
Thanks to NAKAMURA Takumi for finding it!

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

12 years agoRevert r153360 (and r153380), "Second part of PR12251. Produce the range metadata...
NAKAMURA Takumi [Sat, 24 Mar 2012 14:43:42 +0000 (14:43 +0000)]
Revert r153360 (and r153380), "Second part of PR12251. Produce the range metadata in clang for booleans and".

For i686 targets (eg. cygwin), I saw "Range must not be empty!" in verifier.

It produces (i32)[0x80000000:0x80000000) from (uint64_t)[0xFFFFFFFF80000000ULL:0x0000000080000000ULL), for signed i32 on MDNode::Range.

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

12 years agoDon't cast away constness.
Benjamin Kramer [Sat, 24 Mar 2012 13:59:42 +0000 (13:59 +0000)]
Don't cast away constness.

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

12 years agoOn i386 the alignment of i64 is 4, not 8.
Benjamin Kramer [Sat, 24 Mar 2012 13:22:50 +0000 (13:22 +0000)]
On i386 the alignment of i64 is 4, not 8.

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

12 years ago[analyzer] Tighten up the realloc() failure path note generation...make sure we get...
Jordy Rose [Sat, 24 Mar 2012 03:15:09 +0000 (03:15 +0000)]
[analyzer] Tighten up the realloc() failure path note generation...make sure we get the right realloc()!

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

12 years ago[analyzer] Restart path diagnostic generation if any of the visitors change the repor...
Jordy Rose [Sat, 24 Mar 2012 03:03:29 +0000 (03:03 +0000)]
[analyzer] Restart path diagnostic generation if any of the visitors change the report configuration while walking the path.

This required adding a change count token to BugReport, but also allowed us to ditch ImmutableList as the BugReporterVisitor data type.

Also, remove the hack from MallocChecker, now that visitors appear in the opposite order. This is not exactly a fix, but the common case -- custom diagnostics after generic ones -- is now the default behavior.

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

12 years ago[analyzer] Add a clone() method to BugReporterVisitor, so that we'll be able to reset...
Jordy Rose [Sat, 24 Mar 2012 02:45:35 +0000 (02:45 +0000)]
[analyzer] Add a clone() method to BugReporterVisitor, so that we'll be able to reset diagnostic generation.

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

12 years ago[parser] If there are unmatched braces in a function definition, try to
Argyrios Kyrtzidis [Sat, 24 Mar 2012 02:26:51 +0000 (02:26 +0000)]
[parser] If there are unmatched braces in a function definition, try to
recover by returning the statements that we parsed so far, instead of
dropping the whole function body.

rdar://10967343

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

12 years agoSecond part of PR12251. Produce the range metadata in clang for booleans and
Rafael Espindola [Sat, 24 Mar 2012 00:28:06 +0000 (00:28 +0000)]
Second part of PR12251. Produce the range metadata in clang for booleans and
c++ enums.

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

12 years agoTeach APValue printer to print boolean 0 and 1 as 'false' and 'true'. Fix up
Richard Smith [Fri, 23 Mar 2012 23:55:39 +0000 (23:55 +0000)]
Teach APValue printer to print boolean 0 and 1 as 'false' and 'true'. Fix up
some calling code to actually pass in a non-null type, to avoid a crash.

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

12 years agouse EP_OptimizerLast instead of EP_ScalarOptimizerLate for ThreadSanitizer
Kostya Serebryany [Fri, 23 Mar 2012 23:25:23 +0000 (23:25 +0000)]
use EP_OptimizerLast instead of EP_ScalarOptimizerLate for ThreadSanitizer

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

12 years agoMake sure we don't accept an @interface inside another objc container
Argyrios Kyrtzidis [Fri, 23 Mar 2012 23:24:23 +0000 (23:24 +0000)]
Make sure we don't accept an @interface inside another objc container
just because there was an attribute in front of it.

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

12 years ago[libclang] Make sure we don't crash when trying to index code that
Argyrios Kyrtzidis [Fri, 23 Mar 2012 23:24:18 +0000 (23:24 +0000)]
[libclang] Make sure we don't crash when trying to index code that
managed to insert an @interface as top level decl contained by another
@interface.

A commit to also not allow this as valid code will be coming.

rdar://11105114.

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

12 years agoRevert accidentally-committed www changes (and an unused diagnostic);
Richard Smith [Fri, 23 Mar 2012 23:11:49 +0000 (23:11 +0000)]
Revert accidentally-committed www changes (and an unused diagnostic);
forward-declared enums aren't /quite/ done yet.

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

12 years agoWhen defining a forward-declared enum, don't try to attach the definition to
Richard Smith [Fri, 23 Mar 2012 23:09:08 +0000 (23:09 +0000)]
When defining a forward-declared enum, don't try to attach the definition to
a previous declaration if the redeclaration is invalid. That way lies madness.
Fixes a crash-on-invalid reported by Abramo.

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

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