]> granicus.if.org Git - clang/log
clang
12 years ago[analyzer] Run remove dead bindings right before leaving a function.
Anna Zaks [Fri, 20 Apr 2012 21:59:08 +0000 (21:59 +0000)]
[analyzer] Run remove dead bindings right before leaving a function.

This is needed to ensure that we always report issues in the correct
function. For example, leaks are identified when we call remove dead
bindings. In order to make sure we report a callee's leak in the callee,
we have to run the operation in the callee's context.

This change required quite a bit of infrastructure work since:
 - We used to only run remove dead bindings before a given statement;
here we need to run it after the last statement in the function. For
this, we added additional Program Point and special mode in the
SymbolReaper to remove all symbols in context lower than the current
one.
 - The call exit operation turned into a sequence of nodes, which are
now guarded by CallExitBegin and CallExitEnd nodes for clarity and
convenience.

(Sorry for the long diff.)

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

12 years ago[analyzer] Remove unused method.
Anna Zaks [Fri, 20 Apr 2012 21:59:00 +0000 (21:59 +0000)]
[analyzer] Remove unused method.

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

12 years ago[analyzer] Constify
Anna Zaks [Fri, 20 Apr 2012 21:58:56 +0000 (21:58 +0000)]
[analyzer] Constify

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

12 years agoUpdate doxygen comment to match changes in r155218.
Richard Smith [Fri, 20 Apr 2012 20:34:25 +0000 (20:34 +0000)]
Update doxygen comment to match changes in r155218.

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

12 years agoIn r135308, -save-temps was modified to prevent a temporary file from
Chad Rosier [Fri, 20 Apr 2012 20:05:08 +0000 (20:05 +0000)]
In r135308, -save-temps was modified to prevent a temporary file from
overwriting the input file.  For example,

clang -c foo.s -o foo.o -save-temps

Unfortunately, the original patch didn't compare the paths of the input and
output files.  Thus, something like the following would fail to create foo.s.

cd /tmp/obj
clang -c ../src/foo.s -o foo.o -save-temps

rdar://11252615

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

12 years agoFix bug where a class's (deleted) copy constructor would be implicitly given a
Richard Smith [Fri, 20 Apr 2012 18:46:14 +0000 (18:46 +0000)]
Fix bug where a class's (deleted) copy constructor would be implicitly given a
non-const reference parameter type if the class had any subobjects with deleted
copy constructors. This causes a rejects-valid if the class's copy constructor
is explicitly defaulted (as happens for some implementations of std::pair etc).

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

12 years agoc++11 status: Replace references to "SVN" with "3.1" to avoid confusion when they...
Benjamin Kramer [Fri, 20 Apr 2012 18:43:50 +0000 (18:43 +0000)]
c++11 status: Replace references to "SVN" with "3.1" to avoid confusion when they diverge.

Color is still yellow, as 3.1 isn't released yet.

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

12 years agoWhen generating the clang crash diagnostic script, strip out the -o flag.
Chad Rosier [Fri, 20 Apr 2012 17:21:42 +0000 (17:21 +0000)]
When generating the clang crash diagnostic script, strip out the -o flag.
Add a FIXME comment.
rdar://11283560

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

12 years agoAdd a little hack to emulate a clang crash, so the diagnostics generator can be
Chad Rosier [Fri, 20 Apr 2012 17:08:59 +0000 (17:08 +0000)]
Add a little hack to emulate a clang crash, so the diagnostics generator can be
tested.

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

12 years agominor improvement to couple of tests.
Fariborz Jahanian [Fri, 20 Apr 2012 17:07:07 +0000 (17:07 +0000)]
minor improvement to couple of tests.

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

12 years agoNo need to put the SourceManager in with the ASTContext, as the ASTContext
Manuel Klimek [Fri, 20 Apr 2012 14:07:01 +0000 (14:07 +0000)]
No need to put the SourceManager in with the ASTContext, as the ASTContext
already contains the SourceManager.

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

12 years agoPass -mfloat-abi= to linuxtools assembler.
Evgeniy Stepanov [Fri, 20 Apr 2012 09:03:40 +0000 (09:03 +0000)]
Pass -mfloat-abi= to linuxtools assembler.

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

