]> granicus.if.org Git - clang/log
clang
11 years agoArrayRef'ize InitializationSequence constructor and InitializationSequence::Diagnose()
Dmitri Gribenko [Fri, 3 May 2013 15:05:50 +0000 (15:05 +0000)]
ArrayRef'ize InitializationSequence constructor and InitializationSequence::Diagnose()

Patch by Robert Wilhelm.

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

11 years agoInitialize WarnOnSpellCheck.
Rafael Espindola [Fri, 3 May 2013 15:01:36 +0000 (15:01 +0000)]
Initialize WarnOnSpellCheck.

Clang always calls setWarnOnSpellCheck, but we shouldn't require every client to
do so.

Issue noticed by Enea Zaffanella.

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

11 years agoAdd space between ; and (.
Daniel Jasper [Fri, 3 May 2013 14:50:50 +0000 (14:50 +0000)]
Add space between ; and (.

Before: for (int i = 0;(i < 10); ++i) {}
After:  for (int i = 0; (i < 10); ++i) {}

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

11 years agoFix expression recognition in for-loops.
Daniel Jasper [Fri, 3 May 2013 14:41:24 +0000 (14:41 +0000)]
Fix expression recognition in for-loops.

Before: for (; a&& b;) {}
After:  for (; a && b;) {}

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

11 years agoAdd const qualifier to Sema::getTypeName's parameter `II`
Dmitri Gribenko [Fri, 3 May 2013 13:12:11 +0000 (13:12 +0000)]
Add const qualifier to Sema::getTypeName's parameter `II`

Patch by Ismail Pazarbasi.

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

11 years agoAdd support for -march=btver2.
Benjamin Kramer [Fri, 3 May 2013 10:47:15 +0000 (10:47 +0000)]
Add support for -march=btver2.

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

11 years agoSupport __wchar_t in -fms-extensions and -fms-compatibility modes.
Hans Wennborg [Fri, 3 May 2013 09:10:16 +0000 (09:10 +0000)]
Support __wchar_t in -fms-extensions and -fms-compatibility modes.

MSVC provides __wchar_t, either as an alias for the built-in wchar_t
type, or as a separate type depending on language (C vs C++) and flags
(-fno-wchar).

In -fms-extensions, Clang will simply accept __wchar_t as an alias for
whatever type is used for wide character literals. In -fms-compatibility, we
try to mimic MSVC's behavior by always making __wchar_t a builtin type.

This fixes PR15815.

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

11 years agoCorrectly emit certain implicit references to 'self' even within
John McCall [Fri, 3 May 2013 07:33:41 +0000 (07:33 +0000)]
Correctly emit certain implicit references to 'self' even within
a lambda.

Bug #1 is that CGF's CurFuncDecl was "stuck" at lambda invocation
functions.  Fix that by generally improving getNonClosureContext
to look through lambdas and captured statements but only report
code contexts, which is generally what's wanted.  Audit uses of
CurFuncDecl and getNonClosureAncestor for correctness.

Bug #2 is that lambdas weren't specially mapping 'self' when inside
an ObjC method.  Fix that by removing the requirement for that
and using the normal EmitDeclRefLValue path in LoadObjCSelf.

rdar://13800041

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

11 years ago[analyzer] Check the stack frame when looking for a var's initialization.
Jordan Rose [Fri, 3 May 2013 05:47:31 +0000 (05:47 +0000)]
[analyzer] Check the stack frame when looking for a var's initialization.

FindLastStoreBRVisitor is responsible for finding where a particular region
gets its value; if the region is a VarRegion, it's possible that value was
assigned at initialization, i.e. at its DeclStmt. However, if a function is
called recursively, the same DeclStmt may be evaluated multiple times in
multiple stack frames. FindLastStoreBRVisitor was not taking this into
account and just picking the first one it saw.

<rdar://problem/13787723>

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

11 years ago[analyzer] Fix trackNullOrUndef when tracking args that have nil receivers.
Jordan Rose [Fri, 3 May 2013 05:47:24 +0000 (05:47 +0000)]
[analyzer] Fix trackNullOrUndef when tracking args that have nil receivers.

There were actually two bugs here:
- if we decided to look for an interesting lvalue or call expression, we
  wouldn't go find its node if we also knew we were at a (different) call.
- if we looked through one message send with a  nil receiver, we thought we
  were still looking at an argument to the original call.

Put together, this kept us from being able to track the right values, which
means sub-par diagnostics and worse false-positive suppression.

Noticed by inspection.

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

11 years agoRevert "Attempt to un-break the gdb buildbot."
Adrian Prantl [Fri, 3 May 2013 01:42:35 +0000 (01:42 +0000)]
Revert "Attempt to un-break the gdb buildbot."

This reverts commit 180982.

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

11 years agoMake cleanUpLocation() a self-contained function.
Ted Kremenek [Fri, 3 May 2013 01:16:26 +0000 (01:16 +0000)]
Make cleanUpLocation() a self-contained function.

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

11 years ago[ms-cxxabi] Emit non-virtual member function pointers
Reid Kleckner [Fri, 3 May 2013 01:15:11 +0000 (01:15 +0000)]
[ms-cxxabi] Emit non-virtual member function pointers

Without any conversion, this is pretty straightforward.  Most of the
fields can be zeros.  The order is:

- field offset or pointer
- nonvirtual adjustment (for MI functions)
- vbptr offset (for unspecified)
- virtual adjustment offset (for virtual inheritance)

Differential Revision: http://llvm-reviews.chandlerc.com/D699

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

11 years agoAttempt to un-break the gdb buildbot.
Adrian Prantl [Fri, 3 May 2013 00:44:13 +0000 (00:44 +0000)]
Attempt to un-break the gdb buildbot.
- Use the debug location of the return expression for the cleanup code
  if the return expression is trivially evaluatable, regardless of the
  number of stop points in the function.
- Ensure that any EH code in the cleanup still gets the line number of
  the closing } of the lexical scope.
- Added a testcase with EH in the cleanup.

rdar://problem/13442648

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

11 years agoRe-apply 180974 with the build error fixed. This was the result
Ted Kremenek [Fri, 3 May 2013 00:32:44 +0000 (00:32 +0000)]
Re-apply 180974 with the build error fixed.  This was the result
of a weird merge error with git.

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

11 years agoRevert "Change LocationContextMap to be a temporary instead of shared variable in...
Rafael Espindola [Fri, 3 May 2013 00:22:49 +0000 (00:22 +0000)]
Revert "Change LocationContextMap to be a temporary instead of shared variable in BugReporter."

This reverts commit 180974. It broke the build.

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

11 years agoMove parsing of identifiers in MS-style inline assembly into
John McCall [Fri, 3 May 2013 00:10:13 +0000 (00:10 +0000)]
Move parsing of identifiers in MS-style inline assembly into
the actual parser and support arbitrary id-expressions.

We're actually basically set up to do arbitrary expressions here
if we wanted to.

Assembly operands permit things like A::x to be written regardless
of language mode, which forces us to embellish the evaluation
context logic somewhat.  The logic here under template instantiation
is incorrect;  we need to preserve the fact that an expression was
unevaluated.  Of course, template instantiation in general is fishy
here because we have no way of delaying semantic analysis in the
MC parser.  It's all just fishy.

I've also fixed the serialization of MS asm statements.

This commit depends on an LLVM commit.

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

11 years agoChange LocationContextMap to be a temporary instead of shared variable in BugReporter.
Ted Kremenek [Thu, 2 May 2013 23:56:33 +0000 (23:56 +0000)]
Change LocationContextMap to be a temporary instead of shared variable in BugReporter.

BugReporter is used to process ALL bug reports.  By using a shared map,
we are having mappings from different PathDiagnosticPieces to LocationContexts
well beyond the point where we are processing a given report.  This
state is inherently error prone, and is analogous to using a global
variable.  Instead, just create a temporary map, one per report,
and when we are done with it we throw it away.  No extra state.

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

11 years agoUse attribute argument information to determine when to parse attribute arguments...
Douglas Gregor [Thu, 2 May 2013 23:25:32 +0000 (23:25 +0000)]
Use attribute argument information to determine when to parse attribute arguments as expressions.

This change partly addresses a heinous problem we have with the
parsing of attribute arguments that are a lone identifier. Previously,
we would end up parsing the 'align' attribute of this as an expression
"(Align)":

 template<unsigned Size, unsigned Align>
 class my_aligned_storage
 {
   __attribute__((align((Align)))) char storage[Size];
 };

while this would parse as a "parameter name" 'Align':

 template<unsigned Size, unsigned Align>
 class my_aligned_storage
 {
   __attribute__((align(Align))) char storage[Size];
 };

The code that handles the alignment attribute would completely ignore
the parameter name, so the while the first of these would do what's
expected, the second would silently be equivalent to

 template<unsigned Size, unsigned Align>
 class my_aligned_storage
 {
   __attribute__((align)) char storage[Size];
 };

i.e., use the maximal alignment rather than the specified alignment.

Address this by sniffing the "Args" provided in the TableGen
description of attributes. If the first argument is "obviously"
something that should be treated as an expression (rather than an
identifier to be matched later), parse it as an expression.

Fixes <rdar://problem/13700933>.

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

11 years agoRevert r180970; it's causing breakage.
Douglas Gregor [Thu, 2 May 2013 23:15:45 +0000 (23:15 +0000)]
Revert r180970; it's causing breakage.

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

11 years agoUse attribute argument information to determine when to parse attribute arguments...
Douglas Gregor [Thu, 2 May 2013 23:08:12 +0000 (23:08 +0000)]
Use attribute argument information to determine when to parse attribute arguments as expressions.

This change partly addresses a heinous problem we have with the
parsing of attribute arguments that are a lone identifier. Previously,
we would end up parsing the 'align' attribute of this as an expression
"(Align)":

  template<unsigned Size, unsigned Align>
  class my_aligned_storage
  {
    __attribute__((align((Align)))) char storage[Size];
  };

while this would parse as a "parameter name" 'Align':

  template<unsigned Size, unsigned Align>
  class my_aligned_storage
  {
    __attribute__((align(Align))) char storage[Size];
  };

The code that handles the alignment attribute would completely ignore
the parameter name, so the while the first of these would do what's
expected, the second would silently be equivalent to

  template<unsigned Size, unsigned Align>
  class my_aligned_storage
  {
    __attribute__((align)) char storage[Size];
  };

i.e., use the maximal alignment rather than the specified alignment.

Address this by sniffing the "Args" provided in the TableGen
description of attributes. If the first argument is "obviously"
something that should be treated as an expression (rather than an
identifier to be matched later), parse it as an expression.

Fixes <rdar://problem/13700933>.

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

11 years agoRemove redundant flag.
Bill Wendling [Thu, 2 May 2013 22:53:00 +0000 (22:53 +0000)]
Remove redundant flag.

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

11 years agoWe don't want FP elimination when doing an Apple-style build.
Bill Wendling [Thu, 2 May 2013 21:09:11 +0000 (21:09 +0000)]
We don't want FP elimination when doing an Apple-style build.

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

11 years ago[analyzer] Don't try to evaluate MaterializeTemporaryExpr as a constant.
Jordan Rose [Thu, 2 May 2013 19:51:20 +0000 (19:51 +0000)]
[analyzer] Don't try to evaluate MaterializeTemporaryExpr as a constant.

...and don't consider '0' to be a null pointer constant if it's the
initializer for a float!

Apparently null pointer constant evaluation looks through both
MaterializeTemporaryExpr and ImplicitCastExpr, so we have to be more
careful about types in the callers. For RegionStore this just means giving
up a little more; for ExprEngine this means handling the
MaterializeTemporaryExpr case explicitly.

Follow-up to r180894.

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

11 years agoUse the Itanium ABI for thread_local on Darwin.
Bill Wendling [Thu, 2 May 2013 19:18:03 +0000 (19:18 +0000)]
Use the Itanium ABI for thread_local on Darwin.

After some discussion, it was decided to use the Itanium ABI for thread_local on
Darwin OS X platforms. This involved a couple of changes. First, we use
"_tlv_atexit" instead of "__cxa_thread_atexit". Secondly, the global variables
are marked with 'internal' linkage, because we want all access to be calls to
the Itanium-specific entry point, which has normal linkage.
<rdar://problem/13733006>

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

11 years agoFix crasher when the range in a C++ range-for loop has an ill-formed initializer.
Douglas Gregor [Thu, 2 May 2013 18:35:56 +0000 (18:35 +0000)]
Fix crasher when the range in a C++ range-for loop has an ill-formed initializer.

Fixes <rdar://problem/13712739>.

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

11 years agoWhen looking for the module associated with one of our magical builtin headers, specu...
Douglas Gregor [Thu, 2 May 2013 17:58:30 +0000 (17:58 +0000)]
When looking for the module associated with one of our magical builtin headers, speculatively load module maps.

The "magical" builtin headers are the headers we provide as part of
the C standard library, which typically comes from /usr/include. We
essentially merge our headers into that location (due to cyclic
dependencies). This change makes sure that, when header search finds
one of our builtin headers, we figure out which module it actually
lives in. This case is fairly rare; one ends up having to include one
of the few built-in C headers we provide before including anything
from /usr/include to trigger it. Fixes <rdar://problem/13787184>.

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

11 years agoBasic clang-format integration for BBEdit.
Daniel Jasper [Thu, 2 May 2013 17:37:36 +0000 (17:37 +0000)]
Basic clang-format integration for BBEdit.

Thanks to Avi Drissman!

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

11 years agoEnsure that the line table for functions with cleanups is sequential.
Adrian Prantl [Thu, 2 May 2013 17:30:20 +0000 (17:30 +0000)]
Ensure that the line table for functions with cleanups is sequential.

If there is cleanup code, the cleanup code gets the debug location of
the closing '}'. The subsequent ret IR-instruction does not get a
debug location. The return _expression_ will get the debug location
of the return statement.

If the function contains only a single, simple return statement,
the cleanup code may become the first breakpoint in the function.
In this case we set the debug location for the cleanup code
to the location of the return statement.

rdar://problem/13442648

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

11 years agoUse a more idiomatic way to disable debug locations.
Adrian Prantl [Thu, 2 May 2013 17:30:16 +0000 (17:30 +0000)]
Use a more idiomatic way to disable debug locations.

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

11 years agoUse a triple ensure that __has_feature(c_thread_local) is 1 in C11 mode.
Douglas Gregor [Thu, 2 May 2013 16:22:34 +0000 (16:22 +0000)]
Use a triple ensure that __has_feature(c_thread_local) is 1 in C11 mode.

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

11 years ago[document parsing]: support c++11 type aliases
Fariborz Jahanian [Thu, 2 May 2013 15:44:16 +0000 (15:44 +0000)]
[document parsing]: support c++11 type aliases
with no comment of their own to inherit the
comment of their aliased type. // rdar://13752382

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

11 years agoMake sure we define wchar_t related macros correctly in -fms-extensions mode.
Hans Wennborg [Thu, 2 May 2013 13:12:32 +0000 (13:12 +0000)]
Make sure we define wchar_t related macros correctly in -fms-extensions mode.

This adds a test to make sure we define _WCHAR_T_DEFINED and
_NATIVE_WCHAR_T_DEFINED correctly in the preprocessor, and updates
stddef.h to set it when typedeffing wchar_t.

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

11 years agoFix typo in a stddef.h comment: s/risze_t/rsize_t/
Hans Wennborg [Thu, 2 May 2013 10:36:31 +0000 (10:36 +0000)]
Fix typo in a stddef.h comment: s/risze_t/rsize_t/

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

11 years agoOnly evaluate __has_feature(c_thread_local) and __has_feature(cxx_thread_local) true...
Douglas Gregor [Thu, 2 May 2013 05:28:32 +0000 (05:28 +0000)]
Only evaluate __has_feature(c_thread_local) and __has_feature(cxx_thread_local) true when the target supports thread-local storage.

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

11 years ago[analyzer] Finally make c++-analyzer 'executable' again.
Anton Yartsev [Thu, 2 May 2013 01:57:58 +0000 (01:57 +0000)]
[analyzer] Finally make c++-analyzer 'executable' again.

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

11 years ago[analyzer] RetainCountChecker: don't track through xpc_connection_set_context.
Jordan Rose [Thu, 2 May 2013 01:51:40 +0000 (01:51 +0000)]
[analyzer] RetainCountChecker: don't track through xpc_connection_set_context.

It is unfortunate that we have to mark these exceptions in multiple places.
This was already in CallEvent. I suppose it does let us be more precise
about saying /which/ arguments have their retain counts invalidated -- the
connection's is still valid even though the context object's isn't -- but
we're not tracking the retain count of XPC objects anyway.

<rdar://problem/13783514>

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

11 years ago[analyzer] Recreated as a file.
Anton Yartsev [Thu, 2 May 2013 01:41:51 +0000 (01:41 +0000)]
[analyzer] Recreated as a file.

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

11 years ago[analyzer] Temporary remove c++analyzer to recreate it as a separate file, not a...
Anton Yartsev [Thu, 2 May 2013 01:36:41 +0000 (01:36 +0000)]
[analyzer] Temporary remove c++analyzer to recreate it as a separate file, not a symlink.

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

11 years ago[analyzer] Added 'executable' property to c++analyzer.
Anton Yartsev [Thu, 2 May 2013 01:18:17 +0000 (01:18 +0000)]
[analyzer] Added 'executable' property to c++analyzer.

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

11 years ago[analyzer] scan-build for Windows
Anton Yartsev [Thu, 2 May 2013 00:52:46 +0000 (00:52 +0000)]
[analyzer] scan-build for Windows

The patch allows Windows users to launch scan-build without any additional preparations in the same way as it described in http://clang-analyzer.llvm.org/scan-build.html. The only thing that should be done to make scan-build work from an arbitrary location is to add scan-build folder to the PATH environment variable.

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

11 years ago[analyzer] Consolidate constant evaluation logic in SValBuilder.
Jordan Rose [Wed, 1 May 2013 23:10:44 +0000 (23:10 +0000)]
[analyzer] Consolidate constant evaluation logic in SValBuilder.

Previously, this was scattered across Environment (literal expressions),
ExprEngine (default arguments), and RegionStore (global constants). The
former special-cased several kinds of simple constant expressions, while
the latter two deferred to the AST's constant evaluator.

Now, these are all unified as SValBuilder::getConstantVal(). To keep
Environment fast, the special cases for simple constant expressions have
been left in, but the main benefits are that (a) unusual constants like
ObjCStringLiterals now work as default arguments and global constant
initializers, and (b) we're not duplicating code between ExprEngine and
RegionStore.

This actually caught a bug in our test suite, which is awesome: we stop
tracking allocated memory if it's passed as an argument along with some
kind of callback, but not if the callback is 0. We were testing this in
a case where the callback parameter had a default value, but that value
was 0. After this change, the analyzer now (correctly) flags that as a
leak!

<rdar://problem/13773117>

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

11 years ago[analyzer] Don't inline the [cd]tors of C++ iterators.
Jordan Rose [Wed, 1 May 2013 22:39:31 +0000 (22:39 +0000)]
[analyzer] Don't inline the [cd]tors of C++ iterators.

This goes with r178516, which instructed the analyzer not to inline the
constructors and destructors of C++ container classes. This goes a step
further and does the same thing for iterators, so that the analyzer won't
falsely decide we're trying to construct an iterator pointing to a
nonexistent element.

The heuristic for determining whether something is an iterator is the
presence of an 'iterator_category' member. This is controlled under the
same -analyzer-config option as container constructor/destructor inlining:
'c++-container-inlining'.

<rdar://problem/13770187>

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

11 years ago[documenting declaration]: Remove arc liftime qualifiers
Fariborz Jahanian [Wed, 1 May 2013 20:53:21 +0000 (20:53 +0000)]
[documenting declaration]: Remove arc liftime qualifiers
when doccumenting declrations in comments.
// rdar://13757500

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

11 years agoFix typo in FileCheck.
Chad Rosier [Wed, 1 May 2013 20:10:14 +0000 (20:10 +0000)]
Fix typo in FileCheck.

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

11 years ago[inline asm] Add a test case for r180873. Test case needs to be on the clang
Chad Rosier [Wed, 1 May 2013 19:50:45 +0000 (19:50 +0000)]
[inline asm] Add a test case for r180873. Test case needs to be on the clang
side because we need an inline asm diagnostics handler in place.  Unfortunately,
we emit a .s file because we need to build the SelectionDAG to hit the backend
issue.
rdar://13446483

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

11 years agoFix spurious trailing comma when printing some of the __c11_atomic_* builtins. Patch...
Richard Smith [Wed, 1 May 2013 19:02:43 +0000 (19:02 +0000)]
Fix spurious trailing comma when printing some of the __c11_atomic_* builtins. Patch by Joe Sprowes!

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

11 years agoPR15884: In the 'taking the address of a temporary' extension, materialize the
Richard Smith [Wed, 1 May 2013 19:00:39 +0000 (19:00 +0000)]
PR15884: In the 'taking the address of a temporary' extension, materialize the
temporary to an lvalue before taking its address. This removes a weird special
case from the AST representation, and allows the constant expression evaluator
to deal with it without (broken) hacks.

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

11 years agoRe-apply "[analyzer] Model casts to bool differently from other numbers."
Jordan Rose [Wed, 1 May 2013 18:19:59 +0000 (18:19 +0000)]
Re-apply "[analyzer] Model casts to bool differently from other numbers."

This doesn't appear to be the cause of the slowdown. I'll have to try a
manual bisect to see if there's really anything there, or if it's just
the bot itself taking on additional load. Meanwhile, this change helps
with correctness.

This changes an assertion and adds a test case, then re-applies r180638,
which was reverted in r180714.

<rdar://problem/13296133> and PR15863

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

11 years agoFix buildbot yet again. // rdar://13757500.
Fariborz Jahanian [Wed, 1 May 2013 17:58:21 +0000 (17:58 +0000)]
Fix buildbot yet again. // rdar://13757500.

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

11 years agoattempt to fix the buildbot failure.
Fariborz Jahanian [Wed, 1 May 2013 17:47:05 +0000 (17:47 +0000)]
attempt to fix the buildbot failure.

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

11 years ago[ObjC declaration documentation] declaration of
Fariborz Jahanian [Wed, 1 May 2013 17:28:37 +0000 (17:28 +0000)]
[ObjC declaration documentation] declaration of
types involving Objective-C pointers must have
their arc qualifiers elided as they don't
add any additional info. // rdar://13757500.

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

11 years agoAs of r180836, these tests should no longer be XFAILed on Windows.
Aaron Ballman [Wed, 1 May 2013 15:16:52 +0000 (15:16 +0000)]
As of r180836, these tests should no longer be XFAILed on Windows.

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

11 years agoPoint diagnostics that complain about a use of a selector in an objc message, to...
Argyrios Kyrtzidis [Wed, 1 May 2013 00:24:09 +0000 (00:24 +0000)]
Point diagnostics that complain about a use of a selector in an objc message, to the selector location.

Previously it would point to the left bracket or the receiver, which can be particularly
problematic if the receiver is a block literal and we end up point the diagnostic far away
for the selector that is complaining about.

rdar://13620447

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

11 years agoRevert 180817 because 180816 was reverted.
Adrian Prantl [Tue, 30 Apr 2013 22:45:09 +0000 (22:45 +0000)]
Revert 180817 because 180816 was reverted.

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

11 years agoFix PR15845: apparently MSVC does not support implicit int in C++ mode.
Richard Smith [Tue, 30 Apr 2013 22:43:51 +0000 (22:43 +0000)]
Fix PR15845: apparently MSVC does not support implicit int in C++ mode.

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

11 years agoDo not generate VLAs as complex variables any more, as they are now
Adrian Prantl [Tue, 30 Apr 2013 22:17:36 +0000 (22:17 +0000)]
Do not generate VLAs as complex variables any more, as they are now
correctly represented as breg+0 locations in the backend.

(Paired commit with LLVM: r180815)

rdar://problem/13658587

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

11 years ago[driver] Allow multiple -arch options with -save-temps by adding the arch name
Chad Rosier [Tue, 30 Apr 2013 22:01:21 +0000 (22:01 +0000)]
[driver] Allow multiple -arch options with -save-temps by adding the arch name
to the temporary files.
rdar://13218604

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

11 years ago[analyzer] scan-build: support -enable-checker with new Xcode integration.
Jordan Rose [Tue, 30 Apr 2013 22:00:04 +0000 (22:00 +0000)]
[analyzer] scan-build: support -enable-checker with new Xcode integration.

<rdar://problem/13772094>

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

11 years agoRevert r180739 and r180748: they broke C++11 thread_local on non-Darwin systems and...
Richard Smith [Tue, 30 Apr 2013 21:34:13 +0000 (21:34 +0000)]
Revert r180739 and r180748: they broke C++11 thread_local on non-Darwin systems and did not do the right thing on Darwin.

Original commit message:

Emit the TLS intialization functions into a list.

Add the TLS initialization functions to a list of initialization functions. The
back-end takes this list and places the function pointers into the correct
section. This way they're called before `main().'

<rdar://problem/13733006>

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

11 years agoWhen deducing an 'auto' type, don't modify the type-as-written.
Richard Smith [Tue, 30 Apr 2013 21:23:01 +0000 (21:23 +0000)]
When deducing an 'auto' type, don't modify the type-as-written.

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

11 years ago[ms-cxxabi] Implement member pointer comparisons
Reid Kleckner [Tue, 30 Apr 2013 20:15:14 +0000 (20:15 +0000)]
[ms-cxxabi] Implement member pointer comparisons

Summary:
Like Itanium, comparisons are basically bitwise comparisons of the two
values, with an exception for null member function pointers.  If two
function pointers are null, only the function pointer field matters for
comparison purposes.  The rest of the bits can be arbitrary.  We take
advantage of this in isZeroInitializable(), and it may matter once we
start emitting conversions.

Reviewers: rjmccall

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D695

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

11 years agoStruct-path aware TBAA: enable struct-path aware TBAA for classes.
Manman Ren [Tue, 30 Apr 2013 17:38:09 +0000 (17:38 +0000)]
Struct-path aware TBAA: enable struct-path aware TBAA for classes.

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

11 years agoDon't treat a non-deduced 'auto' type as being type-dependent. Instead, there
Richard Smith [Tue, 30 Apr 2013 13:56:41 +0000 (13:56 +0000)]
Don't treat a non-deduced 'auto' type as being type-dependent. Instead, there
are now two distinct canonical 'AutoType's: one is the undeduced 'auto'
placeholder type, and the other is a deduced-but-dependent type. All
deduced-to-a-non-dependent-type cases are still non-canonical.

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

11 years agoUse {{.*}}suffix instead of [[TC]] in places where we print the toolchain
Rafael Espindola [Tue, 30 Apr 2013 13:08:15 +0000 (13:08 +0000)]
Use {{.*}}suffix instead of [[TC]] in places where we print the toolchain
path with /. This matches linux-ld.c and should finish fixing this test on
windows.

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

11 years agoAlways use / when computing mips specific paths.
Rafael Espindola [Tue, 30 Apr 2013 12:24:40 +0000 (12:24 +0000)]
Always use / when computing mips specific paths.

We were getting paths with both / and \ in them. This should fix mips-cs-ld.c
on the windows bots.

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

11 years ago[Mips] Pass -mips16, -mmicromips, -mdsp and -mdspr2 flags to the
Simon Atanasyan [Tue, 30 Apr 2013 07:47:13 +0000 (07:47 +0000)]
[Mips] Pass -mips16, -mmicromips, -mdsp and -mdspr2 flags to the
assembler.

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

11 years agoPlace bitfield -Wconstant-conversion warning into subgroup called -Wbitfield-constant...
Ted Kremenek [Tue, 30 Apr 2013 07:10:22 +0000 (07:10 +0000)]
Place bitfield -Wconstant-conversion warning into subgroup called -Wbitfield-constant-conversion.

This is to just allow more precise diagnostic control.

Implements <rdar://problem/13766026>.

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

11 years agoFix very confusing indent in Sema.cpp.
Daniel Jasper [Tue, 30 Apr 2013 06:43:16 +0000 (06:43 +0000)]
Fix very confusing indent in Sema.cpp.

This came up during my Euro LLVM 2013 talk on clang-format and I was
asked to submit it :-).

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

