]> granicus.if.org Git - clang/log
clang
10 years agoDrop libgcc and default to libc++ for NetBSD/ARM on 6.99.40+.
Joerg Sonnenberger [Wed, 7 May 2014 08:45:26 +0000 (08:45 +0000)]
Drop libgcc and default to libc++ for NetBSD/ARM on 6.99.40+.
Don't bother with keeping the old support for x86_64 in 6.99.23+, just
use a single range. Update test cases for the always-on --eh-frame-hdr.

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

10 years agoAlso recognize Big Endian ARM variants.
Joerg Sonnenberger [Wed, 7 May 2014 08:24:23 +0000 (08:24 +0000)]
Also recognize Big Endian ARM variants.

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

10 years agoclang-format: Fix bad space before braced initializer.
Daniel Jasper [Wed, 7 May 2014 07:59:03 +0000 (07:59 +0000)]
clang-format: Fix bad space before braced initializer.

Before:
  new int {1};

After:
  new int{1};

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

10 years ago[OPENMP] Fixed checking for mangled names in parallel_codegen.cpp test
Alexey Bataev [Wed, 7 May 2014 07:02:29 +0000 (07:02 +0000)]
[OPENMP] Fixed checking for mangled names in parallel_codegen.cpp test

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

10 years agoFix up indentation and fix an 80 column violation.
Craig Topper [Wed, 7 May 2014 06:57:44 +0000 (06:57 +0000)]
Fix up indentation and fix an 80 column violation.

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

10 years ago[C++11] Use 'nullptr'.
Craig Topper [Wed, 7 May 2014 06:21:57 +0000 (06:21 +0000)]
[C++11] Use 'nullptr'.

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

10 years ago[OPENMP] Fixed problem with temp removal on some platforms in codegen for '#pragma...
Alexey Bataev [Wed, 7 May 2014 06:18:01 +0000 (06:18 +0000)]
[OPENMP] Fixed problem with temp removal on some platforms in codegen for '#pragma omp parallel'

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

10 years agoPR19562: Fix memory leak when ObjC interface types cause the creation of further...
David Blaikie [Wed, 7 May 2014 06:18:00 +0000 (06:18 +0000)]
PR19562: Fix memory leak when ObjC interface types cause the creation of further interfaces.

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

10 years agoFixing tests to account for LLVM r208159.
David Blaikie [Wed, 7 May 2014 06:09:35 +0000 (06:09 +0000)]
Fixing tests to account for LLVM r208159.

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

10 years ago[OPENMP] Temporarily disable test parallel_codegen.cpp
Alexey Bataev [Wed, 7 May 2014 04:47:36 +0000 (04:47 +0000)]
[OPENMP] Temporarily disable test parallel_codegen.cpp

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

10 years ago[analyzer] Use a lazily-initialized BugType in ObjCSelfInitChecker.
Jordan Rose [Wed, 7 May 2014 03:30:04 +0000 (03:30 +0000)]
[analyzer] Use a lazily-initialized BugType in ObjCSelfInitChecker.

Follow-up to Nico's leak-stopping patch in r208110.

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

10 years ago[analyzer] Functions marked __attribute__((const)) don't modify any memory.
Jordan Rose [Wed, 7 May 2014 03:29:56 +0000 (03:29 +0000)]
[analyzer] Functions marked __attribute__((const)) don't modify any memory.

This applies to __attribute__((pure)) as well, but 'const' is more interesting
because many of our builtins are marked 'const'.

PR19661

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

10 years agoIf an instantiation of a template is required to be a complete type, check
Richard Smith [Wed, 7 May 2014 02:25:43 +0000 (02:25 +0000)]
If an instantiation of a template is required to be a complete type, check
whether the definition of the template is visible rather than checking whether
the instantiated definition happens to be in an imported module.

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

10 years agoClean up some existing keyword tests in the test/Lexer directory by using the
Yunzhong Gao [Wed, 7 May 2014 01:58:02 +0000 (01:58 +0000)]
Clean up some existing keyword tests in the test/Lexer directory by using the
pre-defined __is_identifier() macro.

Differential Revision: http://reviews.llvm.org/D3460

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

10 years agoTry harder to ensure a strict weak ordering of overload candidates that
Kaelyn Takata [Wed, 7 May 2014 00:43:38 +0000 (00:43 +0000)]
Try harder to ensure a strict weak ordering of overload candidates that
have arity mismatches.

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