12 years agoFix bug 12574 - Avoid infinite recursion in constructors and destructors when using...
Timur Iskhodzhanov [Fri, 20 Apr 2012 08:05:00 +0000 (08:05 +0000)]
Fix bug 12574 - Avoid infinite recursion in constructors and destructors when using Microsoft C++ ABI

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

12 years agoReplace r155185 with a better fix, which also addresses PR12557. When looking
Richard Smith [Fri, 20 Apr 2012 07:12:26 +0000 (07:12 +0000)]
Replace r155185 with a better fix, which also addresses PR12557. When looking
up an elaborated type specifier in a friend declaration, only look for type
declarations, per [basic.lookup.elab]p2. If we know that the redeclaration
lookup for a friend class template in a dependent context finds a non-template,
don't delay the diagnostic to instantiation time.

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

12 years agoFix a bug which creduce found reducing PR12585.
Richard Smith [Fri, 20 Apr 2012 05:42:36 +0000 (05:42 +0000)]
Fix a bug which creduce found reducing PR12585.

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

12 years agoWhen generating the clang crash diagnostic script, strip out the -D, -F, and -I
Chad Rosier [Fri, 20 Apr 2012 00:30:04 +0000 (00:30 +0000)]
When generating the clang crash diagnostic script, strip out the -D, -F, and -I
flags.  We have preprocessed source, so we don't need these.

No test case as it's fairly difficult to make the compiler crash on demand.  I'll
patiently wait for Ben to tell me how to do this in 2 lines of code.  :)
rdar://11283560

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

12 years agoobjective-arc: Retune my previous patch so warning
Fariborz Jahanian [Thu, 19 Apr 2012 23:49:39 +0000 (23:49 +0000)]
objective-arc: Retune my previous patch so warning
is issued on weak property as receiver and not on
any other use of a weak property. // rdar://10225276

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

12 years agoRe-add the closing '}' for the namespace I accidentally deleted when
Kaelyn Uhrain [Thu, 19 Apr 2012 23:26:12 +0000 (23:26 +0000)]
Re-add the closing '}' for the namespace I accidentally deleted when
removing a (new) duplicate test whose only difference was the tag type
being an enum instead of a struct.

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

12 years agoIn Parser::isCXXDeclarationSpecifier, consider a non-type identifier
Kaelyn Uhrain [Thu, 19 Apr 2012 23:17:45 +0000 (23:17 +0000)]
In Parser::isCXXDeclarationSpecifier, consider a non-type identifier
followed by an identifier as declaration specificer (except for ObjC).
This allows e.g. an out-of-line C++ member function definitions to be
recognized as functions and not as variable declarations if the type
name for the first parameter is not recognized as a type--say, when there
is a function name shadowing an enum type name and the parameter is
missing the "enum" keyword needed to distinguish the two.

Note that returning TPResult::Error() instead of TPResult::True()
appears to have the same end result, while TPResult::Ambiguous()
results in a crash.

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

12 years agoIn an attempt to reduce confusion, mark 'Strong compare exchange' as done, since
Richard Smith [Thu, 19 Apr 2012 22:09:22 +0000 (22:09 +0000)]
In an attempt to reduce confusion, mark 'Strong compare exchange' as done, since
we generate correct code for both strong and weak atomic compare-exchanges, even
though we don't propagate to the IR enough information to generate optimal weak
compare-exchanges on architectures which support them.

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

12 years agoobjective-c arc: Issue warning under -Wreceiver-is-weak
Fariborz Jahanian [Thu, 19 Apr 2012 21:44:57 +0000 (21:44 +0000)]
objective-c arc: Issue warning under -Wreceiver-is-weak
if receiver is a 'weak' property, by type or by attribute.
// rdar://10225276

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

12 years agoAdded equivalent method calls in examples.
Patrick Beard [Thu, 19 Apr 2012 20:48:09 +0000 (20:48 +0000)]
Added equivalent method calls in examples.

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

12 years agoFormatting fix.
Richard Smith [Thu, 19 Apr 2012 17:46:52 +0000 (17:46 +0000)]
Formatting fix.

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

12 years agoAdd SmallVectorImpl Visual Studio visualizer. Patch by Nikola Smiljanic.
David Blaikie [Thu, 19 Apr 2012 17:26:49 +0000 (17:26 +0000)]
Add SmallVectorImpl Visual Studio visualizer. Patch by Nikola Smiljanic.

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