11 years ago[PCH] Fix memory leak related to deserialized MacroInfo objects.
Argyrios Kyrtzidis [Tue, 30 Apr 2013 05:05:35 +0000 (05:05 +0000)]
[PCH] Fix memory leak related to deserialized MacroInfo objects.

Deserialized MacroInfos were not destroyed and if their SmallVector did heap allocation,
it was leaked.

rdar://13768967

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

11 years agoAdd support for -stdlib=libc++ in the NetBSD toolchain.
Joerg Sonnenberger [Tue, 30 Apr 2013 01:21:43 +0000 (01:21 +0000)]
Add support for -stdlib=libc++ in the NetBSD toolchain.

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

11 years agoObjective-C (mostly arc): Under ARC, we often have unneeded qualifiers
Fariborz Jahanian [Tue, 30 Apr 2013 00:30:48 +0000 (00:30 +0000)]
Objective-C (mostly arc): Under ARC, we often have unneeded qualifiers
in the diagnostics. Remove them when reporting incompatible
Objective-C pointer types. // rdar://13752880.

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

11 years agoModify triple to try to make it pass on ARM.
Bill Wendling [Mon, 29 Apr 2013 23:14:24 +0000 (23:14 +0000)]
Modify triple to try to make it pass on ARM.

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

11 years agoJust use std::list<> for PathPieces instead of complicated use of ilist.
Ted Kremenek [Mon, 29 Apr 2013 23:13:02 +0000 (23:13 +0000)]
Just use std::list<> for PathPieces instead of complicated use of ilist.

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

