]> granicus.if.org Git - clang/log
clang
11 years agoRemove a bit of dead code.
Rafael Espindola [Mon, 29 Oct 2012 23:41:43 +0000 (23:41 +0000)]
Remove a bit of dead code.

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

11 years agoMove getOriginalSourceFileName inline. Patch by Laszlo Nagy.
Rafael Espindola [Mon, 29 Oct 2012 23:26:40 +0000 (23:26 +0000)]
Move getOriginalSourceFileName inline. Patch by Laszlo Nagy.

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

11 years ago[libclang] Introduce a version constant for the libclang API.
Argyrios Kyrtzidis [Mon, 29 Oct 2012 23:24:44 +0000 (23:24 +0000)]
[libclang] Introduce a version constant for the libclang API.

rdar://12587974

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

11 years ago[analyzer] Malloc checker cleanup/refactor
Anna Zaks [Mon, 29 Oct 2012 22:51:54 +0000 (22:51 +0000)]
[analyzer] Malloc checker cleanup/refactor

No need for the auxiliary flag. No need to generate a leak node when
there is no error.

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

11 years ago[analyzer] Add SimpleStreamChecker.
Anna Zaks [Mon, 29 Oct 2012 22:51:50 +0000 (22:51 +0000)]
[analyzer] Add SimpleStreamChecker.

This is an example checker for catching fopen fclose API misuses.

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

11 years ago[analyzer] Add checker helpers to CheckerContext.
Anna Zaks [Mon, 29 Oct 2012 22:51:44 +0000 (22:51 +0000)]
[analyzer] Add checker helpers to CheckerContext.

- Adding Immutable Map to GDM and getIdentifierInfo helper method.

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

11 years agoRevert commit r166946
Quentin Colombet [Mon, 29 Oct 2012 18:28:57 +0000 (18:28 +0000)]
Revert commit r166946

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

11 years agoPartially roll back r166898; it exposed a bug in the standard.
Richard Smith [Mon, 29 Oct 2012 18:26:47 +0000 (18:26 +0000)]
Partially roll back r166898; it exposed a bug in the standard.

The problem is as follows: C++11 has contexts which are not
potentially-evaluated, and yet in which we are required or encouraged to
perform constant evaluation. In such contexts, we are not permitted to
implicitly define special member functions for literal types, therefore
we cannot evalaute those constant expressions.

Punt on this in one more context for now by skipping checking constexpr
variable initializers if they occur in dependent contexts.

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

11 years agoMake forcesizeopt attribute available to the end user
Quentin Colombet [Mon, 29 Oct 2012 17:56:23 +0000 (17:56 +0000)]
Make forcesizeopt attribute available to the end user

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

11 years ago-Warc-repeated-use-of-weak: allow single reads in loops from local variables.
Jordan Rose [Mon, 29 Oct 2012 17:46:47 +0000 (17:46 +0000)]
-Warc-repeated-use-of-weak: allow single reads in loops from local variables.

Previously, the warning would erroneously fire on this:

for (Test *a in someArray)
  use(a.weakProp);

...because it looks like the same property is being accessed over and over.
However, clearly this is not the case. We now ignore loops like this for
local variables, but continue to warn if the base object is a parameter,
global variable, or instance variable, on the assumption that these are
not repeatedly usually assigned to within loops.

Additionally, do-while loops where the condition is 'false' are not really
loops at all; usually they're just used for semicolon-swallowing macros or
using "break" like "goto".

<rdar://problem/12578785&12578849>

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

11 years ago[analyzer] New option to not suppress null return paths if an argument is null.
Jordan Rose [Mon, 29 Oct 2012 17:31:59 +0000 (17:31 +0000)]
[analyzer] New option to not suppress null return paths if an argument is null.

Our one basic suppression heuristic is to assume that functions do not
usually return NULL. However, when one of the arguments is NULL it is
suddenly much more likely that NULL is a valid return value. In this case,
we don't suppress the report here, but we do attach /another/ visitor to
go find out if this NULL argument also comes from an inlined function's
error path.

