Commit Graph

54131 Commits

Author SHA1 Message Date
David Blaikie 3b0e32bf61 unique_ptrify CompilerInstance::OutputFile(s) and remove a unique_ptr around a non-owning raw_ostream in CodeGenAction::CreateASTConsumer
llvm-svn: 215331
2014-08-10 23:35:58 +00:00
David Blaikie 037e75bf3c Follow up to r215323 - avoid llvm::make_unique in this particular case that's causing GCC on some buildbots some confusion.
llvm-svn: 215327
2014-08-10 21:06:17 +00:00
David Blaikie 6153581a40 Out-of-line CompilerInstance::takeSema to avoid a header dependence from CompilerInstance.h on Sema.h
Hopefully this fixes the libstdc++ build on some of the buildbots after
r215321.

llvm-svn: 215325
2014-08-10 20:12:39 +00:00
David Blaikie 6beb6aa8f0 Recommit 213307: unique_ptr-ify ownership of ASTConsumers (reverted in r213325)
After post-commit review and community discussion, this seems like a
reasonable direction to continue, making ownership semantics explicit in
the source using the type system.

llvm-svn: 215323
2014-08-10 19:56:51 +00:00
David Blaikie 4422df6fa3 Remove unused CompilerInstance::takeCodeCompletionConsumer
llvm-svn: 215322
2014-08-10 19:23:01 +00:00
David Blaikie ec99b5ee0d unique_ptr-ify CompilerInstance::takeSema
llvm-svn: 215321
2014-08-10 19:14:48 +00:00
David Blaikie 6f7382ddd1 std::unique_ptr-ify the result of ASTUnit::LoadFromASTFile
llvm-svn: 215320
2014-08-10 19:08:04 +00:00
David Blaikie f62d4e772d unique_ptr-ify FrontendAction::takeCurrentASTUnit
llvm-svn: 215319
2014-08-10 17:03:42 +00:00
David Blaikie dd0e1e8d14 unique_ptr-ify FileSystemStatCache::takeNextStatCache
llvm-svn: 215318
2014-08-10 16:57:11 +00:00
David Blaikie 2721c32e47 unique_ptr-ify ASTReaderListener in the ASTReader
llvm-svn: 215317
2014-08-10 16:54:39 +00:00
NAKAMURA Takumi 1990aa3a9b ModuleMap.h: Prune an obsolete "\param ModuleMap" corresponding to r215268.
llvm-svn: 215316
2014-08-10 13:48:47 +00:00
Timur Iskhodzhanov 16055e77b9 Fix PR20444 -- wrong number of vftable slots created when return adjustment thunks are needed
Reviewed at http://reviews.llvm.org/D4822

llvm-svn: 215312
2014-08-10 11:40:51 +00:00
Richard Smith ca40f9b39a [modules] When considering merging a newly-declared typedef into an imported
one, perform the import if the types match even if the imported declaration is
hidden. Otherwise, NamedDecl::declarationReplaces will drop one of the name
lookup entries, making the typedef effectively inaccessible from one of the
modules that declared it.

llvm-svn: 215306
2014-08-10 02:20:15 +00:00
Yaron Keren ec740b3d46 Make this test unsupported when there is no real 'env' from a real shell.
While the test was already requiring shell-preserves-root (such as the
internal shell), it wasn't aware that the MSYS 1.0 env command knows how
to expand root by itself!

From cmd.exe try:

  env SDKROOT=/ cmd //c echo %SDKROOT%

And get:

  C:/MINGW/MSYS/1.0
  
To be certain we have a good 'env' program the test now requires a shell.

llvm-svn: 215298
2014-08-09 21:24:04 +00:00
Joerg Sonnenberger 2bb3a90658 Actually add the object file, skipped by the directory add.
llvm-svn: 215297
2014-08-09 21:06:57 +00:00
David Blaikie efb6eb2697 Use std::unique_ptr to handle transient ownership of UnwrappedLine in ScopedLineState
llvm-svn: 215294
2014-08-09 20:02:07 +00:00
Joerg Sonnenberger 17a80e49e7 Use the correct fallback directory for EABIHF targets on NetBSD/arm.
From Matt Thomas.