11 years agoRevert "[analyzer] Change PathPieces to be a wrapper around an ilist of (through...
Ted Kremenek [Mon, 29 Apr 2013 23:12:59 +0000 (23:12 +0000)]
Revert "[analyzer] Change PathPieces to be a wrapper around an ilist of (through indirection) PathDiagnosticPieces."

Jordan rightly pointed out that we can do the same with std::list.

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

11 years ago[analyzer] Change PathPieces to be a wrapper around an ilist of (through indirection...
Ted Kremenek [Mon, 29 Apr 2013 22:38:26 +0000 (22:38 +0000)]
[analyzer] Change PathPieces to be a wrapper around an ilist of (through indirection) PathDiagnosticPieces.

Much of this patch outside of PathDiagnostics.h are just minor
syntactic changes due to the return type for operator* and the like
changing for the iterator, so the real focus should be on
PathPieces itself.

This change is motivated so that we can do efficient insertion
and removal of individual pieces from within a PathPiece, just like
this was a kind of "IR" for static analyzer diagnostics.  We
currently implement path transformations by iterating over an
entire PathPiece and making a copy.  This isn't very natural for
some algorithms.

We use an ilist here instead of std::list because we want operations
to rip out/insert nodes in place, just like IR manipulation.  This
isn't being used yet, but opens the door for more powerful
transformation algorithms on diagnostic paths.

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

11 years ago[analyzer] Remove comparePath's dependency on subscript operator.
Ted Kremenek [Mon, 29 Apr 2013 22:38:22 +0000 (22:38 +0000)]
[analyzer] Remove comparePath's dependency on subscript operator.

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

11 years agoEmit the TLS intialization functions into a list.
Bill Wendling [Mon, 29 Apr 2013 22:27:16 +0000 (22:27 +0000)]
Emit the TLS intialization functions into a list.

Add the TLS initialization functions to a list of initialization functions. The
back-end takes this list and places the function pointers into the correct
section. This way they're called before `main().'

<rdar://problem/13733006>

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

11 years agoc language: diagnose use of "[*]" on any array dimension
Fariborz Jahanian [Mon, 29 Apr 2013 22:01:25 +0000 (22:01 +0000)]
c language: diagnose use of "[*]" on any array dimension
in the parameter of a function definition. Currently,
it crashes in irgen if it is on other than the 1st dimension.
// rdar://13705391

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

11 years agoUse ArrayRef in AddMethodCandidate.
Rafael Espindola [Mon, 29 Apr 2013 19:29:25 +0000 (19:29 +0000)]
Use ArrayRef in AddMethodCandidate.

Patch by Robert Wilhelm!

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

11 years ago[test] add missing header for the test.
Argyrios Kyrtzidis [Mon, 29 Apr 2013 17:31:48 +0000 (17:31 +0000)]
[test] add missing header for the test.

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

11 years agoWhen emitting a preprocessed file with implicit module imports, make sure line direct...
Argyrios Kyrtzidis [Mon, 29 Apr 2013 17:26:22 +0000 (17:26 +0000)]
When emitting a preprocessed file with implicit module imports, make sure line directives are emitted in the next line.

rdar://13722737

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

11 years ago[analyzer] scan-view: don't ever serve absolute paths.
Jordan Rose [Mon, 29 Apr 2013 17:23:06 +0000 (17:23 +0000)]
[analyzer] scan-view: don't ever serve absolute paths.

At one point in time scan-view allowed absolute paths to reference files
within the server root, but this doesn't seem to be used anymore, and
caused problems if a server-root-relative path actually matched an
absolute path to an existing file. This patch just treats paths as
server-root-relative all the time.

PR15843

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

11 years agoRevert "[analyzer] Model casts to bool differently from other numbers."
Jordan Rose [Mon, 29 Apr 2013 17:23:03 +0000 (17:23 +0000)]
Revert "[analyzer] Model casts to bool differently from other numbers."

This seems to be causing quite a slowdown on our internal analyzer bot,
and I'm not sure why. Needs further investigation.

This reverts r180638 / 9e161ea981f22ae017b6af09d660bfc3ddf16a09.

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

11 years agoFix a typo in a parse assert.
Fariborz Jahanian [Mon, 29 Apr 2013 15:35:35 +0000 (15:35 +0000)]
Fix a typo in a parse assert.
Patch by Alex Denisov.

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

11 years agoSmall CapturedStmt improvements
Ben Langmuir [Mon, 29 Apr 2013 13:32:41 +0000 (13:32 +0000)]
Small CapturedStmt improvements

Add a CapturedStmt.h similar to Lambda.h to reduce the typing required to get
to the CapturedRegionKind enum. This also allows codegen to access this enum
without including Sema/ScopeInfo.h.

Also removes some duplicated code for capturing 'this' between CapturedStmt and
Lambda.

Differential Revision: http://llvm-reviews.chandlerc.com/D712

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

11 years agoTest commit
Ben Langmuir [Mon, 29 Apr 2013 13:07:42 +0000 (13:07 +0000)]
Test commit

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

11 years agoKeep the parser's template depth up to date when parsing local templates and
Richard Smith [Mon, 29 Apr 2013 11:55:38 +0000 (11:55 +0000)]
Keep the parser's template depth up to date when parsing local templates and
late-parsed templates. Patch by Faisal Vali!

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

11 years agoImplement DR580: access checks for template parameters of a class template are
Richard Smith [Mon, 29 Apr 2013 10:13:55 +0000 (10:13 +0000)]
Implement DR580: access checks for template parameters of a class template are
performed within the context of that class template. Patch by Ismail Pazarbasi!

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

11 years agoProperly reenter multiple contexts when parsing a late-parsed function template
Richard Smith [Mon, 29 Apr 2013 08:53:40 +0000 (08:53 +0000)]
Properly reenter multiple contexts when parsing a late-parsed function template
within a dependent context. Patch by Will Wilson (+clang-format)!

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

11 years agoFix an assertion failure / accepts-invalid in -fms-extensions mode. Don't build
Richard Smith [Mon, 29 Apr 2013 08:45:27 +0000 (08:45 +0000)]
Fix an assertion failure / accepts-invalid in -fms-extensions mode. Don't build
a dependent-scope id expression when a templated member function of a
non-templated class references an unknown identifier, since instantiation won't
rebuild it (and we can tell at parse time that it'll never work). Based on a
patch by Faisal Vali!

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

11 years agoArrayRef'ize Sema::ActOnEnumBody. No functionality change.
Dmitri Gribenko [Sat, 27 Apr 2013 20:23:52 +0000 (20:23 +0000)]
ArrayRef'ize Sema::ActOnEnumBody.  No functionality change.

Patch by Robert Wilhelm.

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

11 years agoDocumentation: Change UTF-8 ellipsis character to ASCII ... sequence
Dmitri Gribenko [Sat, 27 Apr 2013 16:26:29 +0000 (16:26 +0000)]
Documentation: Change UTF-8 ellipsis character to ASCII ... sequence

Patch by Dimitry Andric

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

11 years agoSilence a silly sign compare warning from GCC.
Benjamin Kramer [Sat, 27 Apr 2013 15:07:53 +0000 (15:07 +0000)]
Silence a silly sign compare warning from GCC.

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

11 years agoDocumentation: add an idea for a cpp14-migrate transform for N3421
Dmitri Gribenko [Sat, 27 Apr 2013 13:41:02 +0000 (13:41 +0000)]
Documentation: add an idea for a cpp14-migrate transform for N3421

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

11 years agoExit early when $PWD isn't set. Remove unused unistd.h include.
Benjamin Kramer [Sat, 27 Apr 2013 08:42:33 +0000 (08:42 +0000)]
Exit early when $PWD isn't set. Remove unused unistd.h include.

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

11 years agoUse LLVM's preferred current_path API instead of calling getcwd(3) directly.
Benjamin Kramer [Sat, 27 Apr 2013 08:12:29 +0000 (08:12 +0000)]
Use LLVM's preferred current_path API instead of calling getcwd(3) directly.

The existing code also failed to allocate a buffer for it so getcwd corrupted
the stack. sys::fs::current_path takes care of the memory management.

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

11 years ago[driver] Revert r180652 and 180658 and temporarily #define MAXPATHLEN to
Chad Rosier [Sat, 27 Apr 2013 01:14:43 +0000 (01:14 +0000)]
[driver] Revert r180652 and 180658 and temporarily #define MAXPATHLEN to
make the gdb tests and the Windows bots happy.

The Path::GetCurrentDirectory API is not equivalent to ::getcwd(), so
r180652 causes a gdb tests to fail.  On the other hand, <sys/param.h>
isn't defined on Windows systems, so that causes Windows builds to fail.
rdar://12237559

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

11 years agoFix the dangling pointer.
Chad Rosier [Sat, 27 Apr 2013 00:57:18 +0000 (00:57 +0000)]
Fix the dangling pointer.

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

11 years agoStruct-path aware TBAA: fix handling of may_alias attribute.
Manman Ren [Sat, 27 Apr 2013 00:39:37 +0000 (00:39 +0000)]
Struct-path aware TBAA: fix handling of may_alias attribute.

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