10 years agoRename "secondary initializer" -> "convenience initializer" in the warnings, which...
Argyrios Kyrtzidis [Tue, 6 May 2014 23:24:16 +0000 (23:24 +0000)]
Rename "secondary initializer" -> "convenience initializer" in the warnings, which is a more correct and consistent term.

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

10 years agoAST: Update reference temporary mangling
David Majnemer [Tue, 6 May 2014 22:49:16 +0000 (22:49 +0000)]
AST: Update reference temporary mangling

Summary:
Update our mangling to match the discussion on cxx-abi-dev.

This involves using a seq-id instead of an optional number.

Reviewers: rsmith

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D3631

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

10 years agoAdd testcase for r208062.
Nick Lewycky [Tue, 6 May 2014 22:28:58 +0000 (22:28 +0000)]
Add testcase for r208062.

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

10 years agotblgen: Modularize the diagnostic emitter
Tobias Grosser [Tue, 6 May 2014 22:06:56 +0000 (22:06 +0000)]
tblgen: Modularize the diagnostic emitter

Replace a large monolitic function, with per-table functions which all nicely
fit on my screen. I also added documentation to each function that describes
what kind of tables are generated and which information is contained and
switched to range based for loops. Finally, I run clang-format over the moved
code.

I spent a significant amount of time to understand this code when reasoning
about possible extensions to the diagnostic interface to support 'remark'
diagnostics. This change will definitely help such an implementation, but
already by itself it will save other people a lot of time when trying to
understand this functionality.

Even though the patch touches the full function, it is mostly mechanical. No
functional change intended. The generated tblgen files are identical.

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

10 years agoInclude translation unit filename in global ctor symbol names.
Nico Weber [Tue, 6 May 2014 20:32:45 +0000 (20:32 +0000)]
Include translation unit filename in global ctor symbol names.

This makes it easier to see where a global ctor comes from, and it also makes
ASan's init order analyzer output easier to understand.  gcc does this too,
but only in -fPIC mode for some reason.  Don't do this for constructors with
explicit init priority.

Also prepend "sub_" before the 'I', that way regular constructors stay
lexicographically after symbols with init priority (because
ord('s') > ord('I')).  gold seems to ignore the name of constructor symbols,
and ld only looks at the symbol if it includes an init priority, which this
patch doesn't change.

Before: __GLOBAL_I_a
Now: __GLOBAL_sub_I_myfile.cc

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

10 years agoReapply: DebugInfo: Emit the definition of enums when the definition preceeds the...
David Blaikie [Tue, 6 May 2014 18:35:21 +0000 (18:35 +0000)]
Reapply: DebugInfo: Emit the definition of enums when the definition preceeds the declaration and initial use.

Reverting r208106 to reapply r208065 with a fix for the regression. The
issue was that the enum tried to be built even if the declaration hadn't
been constructed for debug info - presenting problems for enum templates
and typedefs of enums with names for linkage purposes.

Original commit message:

This regressed a little further 208055 though it was already a little
broken.

While the requiresCompleteType optimization should be implemented here.
Future (possibly near future) work.

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

10 years agoFix leak in ObjCSelfInitChecker, found by LSan.
Nico Weber [Tue, 6 May 2014 17:33:42 +0000 (17:33 +0000)]
Fix leak in ObjCSelfInitChecker, found by LSan.

BugReport doesn't take ownership of the bug type, so let the checker own the
the bug type.  (Requires making the bug type mutable, which is icky, but which
is also what other checkers do.)

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

10 years agoFix a leak found by LSan: ConsumedBlockInfo owns its StateMapsArray entries.
Nico Weber [Tue, 6 May 2014 17:18:03 +0000 (17:18 +0000)]
Fix a leak found by LSan: ConsumedBlockInfo owns its StateMapsArray entries.

(I tried converting StateMapsArray to a vector<unique_ptr> and changing the
types of getInfo() and addInfo() to take unique_ptrs.  This mostly worked,
except for the three-argument form of addInfo() which I found confusing enough
that I went with this simpler fix for now.)

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

10 years agoRevert "DebugInfo: Emit the definition of enums when the definition preceeds the...
David Blaikie [Tue, 6 May 2014 17:02:15 +0000 (17:02 +0000)]
Revert "DebugInfo: Emit the definition of enums when the definition preceeds the declaration and initial use."

This is breaking the compiler-rt build. Reverting while I
investigate/fix.

This reverts commit r208065.

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

10 years agoAdd driver support for AArch64 Fedora.
Tilmann Scheller [Tue, 6 May 2014 16:58:14 +0000 (16:58 +0000)]
Add driver support for AArch64 Fedora.

Reviewed by Eric Christopher.

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