12 years agoFix a broken link. Patch by Nikola Smiljanic.
David Blaikie [Thu, 19 Apr 2012 17:21:46 +0000 (17:21 +0000)]
Fix a broken link. Patch by Nikola Smiljanic.

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

12 years agoRefactor the thread safety analysis so that it is easier to do
DeLesley Hutchins [Thu, 19 Apr 2012 16:48:43 +0000 (16:48 +0000)]
Refactor the thread safety analysis so that it is easier to do
path-sensitive analysis like handling of trylock expressions.

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

12 years agoobjective-c modern translator: Further improving the last
Fariborz Jahanian [Thu, 19 Apr 2012 16:30:28 +0000 (16:30 +0000)]
objective-c modern translator: Further improving the last
patch fixing writing a spurious 'static' into
the wrong place. // rdar://11275241

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

12 years agoThread safety analysis: split warnings into two groups: attribute warnings
DeLesley Hutchins [Thu, 19 Apr 2012 16:10:44 +0000 (16:10 +0000)]
Thread safety analysis: split warnings into two groups: attribute warnings
which are checked in the parser, and analysis warnings that require the
full analysis.  This allows attribute syntax to be checked independently
of the full thread safety analysis.  Also introduces a new warning for the
case where a string is used as a lock expression; this allows the analysis
to gracefully handle expressions that would otherwise cause a parse error.

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

12 years agoClarified encoding of boxed C strings, balanced all <p> with </p>.
Patrick Beard [Thu, 19 Apr 2012 14:33:55 +0000 (14:33 +0000)]
Clarified encoding of boxed C strings, balanced all <p> with </p>.

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

12 years agoAdds a unit test for the RecursiveASTVisitor.
Manuel Klimek [Thu, 19 Apr 2012 08:48:53 +0000 (08:48 +0000)]
Adds a unit test for the RecursiveASTVisitor.

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

12 years agoFix a comment.
Francois Pichet [Thu, 19 Apr 2012 07:48:57 +0000 (07:48 +0000)]
Fix a comment.

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

12 years agoAdd missing -Wc++98-compat warnings for initializer list initializations which
Richard Smith [Thu, 19 Apr 2012 06:58:00 +0000 (06:58 +0000)]
Add missing -Wc++98-compat warnings for initializer list initializations which
initialize references, create std::initializer_list objects, or call constructors.

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

12 years agoIn mergeVisibility, if we already have an explicit visibility, keep it.
Rafael Espindola [Thu, 19 Apr 2012 05:50:08 +0000 (05:50 +0000)]
In mergeVisibility, if we already have an explicit visibility, keep it.
This fixes the included testcase and lets us simplify the code a bit. It
does require using mergeWithMin when merging class information to its
members. Expand the comments to explain why that works.

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

12 years agoIn mergeVisibilityWithMin, let an implicit hidden symbol take precedence over
Rafael Espindola [Thu, 19 Apr 2012 05:34:51 +0000 (05:34 +0000)]
In mergeVisibilityWithMin, let an implicit hidden symbol take precedence over
an explicit default one. This means that with -fvisibility hidden we
now produce a hidden symbol for

template <typename T>
class DEFAULT foo {
  void bar() {}
};
class zed {};
template class foo<zed>;

This matches the behaviour of gcc 4.7.

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

12 years agoNow that we check visibility attributes in an appropriate order,
Rafael Espindola [Thu, 19 Apr 2012 05:24:05 +0000 (05:24 +0000)]
Now that we check visibility attributes in an appropriate order,
there is no need for mergeVisibily to ever increase the visibility. Not
doing so lets us replace an incorrect use of mergeVisibilityWithMin. The
testcase

struct HIDDEN RECT {
  int top;
};
DEFAULT RECT foo = {0};

shows that we should give preference to one of the attributes instead of
keeping the minimum. We still get this testcase wrong because mergeVisibily
handles two explicit visibilities incorrectly, but this is a step in the
right direction.

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

12 years agoCheck ConsiderGlobalVisibility before using -fvisibility.
Rafael Espindola [Thu, 19 Apr 2012 04:37:16 +0000 (04:37 +0000)]
Check ConsiderGlobalVisibility before using -fvisibility.

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