This new behavior, controlled by the 'avoid-suppressing-null-argument-paths'
analyzer-config option, is turned off by default. Turning it on produced
two false positives and no new true positives when running over LLVM/Clang.

This is one of the possible refinements to our suppression heuristics.
<rdar://problem/12350829>

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

11 years ago[analyzer] Use the CallEnter node to get a value for tracked null arguments.
Jordan Rose [Mon, 29 Oct 2012 17:31:53 +0000 (17:31 +0000)]
[analyzer] Use the CallEnter node to get a value for tracked null arguments.

Additionally, don't collect PostStore nodes -- they are often used in
path diagnostics.

Previously, we tried to track null arguments in the same way as any other
null values, but in many cases the necessary nodes had already been
collected (a memory optimization in ExplodedGraph). Now, we fall back to
using the value of the argument at the time of the call, which may not
always match the actual contents of the region, but often will.

This is a precursor to improving our suppression heuristic.
<rdar://problem/12350829>

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

11 years agoThis patch adds alignment information for long double to the 64-bit PowerPC
Bill Schmidt [Mon, 29 Oct 2012 14:59:24 +0000 (14:59 +0000)]
This patch adds alignment information for long double to the 64-bit PowerPC
ELF subtarget.

The existing description string is moved from PPC64TargetInfo to its
DarwinTargetInfo subclass, to avoid any changes to the Darwin ABI.
PPC64TargetInfo now has two possible description strings: one for FreeBSD,
which requires 8-byte alignment, and a default string that requires
16-byte alignment.

I've added a test for PPC64 Linux to verify the 16-byte alignment.  If
somebody wants to add a separate test for FreeBSD, that would be great.

Note that there is a companion patch to update the alignment information
in LLVM, which I am committing now as well.

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

11 years agoHandle '*' and '#' asm constraint modifiers.
Ulrich Weigand [Mon, 29 Oct 2012 12:20:54 +0000 (12:20 +0000)]
Handle '*' and '#' asm constraint modifiers.

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

11 years agoFix ASTMatchersTests to not create an overloaded-virtual warning.
Daniel Jasper [Mon, 29 Oct 2012 10:48:25 +0000 (10:48 +0000)]
Fix ASTMatchersTests to not create an overloaded-virtual warning.

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

11 years agoImplement has(), hasDescendant(), forEach() and forEachDescendant() for
Daniel Jasper [Mon, 29 Oct 2012 10:14:44 +0000 (10:14 +0000)]
Implement has(), hasDescendant(), forEach() and forEachDescendant() for
Types, QualTypes and TypeLocs.

Review: http://llvm-reviews.chandlerc.com/D83

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

11 years agoRemove spurious mode marker from .cpp file.
Nick Lewycky [Mon, 29 Oct 2012 06:05:01 +0000 (06:05 +0000)]
Remove spurious mode marker from .cpp file.

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

11 years agoAdd missing emacs major mode marker.
Nick Lewycky [Mon, 29 Oct 2012 06:03:58 +0000 (06:03 +0000)]
Add missing emacs major mode marker.

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

11 years agoFix name of this file.
Nick Lewycky [Mon, 29 Oct 2012 06:03:40 +0000 (06:03 +0000)]
Fix name of this file.

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

11 years agoAdd missing emacs major mode marker.
Nick Lewycky [Mon, 29 Oct 2012 06:02:59 +0000 (06:02 +0000)]
Add missing emacs major mode marker.

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

11 years agoimprove highlighting of invalid string encodings
Seth Cantrell [Sun, 28 Oct 2012 18:24:46 +0000 (18:24 +0000)]
improve highlighting of invalid string encodings

limit highlight to exactly the bad encoding, and highlight every
bad encoding in a string.

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

11 years agoRevert functional part of r166896 and just suppress -Wunneeded-internal-declaration...
Richard Smith [Sun, 28 Oct 2012 07:39:29 +0000 (07:39 +0000)]
Revert functional part of r166896 and just suppress -Wunneeded-internal-declaration for reference types for now. This needs more work; the cases we currently miss are a bit random.

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