llvm-svn: 215292
2014-08-09 19:01:52 +00:00
Joerg Sonnenberger 323cea90da NetBSD/aarch64 has no libgcc or libstdc++. Drop arm64 tests.
llvm-svn: 215291
2014-08-09 18:28:36 +00:00
Yaron Keren 1801d1b12f Fix six tests are failing on Windows after r215241-r215243.
Clang :: Frontend/iframework.c
    Clang :: Frontend/system-header-prefix.c
    Clang :: Index/annotate-comments-objc.m
    Clang :: Index/annotate-module.m
    Clang :: Index/index-module.m
    Clang :: Index/index-pch-with-module.m
    Clang :: PCH/case-insensitive-include.c

Suprisingly the normalize_separators() was no-op when LLVM_ON_WIN32.
Its replacement native() does change path separators into \ as expected,
breaking these tests.

I had fixed the tests by #ifndef LLVM_ON_WIN32 on the native call,
to match the previous behaviour. 
If this logic is not used on Windows host, it might be completely
deleted as there should not be windows path seperators on Linux hosts.

I can't test on Linux but if someone can run tests on Linux after
commenting out the line

  llvm::sys::path::native(NormalizedPath);    

and the tests pass, the whole if (LangOpts.MSVCCompat) could be deleted.
  

llvm-svn: 215290
2014-08-09 18:13:01 +00:00
Timur Iskhodzhanov f97c973c2e Fix PR20479 -- missing vftable slots in case of virtual inheritance vs return adjusting thunks
Reviewed at http://reviews.llvm.org/D4829

llvm-svn: 215285
2014-08-09 17:08:06 +00:00
Justin Bogner a0101074fd Revert "Add tests for coverage mapping generation."
I reverted one of the added tests from r215261 in r215274, since it
was failing on quite a few bots. It looks like this wasn't sufficient,
as we're still getting failures on windows, like the following:

    http://bb.pgr.jp/builders/ninja-x64-msvc-RA-centos6/builds/5378

I'm reverting this entire commit so the bots aren't blocked on these
failures.

This reverts commit r215261.

llvm-svn: 215278
2014-08-09 03:55:09 +00:00
Justin Bogner 6f147a0966 Revert a failing test from r215261
The (new) CoverageMapping/macroparams.c test is failing on a number of
buildbots. Reverting it until Alex can investigate and fix the test.

llvm-svn: 215274
2014-08-09 01:40:59 +00:00
Richard Smith 49faf9f4cd [modules] Weaken an out-of-date assertion: an #undef can have no location if we
imported it from a module when performing finalization before writing out
an AST file.

llvm-svn: 215272
2014-08-09 01:24:07 +00:00
Ben Langmuir 9d6448b137 Refactor the module map file used for uniquing a module name out of
class Module. It's almost always going to be the same as
getContainingModule() for top-level modules, so just add a map to cover
the remaining cases.  This lets us do less bookkeeping to keep the
ModuleMap fields up to date.

llvm-svn: 215268
2014-08-09 00:57:23 +00:00
David Blaikie 28f30caf9b Remove some transient raw pointer ownership in ClangAttrEmitter::createArgument
This function might be a bit easier if it were split in two with a lot
of early returns - and that setOptional bit in the outer function, but
anyway.

llvm-svn: 215263
2014-08-08 23:59:38 +00:00
Alex Lorenz c4ea74a719 Add tests for coverage mapping generation.
This patch adds the tests for the coverage mapping generation. 
Most of the tests check the mapping regions produced by 
the generator, and one checks the llvm IR.

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

llvm-svn: 215261
2014-08-08 23:49:58 +00:00
Bob Wilson a2acb1e84e Add predefined macros to identify x86_64h architectures.
Patch by Jim Grosbach.

llvm-svn: 215260
2014-08-08 23:46:28 +00:00
Bob Wilson 7400e596a3 Predefine IB_DESIGNABLE and IBInspectable macros. <rdar://problem/17441860>
These macros are used as markers for Interface Builder and need to be defined
to empty strings since they have no impact on the code.