12 years agoThe explicit bit in LV already tracks exactly the same information as
Rafael Espindola [Thu, 19 Apr 2012 04:27:47 +0000 (04:27 +0000)]
The explicit bit in LV already tracks exactly the same information as
DHasExplicitVisibility. Simplify the code a bit.

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

12 years agoMove the point in the code where we handle -fvisibility=hidden. With
Rafael Espindola [Thu, 19 Apr 2012 02:55:01 +0000 (02:55 +0000)]
Move the point in the code where we handle -fvisibility=hidden. With
the current implementation this should be a nop as explicit visibility
takes precedence in mergeVisibility.

The location chosen is such that attributes checked above it can force
a symbol to be default. For example, an attribute is the variable or function.
Attributes checked after this point, can only make the visibility more
restrictive. An attribute in a type for example.

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

12 years agoMake setVisibility private and change users to mergeVisibility. This is
Rafael Espindola [Thu, 19 Apr 2012 02:22:07 +0000 (02:22 +0000)]
Make setVisibility private and change users to mergeVisibility. This is
currently a nop as those users are the first merge or are a merge
of a hidden explicit visibility, which always wins in the current
implementation.

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

12 years agoChanged title.
Patrick Beard [Thu, 19 Apr 2012 01:30:47 +0000 (01:30 +0000)]
Changed title.

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

12 years agoChanged wording of availability.
Patrick Beard [Thu, 19 Apr 2012 01:02:16 +0000 (01:02 +0000)]
Changed wording of availability.

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

12 years agomodern objective-c translator: Fix writing a spurious 'static'
Fariborz Jahanian [Thu, 19 Apr 2012 00:50:01 +0000 (00:50 +0000)]
modern objective-c translator: Fix writing a spurious 'static'
into the wrong place when rewriting a static function
which declares block literals. // rdar://11275241

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

12 years agoImplements boxed expressions for Objective-C. <rdar://problem/10194391>
Patrick Beard [Thu, 19 Apr 2012 00:25:12 +0000 (00:25 +0000)]
Implements boxed expressions for Objective-C. <rdar://problem/10194391>

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

12 years agoPR 12586: Fix assert while running libc++ testsuite: deal with exception
Richard Smith [Thu, 19 Apr 2012 00:08:28 +0000 (00:08 +0000)]
PR 12586: Fix assert while running libc++ testsuite: deal with exception
specifications on member function templates of class templates and other such
nested beasties. Store the function template from which we are to instantiate
an exception specification rather than trying to deduce it. Plus some
additional test cases.

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

12 years agoRevert some Hexagon builtin commits to match reverts done to LLVM in
Chandler Carruth [Wed, 18 Apr 2012 21:32:25 +0000 (21:32 +0000)]
Revert some Hexagon builtin commits to match reverts done to LLVM in
r155047. See the LLVM log for the primary motivation:
  http://llvm.org/viewvc/llvm-project?rev=155047&view=rev

Primary commit r154828:
  - Several issues were raised in review, and fixed in subsequent
    commits.
  - Follow-up commits also reverted, and which should be folded into the
    original before reposting:
    - r154837: Re-add the 'undef BUILTIN' thing to fix the build.
    - r154928: Fix build warnings, re-add (and correct) header and
      license
    - r154937: Typo fix.

Please resubmit this patch with the relevant LLVM resubmission.

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

12 years agoobjective-c: Issue diagnostic when an implicit
Fariborz Jahanian [Wed, 18 Apr 2012 19:13:23 +0000 (19:13 +0000)]
objective-c: Issue diagnostic when an implicit
property accessor (getter) missing, instead of crashing.
// rdar://11273060

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

12 years agoSuppress -Wunused-variable warning in -Asserts build
Matt Beaumont-Gay [Wed, 18 Apr 2012 17:25:16 +0000 (17:25 +0000)]
Suppress -Wunused-variable warning in -Asserts build

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

12 years agoVerifyICE: Pass PartialDiagnostics by reference.
Benjamin Kramer [Wed, 18 Apr 2012 14:22:41 +0000 (14:22 +0000)]
VerifyICE: Pass PartialDiagnostics by reference.

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

12 years agoMIPS: Followup to r154606. Expand list of accepted MIPS target features in the MipsTa...
Simon Atanasyan [Wed, 18 Apr 2012 12:00:11 +0000 (12:00 +0000)]
MIPS: Followup to r154606. Expand list of accepted MIPS target features in the MipsTargetInfoBase::setFeatureEnabled() routine.

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