11 years agoWhen determining whether to try evaluating the initializer of a variable, check
Richard Smith [Sun, 28 Oct 2012 06:18:02 +0000 (06:18 +0000)]
When determining whether to try evaluating the initializer of a variable, check
whether the initializer is value-dependent rather than whether we are in a
dependent context. This allows us to detect some errors sooner, and fixes a
crash-on-invalid if a dependent type leaks out to a non-dependent context in
error recovery.

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

11 years agoIn -Wunneeded-internal-declaration, suppress the warning for variables which
Richard Smith [Sun, 28 Oct 2012 04:47:21 +0000 (04:47 +0000)]
In -Wunneeded-internal-declaration, suppress the warning for variables which
might have been used in constant expressions, rather than suppressing it for
variables which are const. The important thing here is that such variables
can have their values used without actually being marked as 'used'.

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

11 years agoFix invalid jump scopes again. This time without trying to find out if an
Rafael Espindola [Sun, 28 Oct 2012 02:44:03 +0000 (02:44 +0000)]
Fix invalid jump scopes again. This time without trying to find out if an
incomplete type has a destructor or not.

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

11 years agoAdd a testcase from the previous bootstrap problem.
Rafael Espindola [Sun, 28 Oct 2012 02:25:27 +0000 (02:25 +0000)]
Add a testcase from the previous bootstrap problem.

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

11 years agoFix crash on missing namespace name in namespace alias definition -- PR14085.
Nico Weber [Sat, 27 Oct 2012 23:44:27 +0000 (23:44 +0000)]
Fix crash on missing namespace name in namespace alias definition -- PR14085.

Patch from Brian Brooks <brooks.brian@gmail.com>!

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

11 years agoobjective-C arc/mrr: Patch for the new block variable layout meta-data.
Fariborz Jahanian [Sat, 27 Oct 2012 21:10:38 +0000 (21:10 +0000)]
objective-C arc/mrr: Patch for the new block variable layout meta-data.
It is currently off (so no tests). This is wip.

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

11 years agoCurrently the initial value of Tok is dependent an the stack contents
Chris Lattner [Sat, 27 Oct 2012 19:49:20 +0000 (19:49 +0000)]
Currently the initial value of Tok is dependent an the stack contents
and could cause the Parser to crash on the first ConsumeToken().

Patcy by Bas van den Berg!

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

11 years agoRevert 166876 while I debug a bootstrap problem.
Rafael Espindola [Sat, 27 Oct 2012 16:49:47 +0000 (16:49 +0000)]
Revert 166876 while I debug a bootstrap problem.

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

11 years agoReapply 166855 with an early exit on null QualTypes.
Rafael Espindola [Sat, 27 Oct 2012 14:56:08 +0000 (14:56 +0000)]
Reapply 166855 with an early exit on null QualTypes.

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

11 years agoReverted back the changes made in 166868 and in 166869
Mahesha S [Sat, 27 Oct 2012 10:44:42 +0000 (10:44 +0000)]
Reverted back the changes made in 166868 and in 166869

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

11 years agoFeature:
Mahesha S [Sat, 27 Oct 2012 09:05:45 +0000 (09:05 +0000)]
Feature:
  OpenMP support.

Sub-Feature:
  Support for "#pragma omp ..." registration with
  Preprocessor.

Files Changed/Added:
  * include/clang/Basic/DiagnosticGroups.td (C)
  * include/clang/Basic/DiagnosticParseKinds.td (C)
  * include/clang/Basic/TokenKinds.def (C)
  * include/clang/Parse/Parser.h (C)
  * lib/Parse/Parser.cpp (C)

Test Cases Changed/Added:
  * test/Preprocessor/pragma_omp.c (A)
  * test/Preprocessor/pragma_omp_ignored_warning.c (A)

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

11 years ago-------------------------------------------------
Mahesha S [Sat, 27 Oct 2012 07:47:56 +0000 (07:47 +0000)]
-------------------------------------------------
Feature:
  OpenMP support in CLANG:

Sub-Feature:
  Support for option -fopenmp

Files Changed/Added:
  * include/clang/Driver/Options.td (C)
  * include/clang/Basic/LangOptions.def (C)
  * lib/Driver/Tools.cpp (C)
  * lib/Frontend/CompilerInvocation.cpp (C)