10 years agoUpdate comment for ObjCImplementationDecl's handling of instance variables.
Jordan Rose [Tue, 6 May 2014 16:07:54 +0000 (16:07 +0000)]
Update comment for ObjCImplementationDecl's handling of instance variables.

No functionality change.

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

10 years agoclang-format: [JS] Keep space after closure style comments.
Daniel Jasper [Tue, 6 May 2014 14:41:29 +0000 (14:41 +0000)]
clang-format: [JS] Keep space after closure style comments.

Before:
  var x = /** @type {foo} */ (bar);

After:
  var x = /** @type {foo} */(bar);

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

10 years agoclang-format: [JS] Keep space between 'return' and '['.
Daniel Jasper [Tue, 6 May 2014 14:12:21 +0000 (14:12 +0000)]
clang-format: [JS] Keep space between 'return' and '['.

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

10 years agoclang-format: [JS] Don't indent in goog.scope blocks.
Daniel Jasper [Tue, 6 May 2014 13:54:10 +0000 (13:54 +0000)]
clang-format: [JS] Don't indent in goog.scope blocks.

Before:
  goog.scope(function() {
    var x = a.b;
    var y = c.d;
  });  // goog.scope

After:
  goog.scope(function() {
  var x = a.b;
  var y = c.d;
  });  // goog.scope

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

10 years ago[OPENMP] Another one fix for codegen test '#pragma omp parallel'
Alexey Bataev [Tue, 6 May 2014 13:15:00 +0000 (13:15 +0000)]
[OPENMP] Another one fix for codegen test '#pragma omp parallel'

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

10 years ago[OPENMP] Fixed test for '#pragma omp parallel' codegen
Alexey Bataev [Tue, 6 May 2014 13:02:17 +0000 (13:02 +0000)]
[OPENMP] Fixed test for '#pragma omp parallel' codegen

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

10 years agoFixed one issue with casting
Dinesh Dwivedi [Tue, 6 May 2014 11:46:49 +0000 (11:46 +0000)]
Fixed one issue with casting

Before:
(void) SimplifyICmpOperands(Cond, LHS, RHS);

After:
(void)SimplifyICmpOperands(Cond, LHS, RHS);

Differential Revision: http://reviews.llvm.org/D3615

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

10 years ago[OPENMP] Temporary disable test for parallel codegen
Alexey Bataev [Tue, 6 May 2014 10:51:53 +0000 (10:51 +0000)]
[OPENMP] Temporary disable test for parallel codegen

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

10 years ago[OPENMP] Initial codegen for '#pragma omp parallel'
Alexey Bataev [Tue, 6 May 2014 10:08:46 +0000 (10:08 +0000)]
[OPENMP] Initial codegen for '#pragma omp parallel'

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

10 years ago[PATCH] [ARM64] Enable alignment control option in front-end for ARM64.
Kevin Qin [Tue, 6 May 2014 09:51:32 +0000 (09:51 +0000)]
[PATCH] [ARM64] Enable alignment control option in front-end for ARM64.

This patch is to get "-mno-unaligned-access" and "-munaligned-access"
work in front-end for ARM64 target.

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

10 years agoXCore target: fix initialization bug found by MSan Bot.
Robert Lytton [Tue, 6 May 2014 09:38:54 +0000 (09:38 +0000)]
XCore target: fix initialization bug found by MSan Bot.

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

10 years agoPulled out cast detection in TokenAnnotator into its own function
Dinesh Dwivedi [Tue, 6 May 2014 09:08:34 +0000 (09:08 +0000)]
Pulled out cast detection in TokenAnnotator into its own function
This is to remove FIXME added in r207964.

Differential Revision: http://reviews.llvm.org/D3619

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

10 years agoDebugInfo: Emit the definition of enums when the definition preceeds the declaration...
David Blaikie [Tue, 6 May 2014 07:33:30 +0000 (07:33 +0000)]
DebugInfo: Emit the definition of enums when the definition preceeds the declaration and initial use.

This regressed a little further 208055 though it was already a little
broken.

While the requiresCompleteType optimization should be implemented here.
Future (possibly near future) work.

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

10 years ago[C++11] Use 'nullptr'
Craig Topper [Tue, 6 May 2014 06:48:52 +0000 (06:48 +0000)]
[C++11] Use 'nullptr'

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

10 years agoFix crash when one overload candidate is a template instead of a function. Patch...
Nick Lewycky [Tue, 6 May 2014 06:35:27 +0000 (06:35 +0000)]
Fix crash when one overload candidate is a template instead of a function. Patch by Kaelyn Takata.