12 years agofix GCC version comparison wrt. equal patch suffices (and squash two typos)
Gabor Greif [Wed, 18 Apr 2012 10:59:08 +0000 (10:59 +0000)]
fix GCC version comparison wrt. equal patch suffices (and squash two typos)

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

12 years agoAdds a FixedCompilationDatabase to be able to specify tool parameters
Manuel Klimek [Wed, 18 Apr 2012 07:41:50 +0000 (07:41 +0000)]
Adds a FixedCompilationDatabase to be able to specify tool parameters
at the command line.

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

12 years agoFix bad typo reported by I-Jui Sung.
Ted Kremenek [Wed, 18 Apr 2012 05:37:13 +0000 (05:37 +0000)]
Fix bad typo reported by I-Jui Sung.

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

12 years agoAs per John McCall comment:
Francois Pichet [Wed, 18 Apr 2012 03:24:38 +0000 (03:24 +0000)]
As per John McCall comment:
Follow up to r154924: check that we are in a static CMethodDecl to enable the Microsoft bug emulation regarding access to protected member during PTM creation. Not just any static function.

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

12 years agofix display of source lines with null characters
Seth Cantrell [Wed, 18 Apr 2012 02:44:48 +0000 (02:44 +0000)]
fix display of source lines with null characters

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

12 years agoNicer display of unprintable source, and fix caret display for non-ascii text
Seth Cantrell [Wed, 18 Apr 2012 02:44:46 +0000 (02:44 +0000)]
Nicer display of unprintable source, and fix caret display for non-ascii text

Unprintable source in diagnostics is transformed to a printable form and then
displayed with reversed colors if possible. Unprintable characters are
displayed as <U+NNNN> while bytes that do not represent valid characters are
shown as <XX>.

Column adjustments to diagnostic carets, highlighted ranges, and fixups are
made both for characters escaped as above and for characters which are
printable but take up more than a single column.

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

12 years agoCalling setVisibility directly only makes (some) sense when the visibility is
Rafael Espindola [Wed, 18 Apr 2012 00:14:58 +0000 (00:14 +0000)]
Calling setVisibility directly only makes (some) sense when the visibility is
explicit.

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

12 years agoPR12569: Instantiate exception specifications of explicit instantiations
Richard Smith [Tue, 17 Apr 2012 22:30:01 +0000 (22:30 +0000)]
PR12569: Instantiate exception specifications of explicit instantiations
and explicit specializations of function templates appropriately.

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

12 years agoRevert "Nicer display of unprintable source, and fix caret display for non-ascii...
Seth Cantrell [Tue, 17 Apr 2012 20:59:59 +0000 (20:59 +0000)]
Revert "Nicer display of unprintable source, and fix caret display for non-ascii text"

This reverts commit e9a3b76ba589a8a884e978273beaed0d97cf9861.

Revert "fix display of source lines with null characters"

This reverts commit 70712b276e40bbe11e5063dfc7e82ce3209929cd.

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

12 years agoadd missing parameter index to diag
Matt Beaumont-Gay [Tue, 17 Apr 2012 20:36:24 +0000 (20:36 +0000)]
add missing parameter index to diag

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

12 years agofix display of source lines with null characters
Seth Cantrell [Tue, 17 Apr 2012 20:06:06 +0000 (20:06 +0000)]
fix display of source lines with null characters

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

12 years agoNicer display of unprintable source, and fix caret display for non-ascii text
Seth Cantrell [Tue, 17 Apr 2012 20:06:03 +0000 (20:06 +0000)]
Nicer display of unprintable source, and fix caret display for non-ascii text

Unprintable source in diagnostics is transformed to a printable form and then
displayed with reversed colors if possible. Unprintable characters are
displayed as <U+NNNN> while bytes that do not represent valid characters are
shown as <XX>.

Column adjustments to diagnostic carets, highlighted ranges, and fixups are
made both for characters escaped as above and for characters which are
printable but take up more than a single column.

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

12 years agoSimplify calls to mergeVisibility* by passing in the LinkageInfo. No
Rafael Espindola [Tue, 17 Apr 2012 18:47:20 +0000 (18:47 +0000)]
Simplify calls to mergeVisibility* by passing in the LinkageInfo. No
functionality change.

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