Test Cases Changed/Added:
  * test/Driver/clang_fopenmp_opt.c (A)
-------------------------------------------------

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

11 years agoRemoved an extra blank line.
Mahesha S [Sat, 27 Oct 2012 07:23:58 +0000 (07:23 +0000)]
Removed an extra blank line.

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

11 years agoAdd a reduced testcase of the last bootstrap failure.
Rafael Espindola [Sat, 27 Oct 2012 04:54:49 +0000 (04:54 +0000)]
Add a reduced testcase of the last bootstrap failure.

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

11 years agoRevert r166855. I can reproduce the bootstrap failure and have a testcase
Rafael Espindola [Sat, 27 Oct 2012 03:06:02 +0000 (03:06 +0000)]
Revert r166855. I can reproduce the bootstrap failure and have a testcase
to reduce.

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

11 years agoAdd a test case for the stack overflow in rdar://12542261
Argyrios Kyrtzidis [Sat, 27 Oct 2012 02:13:28 +0000 (02:13 +0000)]
Add a test case for the stack overflow in rdar://12542261

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

11 years agoFix cases where we were not producing an error when a computed goto could
Rafael Espindola [Sat, 27 Oct 2012 01:17:42 +0000 (01:17 +0000)]
Fix cases where we were not producing an error when a computed goto could
jump over destructor calls.
Fixes pr13812.

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

11 years agoMove two helper functions to AST so that sema can use them.
Rafael Espindola [Sat, 27 Oct 2012 01:03:43 +0000 (01:03 +0000)]
Move two helper functions to AST so that sema can use them.

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

11 years agoRefactor some code into a new findMaterializedTemporary function.
Rafael Espindola [Sat, 27 Oct 2012 00:43:14 +0000 (00:43 +0000)]
Refactor some code into a new findMaterializedTemporary function.

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

11 years agoRefactor some code into a new skipRValueSubobjectAdjustments function.
Rafael Espindola [Sat, 27 Oct 2012 00:40:06 +0000 (00:40 +0000)]
Refactor some code into a new skipRValueSubobjectAdjustments function.

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

11 years agoDelay codegen to after collecting all SubobjectAdjustment so that the collection
Rafael Espindola [Sat, 27 Oct 2012 00:36:38 +0000 (00:36 +0000)]
Delay codegen to after collecting all SubobjectAdjustment so that the collection
can be refactored and used in Sema.

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

11 years agoFix typo.
Eli Friedman [Fri, 26 Oct 2012 23:25:42 +0000 (23:25 +0000)]
Fix typo.

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

11 years agoAdd missing safety check to an optimization for do-while loops. PR14191.
Eli Friedman [Fri, 26 Oct 2012 23:23:35 +0000 (23:23 +0000)]
Add missing safety check to an optimization for do-while loops.  PR14191.

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

11 years agoFix indentation.
Eli Friedman [Fri, 26 Oct 2012 23:05:34 +0000 (23:05 +0000)]
Fix indentation.

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

11 years agoIn Parser::ParseDecltypeSpecifier, make sure the end location it returns
Argyrios Kyrtzidis [Fri, 26 Oct 2012 22:53:44 +0000 (22:53 +0000)]
In Parser::ParseDecltypeSpecifier, make sure the end location it returns
is at the end of parsed tokens when an error occurs, otherwise we'll hit
an assertion when trying to annotate the decltype tokens.

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

11 years agoDon't crash synthesizing an ObjC property with an empty struct type. <rdar://problem...
Eli Friedman [Fri, 26 Oct 2012 22:38:05 +0000 (22:38 +0000)]
Don't crash synthesizing an ObjC property with an empty struct type.  <rdar://problem/12547611>.

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

11 years agoWhen an externally-supplied record layout has a size that clearly
Douglas Gregor [Fri, 26 Oct 2012 22:31:14 +0000 (22:31 +0000)]
When an externally-supplied record layout has a size that clearly
doesn't include padding up to the alignment of the record, take this
as a cue that the alignment of the record should (conservatively) be
set to 1. This is similar to other the other cues we use to determine
that the record has a lower alignment, e.g., that the
externally-supplied layout places fields at lower offsets than we
would. Fixes <rdar://problem/12582052>; test case in LLDB.

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