Patch by Ted Kremenek.

llvm-svn: 215259
2014-08-08 23:46:25 +00:00
Alex Lorenz f2cf38e020 Add a cc1 "dump-coverage-mapping" for testing coverage mapping.
Differential Revision: http://reviews.llvm.org/D4799

llvm-svn: 215258
2014-08-08 23:41:24 +00:00
David Blaikie 1c5a38584d Simplify ownership of ExplodedGraph in the CoreEngine by removing unique_ptr indirection.
Summary: I was going to fix the use of raw pointer ownership in "takeGraph" when I realized that function was unused and the whole ExplodedGraph could just be owned by value without the std::unique_ptr indirection at all.

Reviewers: jordan_rose

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

llvm-svn: 215257
2014-08-08 23:36:37 +00:00
Alexey Samsonov 90490af21d Add -link-cxx-sanitizer driver flag.
Summary:
This flag can be used to force linking of CXX-specific parts
of sanitizer runtimes into the final executable. It gives more precise
control than --driver-mode=g++ and comes handy when user links several
object files with sanitized C++ code into an executable, but wants
to provide libstdc++ himself, instead of relying on Clang dirver's
behavior.

Test Plan: clang regression test suite

Reviewers: chandlerc, rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

llvm-svn: 215252
2014-08-08 22:47:17 +00:00
Richard Trieu 4cbff5c76f Extend tautological pointer compare and pointer to bool conversion warnings to
macro arguments.

Previously, these warnings skipped any code in a macro expansion.  Preform an
additional check and warn when the expression and context locations are both
in the macro argument.

The most obvious case not caught is passing a pointer directly to a macro,
i.e 'assert(&array)' but 'assert(&array && "valid array")' is caught.  This is
because macro arguments are not typed and the conversion happens inside the
macro.

llvm-svn: 215251
2014-08-08 22:41:43 +00:00
Fariborz Jahanian 0b1d28866c Objective-C [qoi]. Issue warning and fixit if property-dot syntax
use mis-cased property name (which is currently accepted silently
due to the way property setters are named). rdar://17911746

llvm-svn: 215250
2014-08-08 22:33:24 +00:00
David Blaikie b29bb4528a Sure-up MemoryBuffer ownership in JSONCompilationDatabase's ctor.
llvm-svn: 215246
2014-08-08 22:01:06 +00:00
Bob Wilson 2a3710ec9e Change __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ for versions > 10.9.
The previous encoding only allowed a single digit for the minor version
number. This changes it to use 2 digits for both the minor version and the
revision number.

llvm-svn: 215245
2014-08-08 21:45:53 +00:00
Rafael Espindola f600223754 Use llvm::sys::path::native instead of llvm::sys::fs::normalize_separators.
llvm::sys::path::native has a superset of the functionality and this was the
only use of llvm::sys::fs::normalize_separators.

llvm-svn: 215242
2014-08-08 21:31:04 +00:00
Daniel Sanders 7e7baa9ab8 Partially revert r215204 - [mips] Add -mabicalls/-mno-abicalls to the driver
It wasn't actually a bug that -mabicalls/-mno-abicalls wasn't being passed to
GAS. The only reason we pass it to the integrated assembler is because it shares
the same framework with CodeGen.

llvm-svn: 215236
2014-08-08 18:39:01 +00:00
Fariborz Jahanian bf09db44f7 Objective-C. Minor refactoring of my previous patch.
rdar://17554063

llvm-svn: 215235
2014-08-08 18:29:52 +00:00
Fariborz Jahanian 495bc3f5f6 Objective-C ARC. Use of non-retain/autorelease API
for building Objective-C array literals in ARC
mode. rdar://17554063

llvm-svn: 215232
2014-08-08 17:31:14 +00:00
Sylvestre Ledru 9e0752980c Fix a bug when scan-build is used in a cross-compilation environment with
the --use-cc option.

Instead, we will search in the PATH
For example:
 scan-build --use-cc=arm-none-eabi-gcc -o out make -e

Initially reported as a Debian Bug:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=748777