Testcase coming out of creduce will land in a separate commit shortly.

Also, it appears that this callback is used even in a SFINAE context where the results are never displayed.

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

10 years ago[OPENMP] 'proc_bind' clause support - Parsing and sema analysis for OpenMP clause...
Alexey Bataev [Tue, 6 May 2014 06:04:14 +0000 (06:04 +0000)]
[OPENMP] 'proc_bind' clause support - Parsing and sema analysis for OpenMP clause 'proc_bind'

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

10 years agoPR19598: Ensure temporary metadata nodes used in debug info are destroyed.
David Blaikie [Tue, 6 May 2014 03:42:01 +0000 (03:42 +0000)]
PR19598: Ensure temporary metadata nodes used in debug info are destroyed.

CGDebugInfo and DIBuilder were lax in their handling of temporary
MDNodes. All temporary nodes need to be deleted, which means they need
to be RAUW'd with a permanent node. This was not happening.

To ensure this, leverage DIBuilder's new ability to create both
permanent and temporary declarations. Ensure all temporary declarations
are RAUW'd, even with itself. (DIDescriptor::RAUW handles the case where
it is replaced with itself and creates a new, duplicate permanent node
to replace itself with)

This means that all temporary declarations must be added to the
ReplacementMap even if they're never upgraded to definitions - so move
the point of insertion into the map to the point of creation of the
declarations.

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

10 years agoSupport field references to struct names and c++11 aliases from inline asm.
Nico Weber [Tue, 6 May 2014 03:13:27 +0000 (03:13 +0000)]
Support field references to struct names and c++11 aliases from inline asm.
This is in addition to the existing support for typedefs.

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

10 years agoI fixed this fixme in r208017.
Nick Lewycky [Tue, 6 May 2014 01:09:50 +0000 (01:09 +0000)]
I fixed this fixme in r208017.

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

10 years agowww: add a missing HTML open tag
Alp Toker [Tue, 6 May 2014 00:17:24 +0000 (00:17 +0000)]
www: add a missing HTML open tag

This went AWOL in r207995.

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

10 years agoBuild debug info for ObjC interface types at the end of the translation unit to ensur...
David Blaikie [Mon, 5 May 2014 23:23:53 +0000 (23:23 +0000)]
Build debug info for ObjC interface types at the end of the translation unit to ensure all ivars are included.

This takes a different approach than the
completedType/requiresCompleteType work which relies on AST callbacks to
upgrade the type declaration to a definition. Instead, just defer
constructing the definition to the end of the translation unit.