11 years agoAdd comment for my patch in r166809.
Fariborz Jahanian [Fri, 26 Oct 2012 22:20:25 +0000 (22:20 +0000)]
Add comment for my patch in r166809.

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

11 years agoThis patch is a follow-up to r166805. As suggested on-list, a check was
Bill Schmidt [Fri, 26 Oct 2012 20:34:52 +0000 (20:34 +0000)]
This patch is a follow-up to r166805.  As suggested on-list, a check was
added to ensure no extra alignment code is added in the future.

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

11 years agoRemove BLOCK_BYREF_LAYOUT_BYREF flags from list of
Fariborz Jahanian [Fri, 26 Oct 2012 20:33:59 +0000 (20:33 +0000)]
Remove BLOCK_BYREF_LAYOUT_BYREF flags from list of
flags for __block variable meta-data.

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

11 years agoobjective-C IRGen: for @implementation nested in
Fariborz Jahanian [Fri, 26 Oct 2012 20:22:11 +0000 (20:22 +0000)]
objective-C IRGen: for @implementation nested in
extern "C", its method definitions must be IRGen'ed
before meta-data for class is generated. Otherwise,
IRGen crashes (to say the least).
// rdar://12581683

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

11 years ago[driver] Before applying the working directory check if the input path
Argyrios Kyrtzidis [Fri, 26 Oct 2012 20:09:24 +0000 (20:09 +0000)]
[driver] Before applying the working directory check if the input path
is absolute.

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

11 years agoThis patch addresses a 64-bit PowerPC ELF ABI compatibility issue with
Bill Schmidt [Fri, 26 Oct 2012 19:59:03 +0000 (19:59 +0000)]
This patch addresses a 64-bit PowerPC ELF ABI compatibility issue with
varargs parameter passing.

A strict reading of the ABI indicates that any argument with alignment greater
than 8 may require skipping doublewords in the parameter save area to align
the argument, and hence require skipping GPRs.  In practice, this is not done
by GCC.  The alignment restriction is used for internal alignment of a
structure, but a structure with 16-byte alignment, for example, is not
itself 16-byte aligned in the parameter save area.  Although this is messy,
it has become the de facto standard used in building existing libraries.

My initial varargs support followed the ABI language, but not the de facto
standard.  Running the GCC compatibility test suite exposed this issue, and
indeed showed that LLVM didn't pass parameters self-consistently with my
original logic.  Removing the additional alignment logic allows the affected
tests to now pass.

I modified the ppc64-varargs-struct.c test case to remove the existing test
for generation of alignment code, which is no longer appropriate.

Built and tested on powerpc64-unknown-linux-gnu with no new regressions.

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

11 years ago[options] Fix mishandling of aliased options that was introduced in r166444.
Argyrios Kyrtzidis [Fri, 26 Oct 2012 19:36:33 +0000 (19:36 +0000)]
[options] Fix mishandling of aliased options that was introduced in r166444.

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

11 years agotests: Tweak unprintable.c to try another character which is hopefully even more
Daniel Dunbar [Fri, 26 Oct 2012 19:15:56 +0000 (19:15 +0000)]
tests: Tweak unprintable.c to try another character which is hopefully even more
unprintable.

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

11 years ago[ms-inline asm] Add test case for r166792.
Chad Rosier [Fri, 26 Oct 2012 18:33:59 +0000 (18:33 +0000)]
[ms-inline asm] Add test case for r166792.

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

11 years ago[ms-inline asm] Test case for r166790.
Chad Rosier [Fri, 26 Oct 2012 18:04:45 +0000 (18:04 +0000)]
[ms-inline asm] Test case for r166790.

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

11 years agoMatch up anonymous structs/unions in the ASTImporter. Previously, we'd
Douglas Gregor [Fri, 26 Oct 2012 16:45:11 +0000 (16:45 +0000)]
Match up anonymous structs/unions in the ASTImporter. Previously, we'd
only actually get the answer right if there was only a single
anonymous struct/union at that level. This is part of
<rdar://problem/11904570>; the test will go into LLDB itself.

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