12 years agoobjective-c modern translation. Correct rewriting of
Fariborz Jahanian [Tue, 17 Apr 2012 18:40:53 +0000 (18:40 +0000)]
objective-c modern translation. Correct rewriting of
block meta-data of block literals declared inside
of extern "C" functions.
// rdar://1131490

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

12 years agoTypo fix.
Sirish Pande [Tue, 17 Apr 2012 18:22:48 +0000 (18:22 +0000)]
Typo fix.

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

12 years agoSwitches the JSONCompilationDatabase to use the YAML parser.
Manuel Klimek [Tue, 17 Apr 2012 16:54:26 +0000 (16:54 +0000)]
Switches the JSONCompilationDatabase to use the YAML parser.
This will allow us to delete the JSON parser from llvm.

The biggest change is a general change of strategy - instead
of storing StringRef's to the values for the command line and
directory in the input buffer, we store ScalarNode*'s. The
reason is that the YAML parser's getRawValue on ScalarNodes
returns a string that includes the quotes in case of double
quoted strings.

For the same reason we're removing the JSON parsing part of
the command line parsing - this means an extra copy for a
command line when it is requested (and only when it is requested).

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

12 years agoFix to avoid warning. Also add header, and lincense information.
Sirish Pande [Tue, 17 Apr 2012 16:39:11 +0000 (16:39 +0000)]
Fix to avoid warning. Also add header, and lincense information.

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

12 years agoEmulate a MSVC bug where the creation of pointer-to-member to protected member of...
Francois Pichet [Tue, 17 Apr 2012 12:35:05 +0000 (12:35 +0000)]
Emulate a MSVC bug where the creation of pointer-to-member to protected member of base class is allowed but only from a static function.

This fixes a regression when parsing MFC code with clang.

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

12 years agofix a typo
Gabor Greif [Tue, 17 Apr 2012 11:16:26 +0000 (11:16 +0000)]
fix a typo

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

12 years agoConvert vperm2f128 and vperm2i128 intrinsics back to using llvm intrinsics. Unfortuna...
Craig Topper [Tue, 17 Apr 2012 05:16:56 +0000 (05:16 +0000)]
Convert vperm2f128 and vperm2i128 intrinsics back to using llvm intrinsics. Unfortunately, these instructions have behavior that can't be modeled with shuffle vector.

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

12 years agoAttempt to fix test.
Eli Friedman [Tue, 17 Apr 2012 01:57:28 +0000 (01:57 +0000)]
Attempt to fix test.

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

12 years agoChange ExprEngine::shouldInlineDecl() to be defensive in checking if the CFG of the...
Ted Kremenek [Tue, 17 Apr 2012 01:36:03 +0000 (01:36 +0000)]
Change ExprEngine::shouldInlineDecl() to be defensive in checking if the CFG of the callee is valid.  Fixes <rdar://problem/11257631>.

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

12 years agoFix case where the alignment is overaligned, per Eli's suggestion.
Chad Rosier [Tue, 17 Apr 2012 01:14:29 +0000 (01:14 +0000)]
Fix case where the alignment is overaligned, per Eli's suggestion.
rdar://11220251

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

12 years agoLink to a tiny patch to libstdc++-4.7 to work around the <chrono> issues
Richard Smith [Tue, 17 Apr 2012 01:04:22 +0000 (01:04 +0000)]
Link to a tiny patch to libstdc++-4.7 to work around the <chrono> issues
from the C++ status page.

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

12 years agoImplement DR1330 in C++11 mode, to support libstdc++4.7 which uses it.
Richard Smith [Tue, 17 Apr 2012 00:58:00 +0000 (00:58 +0000)]
Implement DR1330 in C++11 mode, to support libstdc++4.7 which uses it.

We have a new flavor of exception specification, EST_Uninstantiated. A function
type with this exception specification carries a pointer to a FunctionDecl, and
the exception specification for that FunctionDecl is instantiated (if needed)
and used in the place of the function type's exception specification.

When a function template declaration with a non-trivial exception specification
is instantiated, the specialization's exception specification is set to this
new 'uninstantiated' kind rather than being instantiated immediately.

Expr::CanThrow has migrated onto Sema, so it can instantiate exception specs
on-demand. Also, any odr-use of a function triggers the instantiation of its
exception specification (the exception specification could be needed by IRGen).
In passing, fix two places where a DeclRefExpr was created but the corresponding
function was not actually marked odr-used. We used to get away with this, but
don't any more.