llvm-svn: 215229
2014-08-08 17:15:13 +00:00
David Blaikie 77bbb5fd0b DebugInfo: Blocks: Do not depend on LLVM argument numbering when choosing the debug info argument numbering.
Due to the possible presence of return-by-out parameters, using the LLVM
argument number count when numbering debug info arguments can end up
off-by-one. This could produce two arguments with the same number, which
would in turn cause LLVM to emit only one of those arguments (whichever
it found last) or assert (r215157).

llvm-svn: 215227
2014-08-08 17:10:14 +00:00
David Blaikie cdba84c0d3 CompilationDatabase: Sure-up ownership of compilation databases using std::unique_ptr
Diving into the memory leaks fixed by r213851 there was one case of a
memory leak of a CompilationDatabase due to not properly taking
ownership of the result of "CompilationDatabase::autoDetectFromSource".
Given that both implementations and callers have been using unique_ptr
to own CompilationDatabase objects - make this explicit in the API to
reduce the risk of further leaks.

llvm-svn: 215215
2014-08-08 16:06:15 +00:00
Daniel Sanders feb613028b [mips] Invert the abicalls feature bit to be noabicalls so that it's possible for -mno-abicalls to take effect.
Also added the testcase that should have been in r215194.

This behaviour has surprised me a few times now. The problem is that the
generated MipsSubtarget::ParseSubtargetFeatures() contains code like this:

   if ((Bits & Mips::FeatureABICalls) != 0) IsABICalls = true;

so '-abicalls' means 'leave it at the default' and '+abicalls' means 'set it to
true'. In this case, (and the similar -modd-spreg case) I'd like the code to be

  IsABICalls = (Bits & Mips::FeatureABICalls) != 0;

or possibly:

   if ((Bits & Mips::FeatureABICalls) != 0)
     IsABICalls = true;
   else
     IsABICalls = false;

and preferably arrange for 'Bits & Mips::FeatureABICalls' to be true by default
(on some triples).

llvm-svn: 215211
2014-08-08 15:47:17 +00:00
Eli Bendersky 9b07147fc9 Expose the CUDA shared attribute to the C API.
Similar to r209767, which exposed other CUDA-related attributes.

Patch by Rob Springer.

llvm-svn: 215208
2014-08-08 14:59:00 +00:00
Daniel Sanders e805f44c8f [mips] Add -mabicalls/-mno-abicalls to the driver
Based on a patch by Matheus Almeida. I've added testcases and fixed a bug where
the options weren't passed on to GAS.

llvm-svn: 215204
2014-08-08 13:44:50 +00:00
Benjamin Kramer 12152ab92e Add missing header guards.
llvm-svn: 215202
2014-08-08 13:24:19 +00:00
Daniel Jasper a5621202c4 clang-format: Prefer not to put lambdas on a single line.
Before:
  string abc =
      SomeFunction(aaaaaaaaaaaaa, aaaaa,
                   []() { SomeOtherFunctioooooooooooooooooooooooooon(); });

After:
  string abc = SomeFunction(aaaaaaaaaaaaa, aaaaa, []() {
    SomeOtherFunctioooooooooooooooooooooooooon();
  });

llvm-svn: 215197
2014-08-08 12:00:13 +00:00
NAKAMURA Takumi 6b0fe34cc5 clangAnalysis: Avoid member initializers in TempDtorContext to appease msc17.
llvm-svn: 215193
2014-08-08 09:51:07 +00:00
Manuel Klimek deb0262a5e Fix branch reachabiliy annotation for temp dtor branches.
As we only create temp dtor decision branches when a temp dtor needs to
be run (as opposed to for each logical branch in the original
expression), we must include the information about all previous logical
branches when we annotate the temp dtor decision branch.

llvm-svn: 215188
2014-08-08 07:37:13 +00:00
David Majnemer f9834d5fa0 Parser: Array decls with static but without array size are illformed
Array declarators involving the static keyword take on two forms:
    D[ static type-qualifier-listopt assignment-expression ]
    D[ type-qualifier-list static assignment-expression ]

Raise a diagnostic if the assignment-expression is missing.

This fixes PR20584.

llvm-svn: 215187
2014-08-08 07:21:18 +00:00