11 years agoAdd comments for RemoveRedundantMsgs, rename it to removeRedundantMsgs() per Jordan...
Ted Kremenek [Fri, 26 Oct 2012 16:02:36 +0000 (16:02 +0000)]
Add comments for RemoveRedundantMsgs, rename it to removeRedundantMsgs() per Jordan's feedback.

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

11 years agoEliminate some longstanding FIXMEs regarding variadic templates in the
Douglas Gregor [Fri, 26 Oct 2012 15:36:15 +0000 (15:36 +0000)]
Eliminate some longstanding FIXMEs regarding variadic templates in the
ASTImporter.

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

11 years agoIn the ASTImporter, don't try to emit a diagnostic if we're not
Douglas Gregor [Fri, 26 Oct 2012 15:34:11 +0000 (15:34 +0000)]
In the ASTImporter, don't try to emit a diagnostic if we're not
allowed to complain about a failure.

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

11 years agoRemove clang-fixit from tools page as it is currently not planned as a
Daniel Jasper [Fri, 26 Oct 2012 10:25:13 +0000 (10:25 +0000)]
Remove clang-fixit from tools page as it is currently not planned as a
separate tool.

Review: http://llvm-reviews.chandlerc.com/D81

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

11 years agoThese tests require an actual x86 registered target, so mark them as such. Tested...
David Tweed [Fri, 26 Oct 2012 10:17:44 +0000 (10:17 +0000)]
These tests require an actual x86 registered target, so mark them as such. Tested on ARM.

Patch by Joey Gouly.

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

11 years agoFix grammar-o.
Bill Wendling [Fri, 26 Oct 2012 07:02:46 +0000 (07:02 +0000)]
Fix grammar-o.

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

11 years agoFix test suppressed in r166683 on 32-bit Linux
Alexey Samsonov [Fri, 26 Oct 2012 07:01:51 +0000 (07:01 +0000)]
Fix test suppressed in r166683 on 32-bit Linux

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

11 years agoDeclare type of flags to be used in a __block (byref)
Fariborz Jahanian [Fri, 26 Oct 2012 01:13:38 +0000 (01:13 +0000)]
Declare type of flags to be used in a __block (byref)
variable descriptor captured by a block.

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

11 years agoOz optimization level sets ForceSizeOpt attribute for each function
Quentin Colombet [Fri, 26 Oct 2012 00:29:48 +0000 (00:29 +0000)]
Oz optimization level sets ForceSizeOpt attribute for each function

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

11 years agoX86 SSE Intrinsics: update header for sqrt_ss, rsqrt_ss and rcp_ss.
Manman Ren [Fri, 26 Oct 2012 00:25:10 +0000 (00:25 +0000)]
X86 SSE Intrinsics: update header for sqrt_ss, rsqrt_ss and rcp_ss.

There intrinsics pass through the upper FP values from the input.
rdar://12558838

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

11 years agoRecommit Eric's code to validate ASM string's constraints and modifiers.
Bill Wendling [Thu, 25 Oct 2012 23:28:48 +0000 (23:28 +0000)]
Recommit Eric's code to validate ASM string's constraints and modifiers.

This code checks the ASM string to see if the output size is able to fit within
the variable specified as the output. For instance, scalar-to-vector conversions
may not really work. It's on by default, but can be turned off with a flag if
you think you know what you're doing.

This is placed under a flag ('-Wasm-operand-widths') and flag group ('-Wasm').

<rdar://problem/12284092>

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

11 years agoFix the other occurrence of the problem fixed by r166731.
Richard Smith [Thu, 25 Oct 2012 23:05:00 +0000 (23:05 +0000)]
Fix the other occurrence of the problem fixed by r166731.

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

11 years agoChanging name of enum for block literal flags to represent
Fariborz Jahanian [Thu, 25 Oct 2012 22:55:52 +0000 (22:55 +0000)]
Changing name of enum for block literal flags to represent
what it is meant for.

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