Also fix a bug where instantiating an exception specification which refers to
function parameters resulted in a crash. We still have the same bug in default
arguments, which I'll be looking into next.

This, plus a tiny patch to fix libstdc++'s common_type, is enough for clang to
parse (and, in very limited testing, support) all of libstdc++4.7's standard
headers.

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

12 years agoMake sure EmitMoveFromReturnSlot is passing the correct alignment to
Chad Rosier [Tue, 17 Apr 2012 00:35:38 +0000 (00:35 +0000)]
Make sure EmitMoveFromReturnSlot is passing the correct alignment to
EmitFinalDestCopy (and thus pass EmitAggregateCopy the correct alignment).
rdar://11220251

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

12 years agoTypo.
Eric Christopher [Mon, 16 Apr 2012 23:55:04 +0000 (23:55 +0000)]
Typo.

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

12 years agoModern objective-c translator:'self' used inside
Fariborz Jahanian [Mon, 16 Apr 2012 23:00:57 +0000 (23:00 +0000)]
Modern objective-c translator:'self' used inside
block literal is imported. // rdar://11259664

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

12 years ago[libclang] Make sure that when we have multiple @class references in the same line,
Argyrios Kyrtzidis [Mon, 16 Apr 2012 22:42:01 +0000 (22:42 +0000)]
[libclang] Make sure that when we have multiple @class references in the same line,
that later ones do not override the previous ones.

If we have:
   @class Foo, Bar;
source ranges for both start at '@', so 'Bar' will end up overriding
'Foo' even though the cursor location was at 'Foo'.

rdar://11257578

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

12 years agomodern objective-c translator: translation of implicit
Fariborz Jahanian [Mon, 16 Apr 2012 22:14:01 +0000 (22:14 +0000)]
modern objective-c translator: translation of implicit
cast to/from block pointer types. // rdar://11202764
Also, many more modern translator tests.

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