This works because the definition is never needed by other debug info
(so far as I know), whereas the definition of a struct may be needed by
other debug info before the end of the translation unit (such as
emitting the definition of a member function which must refer to that
member function's declaration).

If we had a callback for whenever an IVar was added to an ObjC interface
we could use that, and remove the need for the ObjCInterfaceCache, which
might be nice. (also would need a callback for when it was more than
just a declaration so we could get properties, etc).

A side benefit is that we also don't need the CompletedTypeCache
anymore. Just rely on the declaration-ness of a type to decide whether
its definition is yet to be emitted.

There's still the PR19562 memory leak, but this should hopefully make
that a bit easier to approach.

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

10 years agoObjC IVars aren't added when the type isn't emitted after the interface extension
David Blaikie [Mon, 5 May 2014 23:23:50 +0000 (23:23 +0000)]
ObjC IVars aren't added when the type isn't emitted after the interface extension

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

10 years agoDuring parsing, update the range of the Declarator to include the identifier.
Richard Trieu [Mon, 5 May 2014 22:06:50 +0000 (22:06 +0000)]
During parsing, update the range of the Declarator to include the identifier.

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

10 years ago[Basic/FileManager] Propagate whether a file 'IsVolatile' to the file opening functions.
Argyrios Kyrtzidis [Mon, 5 May 2014 21:57:46 +0000 (21:57 +0000)]
[Basic/FileManager] Propagate whether a file 'IsVolatile' to the file opening functions.

Needs llvm r208007.

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

10 years agoAdd -Wnon-modular-include* options
Ben Langmuir [Mon, 5 May 2014 21:44:13 +0000 (21:44 +0000)]
Add -Wnon-modular-include* options

Warn on non-modular includes in various contexts.

-Wnon-modular-include
 -Wnon-modular-include-in-module
  -Wnon-modular-include-in-framework-module

Where each group is a subgroup of those above it.

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

10 years agoSimplify replacement map by avoiding duplicate values and ensuring the values it...
David Blaikie [Mon, 5 May 2014 21:21:39 +0000 (21:21 +0000)]
Simplify replacement map by avoiding duplicate values and ensuring the values it does contain are necessary.

Items were being redundantly added to the replacement map (both when the
declaration was created, and then again when its definition was
constructed) which caused extra handling to be required when walking the
map (as elements may've already been replaced due to prior entries). By
avoiding adding the duplicates, the checks in the replacement handling
can be replaced with assertions.

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

10 years agoMS ABI: Emit an error during IRgen on C++ exception handling
Reid Kleckner [Mon, 5 May 2014 21:12:12 +0000 (21:12 +0000)]
MS ABI: Emit an error during IRgen on C++ exception handling

Currently, users get error messages about RTTI descriptor mangling with
no useful source location.  This addresses that.

Another approach would be to disable C++ exceptions by default in the
driver when using the Microsoft C++ ABI.  However, this makes it
impossible to parse system headers that use exception handling
constructs.  By delaying the error to IRgen, we can figure out if we
actually need to emit code for this construct.  Additionally, users who
are only interested in building refactoring tools on Windows still get a
correct AST without having to add flags.  Finally, this is consistent
with what we do for SEH.

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

10 years agoFix pr19653.
Rafael Espindola [Mon, 5 May 2014 20:21:03 +0000 (20:21 +0000)]
Fix pr19653.

Warn if an alias requests a section other than the aliasee section.

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

10 years agowww: remove proprietary dbtree.js script from r96013
Alp Toker [Mon, 5 May 2014 19:53:49 +0000 (19:53 +0000)]
www: remove proprietary dbtree.js script from r96013

This minified source code and artwork is copied from a commercial product and
carries no license information:

  dbtree.js (7 kb), 25.03.2014 14:51:32
  Purchase and download DBTree now for only $29.75 $9.75

It was used by a small TOC which looks fine now as a plain unordered list.

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

10 years agoFix some typos
Alp Toker [Mon, 5 May 2014 19:53:42 +0000 (19:53 +0000)]
Fix some typos

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

10 years agoSmall refactoring, no functionality change.
Rafael Espindola [Mon, 5 May 2014 19:33:09 +0000 (19:33 +0000)]
Small refactoring, no functionality change.

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

10 years agoCodeGen: Assign linkage to thread-wrappers correctly
David Majnemer [Mon, 5 May 2014 18:54:23 +0000 (18:54 +0000)]
CodeGen: Assign linkage to thread-wrappers correctly

We would sometimes incorrectly give a thread-wrapper external linkage
instead of internal linkage if we had only CodeGen'd it's declaration,
not it's definition.

This fixes PR19655.

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

10 years agoFix handling of condition variables in the face of temp dtors.
Manuel Klimek [Mon, 5 May 2014 18:21:06 +0000 (18:21 +0000)]
Fix handling of condition variables in the face of temp dtors.

The assignment needs to be before the destruction of the temporary.
This patch calls out to addStmt, which invokes VisitDeclStmt, which has
all the correct logic for handling temporaries.

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

10 years agoCodeGen: Cleanup visibility in RTTIBuilder
Duncan P. N. Exon Smith [Mon, 5 May 2014 17:38:39 +0000 (17:38 +0000)]
CodeGen: Cleanup visibility in RTTIBuilder

No functionality change.

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

10 years agoAdd -Wmodule-build to make it easy to see when modules are (re)built
Ben Langmuir [Mon, 5 May 2014 16:58:47 +0000 (16:58 +0000)]
Add -Wmodule-build to make it easy to see when modules are (re)built

Warning is default ignore, and not in -Wall.

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

10 years agoclang-format: Understand functions with decltype return type.
Daniel Jasper [Mon, 5 May 2014 13:48:09 +0000 (13:48 +0000)]
clang-format: Understand functions with decltype return type.

Before:
  decltype(long_name_forcing_break)
      f() {}

After:
  decltype(long_name_forcing_break)
  f() {}

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

10 years agoAdded some heuristics to identify c style casting
Dinesh Dwivedi [Mon, 5 May 2014 13:14:35 +0000 (13:14 +0000)]
Added some heuristics to identify c style casting

Before:
void f() { my_int a = (my_int) * b; }
void f() { return P ? (my_int) * P : (my_int)0; }

After:
void f() { my_int a = (my_int)*b; }
void f() { return P ? (my_int)*P : (my_int)0; }

Differential Revision: http://reviews.llvm.org/D3576

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

10 years agoDriver: Recognize CentOS 6 as RHEL 6.
Benjamin Kramer [Mon, 5 May 2014 12:39:32 +0000 (12:39 +0000)]
Driver: Recognize CentOS 6 as RHEL 6.

Patch by Dimitry Andric!

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

10 years agoStringRefize and take out an old FIXME
Alp Toker [Mon, 5 May 2014 12:38:48 +0000 (12:38 +0000)]
StringRefize and take out an old FIXME

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

10 years agoclang-format: Improve understanding of decltype.
Daniel Jasper [Mon, 5 May 2014 12:36:29 +0000 (12:36 +0000)]
clang-format: Improve understanding of decltype.

Before:
  SomeFunction([](decltype(x), A * a) {});

After:
  SomeFunction([](decltype(x), A *a) {});

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

10 years agoFix bug in clang-format while merging short function
Dinesh Dwivedi [Mon, 5 May 2014 11:36:35 +0000 (11:36 +0000)]
Fix bug in clang-format while merging short function

Before:
    #ifdef _DEBUG
    int foo( int i = 0 )
    #else
    int foo( int i = 5 )
    #endif { return i; }

After:
    #ifdef _DEBUG
    int foo( int i = 0 )
    #else
    int foo( int i = 5 )
    #endif
    {
     return i;
    }

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

10 years agoFix crash when resolving branch conditions for temporary destructor condition blocks.
Manuel Klimek [Mon, 5 May 2014 09:58:03 +0000 (09:58 +0000)]
Fix crash when resolving branch conditions for temporary destructor condition blocks.

Document and simplify ResolveCondition.

1. Introduce a temporary special case for temporary desctructors when resolving
the branch condition - in an upcoming patch, alexmc will change temporary
destructor conditions to not run through this logic, in which case we can remove
this (marked as FIXME); this currently fixes a crash.

2. Simplify ResolveCondition; while documenting the function, I noticed that it
always returns the last statement - either that statement is the condition
itself (in which case the condition was returned anyway), or the rightmost
leaf is returned; for correctness, the rightmost leaf must be evaluated anyway
(which the CFG does in the last statement), thus we can just return the last
statement in that case, too. Added an assert to verify the invariant.

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

10 years agoSimplify getARMCPUForMArch() and make it more consistent
Christian Pirker [Mon, 5 May 2014 08:48:18 +0000 (08:48 +0000)]
Simplify getARMCPUForMArch() and make it more consistent

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

10 years agoclang-format: Fix import statements with ColumnLimit: 0
Daniel Jasper [Mon, 5 May 2014 08:08:07 +0000 (08:08 +0000)]
clang-format: Fix import statements with ColumnLimit: 0

These used to interact badly with AlwaysBreakBeforeMultilineStrings.

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

10 years agoUpdate lit.cfg to support the clang-interpreter test from r207950
Alp Toker [Mon, 5 May 2014 06:42:07 +0000 (06:42 +0000)]
Update lit.cfg to support the clang-interpreter test from r207950

Performs behind-the-scenes RUN line substitution similarly to what's done with
clang-check and clang-format to ensure the executable is found.

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

10 years agoAdd speculative clang-interpreter test
Alp Toker [Mon, 5 May 2014 06:22:21 +0000 (06:22 +0000)]
Add speculative clang-interpreter test

Let's see how far this gets on the build servers. The application requires
native JIT and uses the C standard library, but hopefully we can get this
tested on at least some configurations.

Taking a lead from the clang-format tests, we'll just expect the executable to
get picked up from the build output path for now.

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

10 years agoMake module self-import an error
Ben Langmuir [Mon, 5 May 2014 05:31:33 +0000 (05:31 +0000)]
Make module self-import an error

Ideally, importing Foo.a from Foo.b would "do the right thing", but
until it does, this patch makes it an error rather than allow it to
silently be ignored.

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

10 years agocindex-dump.py: fix the --show-ids description string
Alp Toker [Mon, 5 May 2014 04:42:26 +0000 (04:42 +0000)]
cindex-dump.py: fix the --show-ids description string

It looks like this was botched back in r94936.

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

10 years agoFix cindex-dump.py --show-ids
Alp Toker [Mon, 5 May 2014 04:39:18 +0000 (04:39 +0000)]
Fix cindex-dump.py --show-ids

This option flag was incorrectly expecting an argument:

$ cindex-dump.py --show-ids test.cpp
cindex-dump.py: error: invalid number arguments

With this change the feature correctly gets enabled by --show-ids.

No tests.

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

10 years agoSplit out header integration tests
Alp Toker [Sun, 4 May 2014 13:00:32 +0000 (13:00 +0000)]
Split out header integration tests

These are somewhat arbitrary tests that check if "thing goes fine" when
processing various platform-specific headers.

Also move warn-sysheader.cpp to Misc where the other diagnostics infrastructure
tests live.

File moves only.

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

10 years agoSpeculative fix to unbreak the buildbots that fail with compiler errors.
Argyrios Kyrtzidis [Sun, 4 May 2014 05:27:24 +0000 (05:27 +0000)]
Speculative fix to unbreak the buildbots that fail with compiler errors.

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

10 years agoFix a use-after-free bug I recently introduced in lookupModuleFile
Ben Langmuir [Sun, 4 May 2014 05:20:54 +0000 (05:20 +0000)]
Fix a use-after-free bug I recently introduced in lookupModuleFile

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

10 years ago[Modules] Add the resource-dir to the module hash.
Argyrios Kyrtzidis [Sun, 4 May 2014 04:35:31 +0000 (04:35 +0000)]
[Modules] Add the resource-dir to the module hash.

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

10 years agoCodeGen: complete ARM ACLE hint 8.4 support
Saleem Abdulrasool [Sun, 4 May 2014 02:52:25 +0000 (02:52 +0000)]
CodeGen: complete ARM ACLE hint 8.4 support

Add support for the remaining hints from the ACLE.  Although __dbg is listed as
a hint, it is handled different, so it is not covered by this change.

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

10 years agoTarget: fix wchar_t definition for Windows on ARM
Saleem Abdulrasool [Sun, 4 May 2014 01:56:04 +0000 (01:56 +0000)]
Target: fix wchar_t definition for Windows on ARM

Windows on ARM uses AAPCS, but has some deviations.  wchar_t remains an unsigned
short on WoA, which does not conform to AAPCS.  Ensure that wchar_t is defined
accordingly.

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

10 years agoMinor cleanups, no behavior change.
Nico Weber [Sat, 3 May 2014 22:07:35 +0000 (22:07 +0000)]
Minor cleanups, no behavior change.

* Fixes a "return" that was indented at the same level as the continuation
  from the previous line
* Wrap several lines to 80 columns
* Remove an if check that was always true
* Move a variable declaration slightly closer to its use

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

10 years agoWrap a few lines at 80 columns, change a confusing indent. No behavior change.
Nico Weber [Sat, 3 May 2014 21:57:40 +0000 (21:57 +0000)]
Wrap a few lines at 80 columns, change a confusing indent. No behavior change.

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

10 years agoReplace one-element SmallVectors inside DenseMaps with TinyPtrVector.
Benjamin Kramer [Sat, 3 May 2014 18:44:26 +0000 (18:44 +0000)]
Replace one-element SmallVectors inside DenseMaps with TinyPtrVector.

That's exactly what TinyPtrVector was designed for. No functionality change.

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

10 years agoRemove unused diagnostics.
Benjamin Kramer [Sat, 3 May 2014 12:32:50 +0000 (12:32 +0000)]
Remove unused diagnostics.

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

10 years ago[leaks] The PDFileEntry nodes in the FilesMade FoldingSet contain
Chandler Carruth [Sat, 3 May 2014 10:39:05 +0000 (10:39 +0000)]
[leaks] The PDFileEntry nodes in the FilesMade FoldingSet contain
a std::vector that allocates on the heap. As a consequence, we have to
run all of their destructors when tearing down the set, not just
deallocate the memory blobs.

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

10 years ago[leaks] Re-shuffle code such that we don't create a basic block for
Chandler Carruth [Sat, 3 May 2014 09:16:57 +0000 (09:16 +0000)]
[leaks] Re-shuffle code such that we don't create a basic block for
initializing an array unless we need it. Specifically, position the
creation of a new basic block after we've checked all of the cases that
bypass the need for it.

Fixes another leak in test/CodeGen* found by LSan.

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

10 years ago[leaks] Don't leak the fake arguments we synthesize for LLVM option
Chandler Carruth [Sat, 3 May 2014 08:39:35 +0000 (08:39 +0000)]
[leaks] Don't leak the fake arguments we synthesize for LLVM option
parsing.

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

10 years agoEliminate ASTContext's DelayInitialization flag
Alp Toker [Sat, 3 May 2014 03:46:04 +0000 (03:46 +0000)]
Eliminate ASTContext's DelayInitialization flag

Having various possible states of initialization following construction doesn't
add value here.

Also remove the unused size_reserve parameter.

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

10 years agoFix a bunch of mislayered clang/Lex includes from Sema
Alp Toker [Sat, 3 May 2014 03:45:55 +0000 (03:45 +0000)]
Fix a bunch of mislayered clang/Lex includes from Sema

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

10 years agoUpdate Preprocessor::Initialize() documentation following r207825
Alp Toker [Sat, 3 May 2014 03:45:43 +0000 (03:45 +0000)]
Update Preprocessor::Initialize() documentation following r207825

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

10 years agoCodeGen: Cleanup ABIArgInfo
David Majnemer [Sat, 3 May 2014 02:23:35 +0000 (02:23 +0000)]
CodeGen: Cleanup ABIArgInfo

ABIArgInfo was pretty hard to grok, it had data members with names like
"BoolData0" and "UIntData".  Constructors with lots of bool arguments.
Reusing the same data member for multiple purposes.

It was also wasteful with memory, this new layout is 8 bytes smaller.

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

10 years agoRevert "Sema: Implement DR244"
David Majnemer [Sat, 3 May 2014 02:22:11 +0000 (02:22 +0000)]
Revert "Sema: Implement DR244"

This was accidentally committed.

This reverts commit r207892.

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

10 years agoSema: Implement DR244
David Majnemer [Sat, 3 May 2014 02:18:46 +0000 (02:18 +0000)]
Sema: Implement DR244

Naming the destructor using a typedef-name for the class-name is
well-formed.

This fixes PR19620.

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

10 years agoErr, wait. Those new test functions in r207890 need CHECK lines.
Nick Lewycky [Sat, 3 May 2014 01:19:39 +0000 (01:19 +0000)]
Err, wait. Those new test functions in r207890 need CHECK lines.

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

10 years agoRewrite NRVO determination. Track NRVO candidates on the parser Scope and apply the...
Nick Lewycky [Sat, 3 May 2014 00:41:18 +0000 (00:41 +0000)]
Rewrite NRVO determination. Track NRVO candidates on the parser Scope and apply the NRVO candidate flag to all possible NRVO candidates here, and remove the flags in computeNRVO or upon template instantiation. A variable now has NRVO applied if and only if every return statement in that scope returns that variable. This is nearly optimal.

Performs NRVO roughly 7% more often in a bootstrap build of clang. Patch co-authored by Richard Smith.

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

10 years agoMS ABI x64: Pass small objects with dtors but no copy ctors directly
Reid Kleckner [Sat, 3 May 2014 00:33:28 +0000 (00:33 +0000)]
MS ABI x64: Pass small objects with dtors but no copy ctors directly

Passing objects directly (in registers or memory) creates a second copy
of the object in the callee.  The callee always destroys its copy, but
we also have to destroy any temporary created in the caller.  In other
words, copy elision of these kinds of objects is impossible.

Objects larger than 8 bytes with non-trivial dtors and trivial copy
ctors are still passed indirectly, and we can still elide copies of
them.

Fixes PR19640.

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

10 years ago[leaks] Fix a leak of a basic block when we successfully fold a switch
Chandler Carruth [Sat, 3 May 2014 00:14:49 +0000 (00:14 +0000)]
[leaks] Fix a leak of a basic block when we successfully fold a switch
condition to a constant and emit only the relevant statement. In that
case, we were previously creating the epilog jump destination, a cleanup
scope, and emitting any condition variable into it. Instead, we can emit
the condition variable (if we have one) into the cleanup scope used for
the entire folded case sequence. We avoid creating a jump dest, a basic
block, and an extra cleanup scope. Win!

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

10 years agoFix PR 19630, don't crash when file ends with whitespace.
Richard Trieu [Fri, 2 May 2014 23:40:32 +0000 (23:40 +0000)]
Fix PR 19630, don't crash when file ends with whitespace.

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

10 years ago[leaks] Parse the schema file every time we try to verify the XML. Yes,
Chandler Carruth [Fri, 2 May 2014 23:30:59 +0000 (23:30 +0000)]
[leaks] Parse the schema file every time we try to verify the XML. Yes,
this is wasteful, blah blah, but this is a test utility only. It turns
out that without doing this, libxml2 will always leak a bunch of the XML
data, and that is causing failures with LSan. This is also quite a bit
simpler and I don't think it is slow enough to really be a show stopper.
If someone yells about the runtime of c-index-test, we can do other
things to try to mitigate it, but the current strategy wasn't working
well.

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

10 years agoFix clang-cl Driver leak
Hans Wennborg [Fri, 2 May 2014 22:55:30 +0000 (22:55 +0000)]
Fix clang-cl Driver leak

We were synthesizing new arguments from e.g. '/Tcfile.c' arguments,
but didn't handle ownership correctly.

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