11 years agoLLVM's hashing routines produce a size_t, and thus generate different values for...
Richard Smith [Thu, 25 Oct 2012 22:27:30 +0000 (22:27 +0000)]
LLVM's hashing routines produce a size_t, and thus generate different values for 32- and 64-bit host compilers. This really needs to be fixed -- the IR generated should not depend on the host -- but this change will get the bots green again. Proper fix to follow.

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

11 years agoTrackConstraintBRVisitor and ConditionBRVisitor can emit similar
Ted Kremenek [Thu, 25 Oct 2012 22:07:10 +0000 (22:07 +0000)]
TrackConstraintBRVisitor and ConditionBRVisitor can emit similar
path notes for cases where a value may be assumed to be null, etc.
Instead of having redundant diagnostics, do a pass over the generated
PathDiagnostic pieces and remove notes from TrackConstraintBRVisitor
that are already covered by ConditionBRVisitor, whose notes tend
to be better.

Fixes <rdar://problem/12252783>

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

11 years agoAdd a more direct test for r166661.
Richard Smith [Thu, 25 Oct 2012 21:59:45 +0000 (21:59 +0000)]
Add a more direct test for r166661.

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

11 years ago[ms-inline asm] Add a test case for r166723 and r166724.
Chad Rosier [Thu, 25 Oct 2012 21:52:03 +0000 (21:52 +0000)]
[ms-inline asm] Add a test case for r166723 and r166724.

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

11 years ago[ms-inline asm] Add support for field lookup in the SemaCallback. Patch by Eli.
Chad Rosier [Thu, 25 Oct 2012 21:49:22 +0000 (21:49 +0000)]
[ms-inline asm] Add support for field lookup in the SemaCallback.  Patch by Eli.

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

11 years agoAdd some new types in preparation of encoding of captured block variable
Fariborz Jahanian [Thu, 25 Oct 2012 21:15:04 +0000 (21:15 +0000)]
Add some new types in preparation of encoding of captured block variable
layout meta-data work. wip.

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

11 years agoDon't require exception handling for clang-tblgen.
Joerg Sonnenberger [Thu, 25 Oct 2012 20:34:00 +0000 (20:34 +0000)]
Don't require exception handling for clang-tblgen.

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

11 years agoMove the input files for test/PCH/badpch.c under test/PCH/Inputs/.
Kaelyn Uhrain [Thu, 25 Oct 2012 19:43:57 +0000 (19:43 +0000)]
Move the input files for test/PCH/badpch.c under test/PCH/Inputs/.

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

11 years agoWhen capturing 'this' in a lambda, make sure to update the set of
Douglas Gregor [Thu, 25 Oct 2012 18:39:16 +0000 (18:39 +0000)]
When capturing 'this' in a lambda, make sure to update the set of
array-index starting values for the 'this' capture. Fixes
<rdar://problem/12426831>.

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

11 years agoComment to XML conversion: avoid memory allocation while pretty-printing the
Dmitri Gribenko [Thu, 25 Oct 2012 18:28:26 +0000 (18:28 +0000)]
Comment to XML conversion: avoid memory allocation while pretty-printing the
declaration.

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

11 years agoCommentDumper: reorder members and add a comment.
Dmitri Gribenko [Thu, 25 Oct 2012 18:16:02 +0000 (18:16 +0000)]
CommentDumper: reorder members and add a comment.

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

11 years agoProvide comment describing what buildBlockDescriptor does.
Fariborz Jahanian [Thu, 25 Oct 2012 18:06:53 +0000 (18:06 +0000)]
Provide comment describing what buildBlockDescriptor does.

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

11 years agoDon't throw exceptions in clang-tblgen by switching to PrintFatalError.
Joerg Sonnenberger [Thu, 25 Oct 2012 16:37:08 +0000 (16:37 +0000)]
Don't throw exceptions in clang-tblgen by switching to PrintFatalError.
Add locations in a number of places, where they are available for free.

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

11 years agoCleanup some clang code to use new type functions instead of using cast<>.
Micah Villmow [Thu, 25 Oct 2012 15:39:14 +0000 (15:39 +0000)]
Cleanup some clang code to use new type functions instead of using cast<>.

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