12 years ago[analyzer] Fix a false alarm in SelfInitChecker (radar://11235991).
Anna Zaks [Mon, 16 Apr 2012 21:51:09 +0000 (21:51 +0000)]
[analyzer] Fix a false alarm in SelfInitChecker (radar://11235991).
Along with it, fix a couple of other corner cases and add more tests.

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

12 years ago[analyzer] +comments
Anna Zaks [Mon, 16 Apr 2012 21:51:06 +0000 (21:51 +0000)]
[analyzer] +comments

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

12 years ago[analyzer] Fixup for a test case.
Anna Zaks [Mon, 16 Apr 2012 21:51:03 +0000 (21:51 +0000)]
[analyzer] Fixup for a test case.

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

12 years agoobjective-c modern translator: buildit objc bool
Fariborz Jahanian [Mon, 16 Apr 2012 21:03:30 +0000 (21:03 +0000)]
objective-c modern translator: buildit objc bool
type for rewriter project will be BoolTy.
// rdar://11231426.

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

12 years ago[libclang] Spelling range for a objc category should the category name range, not...
Argyrios Kyrtzidis [Mon, 16 Apr 2012 20:01:28 +0000 (20:01 +0000)]
[libclang] Spelling range for a objc category should the category name range, not the class one.

rdar://11249386

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

12 years agoRemove support for -fast-math metadata for the moment.
Duncan Sands [Mon, 16 Apr 2012 19:40:49 +0000 (19:40 +0000)]
Remove support for -fast-math metadata for the moment.

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

12 years agoPer Richard's comments on r154794, add the checks necessary to handle constant-foldin...
Eli Friedman [Mon, 16 Apr 2012 19:23:57 +0000 (19:23 +0000)]
Per Richard's comments on r154794, add the checks necessary to handle constant-folding relational comparisons safely in case the user is using -fwrapv or equivalent.

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

12 years agoRevert r154749 for now at John McCall's request.
Rafael Espindola [Mon, 16 Apr 2012 18:46:26 +0000 (18:46 +0000)]
Revert r154749 for now at John McCall's request.

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

12 years agoImplement the last part of C++ [class.mem]p2, delaying the parsing of
Douglas Gregor [Mon, 16 Apr 2012 18:27:27 +0000 (18:27 +0000)]
Implement the last part of C++ [class.mem]p2, delaying the parsing of
exception specifications on member functions until after the closing
'}' for the containing class. This allows, for example, a member
function to throw an instance of its own class. Fixes PR12564 and a
fairly embarassing oversight in our C++98/03 support.

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

12 years agoUse ordering and the explicit visibility bit instead of modifying
Rafael Espindola [Mon, 16 Apr 2012 18:25:01 +0000 (18:25 +0000)]
Use ordering and the explicit visibility bit instead of modifying
ConsiderGlobalVisibility. No functionality change.

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

12 years agoReadd lost "undef BUILTIN" to fix the build.
David Blaikie [Mon, 16 Apr 2012 17:57:39 +0000 (17:57 +0000)]
Readd lost "undef BUILTIN" to fix the build.

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

12 years agoGenerate fpmath metadata when -ffast-math. Note that no optimizations are hooked
Duncan Sands [Mon, 16 Apr 2012 17:24:31 +0000 (17:24 +0000)]
Generate fpmath metadata when -ffast-math. Note that no optimizations are hooked
up to this yet.

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

12 years agoHexagon V5(Floating Point) support.
Sirish Pande [Mon, 16 Apr 2012 17:04:05 +0000 (17:04 +0000)]
Hexagon V5(Floating Point) support.

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

12 years agoRemove unused method.
Rafael Espindola [Mon, 16 Apr 2012 16:41:02 +0000 (16:41 +0000)]
Remove unused method.

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

12 years agoAdjust for LLVM name tweaks requested by Chandler.
Duncan Sands [Mon, 16 Apr 2012 16:29:47 +0000 (16:29 +0000)]
Adjust for LLVM name tweaks requested by Chandler.

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

12 years agoAdd another constructor to LVFlags and use it to simplify the code a bit.
Rafael Espindola [Mon, 16 Apr 2012 13:44:41 +0000 (13:44 +0000)]
Add another constructor to LVFlags and use it to simplify the code a bit.

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

12 years agoImplement C++11 [expr.prim.general]p3, which permits the use of 'this'
Douglas Gregor [Mon, 16 Apr 2012 07:05:22 +0000 (07:05 +0000)]
Implement C++11 [expr.prim.general]p3, which permits the use of 'this'
in the declaration of a non-static member function after the
(optional) cv-qualifier-seq, which in practice means in the exception
specification and late-specified return type.

The new scheme here used to manage 'this' outside of a member function
scope is more general than the Scope-based mechanism previously used
for non-static data member initializers and late-parsesd attributes,
because it can also handle the cv-qualifiers on the member
function. Note, however, that a separate pass is required for static
member functions to determine whether 'this' was used, because we
might not know that we have a static function until after declaration
matching.

Finally, this introduces name mangling for 'this' and for the implicit
'this', which is intended to match GCC's mangling. Independent
verification for the new mangling test case would be appreciated.

Fixes PR10036 and PR12450.

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

12 years agoAdd note to hacking.html that running the test harness directly from the command...
Eli Friedman [Mon, 16 Apr 2012 05:04:45 +0000 (05:04 +0000)]
Add note to hacking.html that running the test harness directly from the command-line requires making sure the relevant files are generated first.  Patch by Matt Fowles, with some minor modifications.

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

12 years agoMake constant evaluation for pointer comparisons work correctly for some uncommon...
Eli Friedman [Mon, 16 Apr 2012 04:30:08 +0000 (04:30 +0000)]
Make constant evaluation for pointer comparisons work correctly for some uncommon cases.  <rdar://problem/10962435>.

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

12 years agouse DEFAULT_SYSROOT
Sebastian Pop [Mon, 16 Apr 2012 04:16:43 +0000 (04:16 +0000)]
use DEFAULT_SYSROOT

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

12 years agoThe result of the Microsoft __uuidof operator must be considered a global lvalue...
Francois Pichet [Mon, 16 Apr 2012 04:08:35 +0000 (04:08 +0000)]
The result of the Microsoft __uuidof operator must be considered a global lvalue during constant expression evaluation.
Otherwise we would get this error in C++11 mode (because of a recent change):
   error: non-type template argument of type 'const _GUID *' is not a constant expression

For code like:
template <const GUID* g = &__uuidof(struct_with_uuid)>
class COM_CLASS { };

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