11 years agoclang/test/CodeGenCXX/debug-info-thunk.cpp: Suppress it for now with XFAIL:*, due...
NAKAMURA Takumi [Thu, 25 Oct 2012 14:43:34 +0000 (14:43 +0000)]
clang/test/CodeGenCXX/debug-info-thunk.cpp: Suppress it for now with XFAIL:*, due to failing on i686-*-*.

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

11 years agoCorrect test inovocations to use %clang_cc1 rather than direct invocation (so that...
David Tweed [Thu, 25 Oct 2012 13:56:30 +0000 (13:56 +0000)]
Correct test inovocations to use %clang_cc1 rather than direct invocation (so that it can have additional options set when trying to debug issues causing regressions).

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

11 years agoModify the targets to set appropriate calling convention defaults and C variables...
David Tweed [Thu, 25 Oct 2012 13:33:01 +0000 (13:33 +0000)]
Modify the targets to set appropriate calling convention defaults and C variables when using a gnueabihf or aapcs-vfp target.

Tested by me and Wei-Ren Chen.

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

11 years agoInitialize debug info for special cases of functions that lack declarations and are...
Alexey Samsonov [Thu, 25 Oct 2012 10:18:50 +0000 (10:18 +0000)]
Initialize debug info for special cases of functions that lack declarations and are generated by Clang (global initializers/destructors, thunks) . Fixes PR13942.

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

11 years agounittests/ToolingTest.cpp: Suppress newFrontendActionFactory.InjectsEndOfSourceFileCa...
NAKAMURA Takumi [Thu, 25 Oct 2012 09:38:41 +0000 (09:38 +0000)]
unittests/ToolingTest.cpp: Suppress newFrontendActionFactory.InjectsEndOfSourceFileCallback on Win32 for now. Investigating.

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

11 years agoAdds the possibility to inject a callback that's called after each translation unit...
Manuel Klimek [Thu, 25 Oct 2012 08:49:11 +0000 (08:49 +0000)]
Adds the possibility to inject a callback that's called after each translation unit is processed.

This is important when one wants to deduplicate results during one run over a translation unit by pointer identity of AST nodes.

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

11 years ago-fcatch-undefined-behavior checking for appropriate vptr value: Clang CodeGen side.
Richard Smith [Thu, 25 Oct 2012 02:14:12 +0000 (02:14 +0000)]
-fcatch-undefined-behavior checking for appropriate vptr value: Clang CodeGen side.

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

11 years agoTake into account that there may be a BOM at the beginning of the file,
Argyrios Kyrtzidis [Thu, 25 Oct 2012 01:51:45 +0000 (01:51 +0000)]
Take into account that there may be a BOM at the beginning of the file,
when computing the size of the precompiled preamble.

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

11 years agoUpdate warning-flag test
Douglas Gregor [Thu, 25 Oct 2012 00:34:38 +0000 (00:34 +0000)]
Update warning-flag test

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

11 years agoRevert r166647 to rethink the patch...
Bill Wendling [Thu, 25 Oct 2012 00:32:44 +0000 (00:32 +0000)]
Revert r166647 to rethink the patch...

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

11 years agoRemove the old predefines-buffer diffing code completely. It's been
Douglas Gregor [Thu, 25 Oct 2012 00:30:23 +0000 (00:30 +0000)]
Remove the old predefines-buffer diffing code completely. It's been
replaced by the more efficient, cleaner preprocessor-option version
that occurs earlier in PCH validation.

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

11 years agoFix computation of predefines buffer from the preprocessor-option
Douglas Gregor [Thu, 25 Oct 2012 00:25:27 +0000 (00:25 +0000)]
Fix computation of predefines buffer from the preprocessor-option
checking, and disable the old predefines-buffer-diff'ing code path.

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

11 years agoWhen we're devirtualizing a method call, make sure the method has the correct IR...
Eli Friedman [Thu, 25 Oct 2012 00:12:49 +0000 (00:12 +0000)]
When we're devirtualizing a method call, make sure the method has the correct IR type.

Reported in the thread "devirtualisation appears to crash clang on covariant functions on ARM" on cfe-dev.

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