Commit Graph

55652 Commits

Author SHA1 Message Date
Michael Ilseman d8bddcce44 Bring PostOrderCFGView's insert API up to date with other API changes.
r222334 updates LLVM data structure's insert API to return a
pair. This change updates PostOrderCFGView accordingly, so that it can
be used interchangably with other sets.

llvm-svn: 222445
2014-11-20 19:32:48 +00:00
Anastasia Stulova 561e0aa180 Extended list of valid frontend options with '-cl-std=CL2.0'.
This option sets language mode for the compilation of a source file to be OpenCL v2.0.

Example: clang -cc1 -cl-std=CL2.0 myfile.cl
llvm-svn: 222444
2014-11-20 19:25:00 +00:00
Anastasia Stulova d26d85c1f5 Testing commit access.
llvm-svn: 222438
2014-11-20 17:57:27 +00:00
Frederic Riss 73feb0c520 Remove now dead code.
After LLVM r222434, the Variables field of DISubprograms for forward
declarations will always be null. No need to keep code around to
delete them.

llvm-svn: 222437
2014-11-20 16:24:29 +00:00
Frederic Riss c3a9d7dfbf Prepare for the DIBuilder populating DISubprogram's Variables with null.
This is a followup to r222373. A better solution to the problem solved
there is to not create the leaked nodes at all (we know that they will
never be used for forward declared functions anyway). To avoid bot
breakage in the interval between the cfe and llvm commits, add a check
that the nMDNode is not null before deleting it. This code can completely
go away after the LLVM part is in.

llvm-svn: 222433
2014-11-20 15:46:59 +00:00
Samuel Benzaquen 2c15e8ccce Replace variadic operator function pointer with an enum value.
Summary:
Replace variadic operator function pointer with an enum value.
Hiding the implementation of the variadic matcher will allow to specialize them for the operation performed.
In particular, it will allow for a more efficient allOf() matcher.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

llvm-svn: 222432
2014-11-20 15:45:53 +00:00
Timur Iskhodzhanov f0934fa708 Convert CR+LF -> LF in a test file
llvm-svn: 222429
2014-11-20 12:59:14 +00:00
Daniel Jasper 6cab6784b9 clang-format: [Java] Don't align after "return".
Doesn't seem to be common practice in Java.

Before:
  return aaaaaaaaaaaaaaaaaaa
         && bbbbbbbbbbbbbbbbbbb
         && ccccccccccccccccccc;

After:
  return aaaaaaaaaaaaaaaaaaa
      && bbbbbbbbbbbbbbbbbbb
      && ccccccccccccccccccc;

Patch by Harry Terkelsen.

llvm-svn: 222424
2014-11-20 09:54:49 +00:00
Daniel Jasper caf8685958 clang-format: [Java] Don't force break before generic type method.
Before:
  Foo.bar()
      .<X>
      baz();

After:
  Foo.bar()
      .<X>baz();

Patch by Harry Terkelsen.

llvm-svn: 222423
2014-11-20 09:48:11 +00:00
Alexey Bataev cc37cc1db2 [OPENMP] Codegen for "omp flush" directive.
For each "omp flush" directive a call to "void kmpc_flush(ident_t *, ...)" function is generated.
Directive "omp flush" may have an associated list of variables to flush, but currently runtime function ignores them. So the patch generates just "call kmpc_flush(ident_t *<loc>, i32 0)".
Differential Revision: http://reviews.llvm.org/D6292

llvm-svn: 222409
2014-11-20 04:34:54 +00:00
Richard Smith 30ef77a780 Fix buildbots.
llvm-svn: 222408
2014-11-20 04:09:55 +00:00
Jordan Rose 08b3638b84 [CMake] Use .svn/wc.db as our VC dependency if it's available.
In order to keep SVNVersion.inc from being regenerated on every build, we need
to specify as a dependency a file that only changes when the VC state updates.
I previously just had .svn/entries, but that's only used by Subversion 1.6.
1.7 uses .svn/wc.db instead; prefer that if it's present.

(Thanks, Nico!)

llvm-svn: 222407
2014-11-20 03:57:45 +00:00
Richard Smith e9f130cfdf Preserve numeric literal suffixes during type canonicalization.
Patch by Pierre Gousseau! Test cases altered significantly by me.

llvm-svn: 222404
2014-11-20 03:37:32 +00:00
Richard Smith c8b9badef7 Avoid earlier test interfering with later one.
llvm-svn: 222403
2014-11-20 01:50:37 +00:00
Richard Smith 6adb42e1ac When mangling member-expressions, skip implicit accesses of anonymous union
objects. This is consistent with GCC's behavior. Patch by Tomasz Miąsko!

llvm-svn: 222402
2014-11-20 01:35:11 +00:00
Alexey Samsonov cfb97aa620 Remove support for undocumented SpecialCaseList entries.
"global-init", "global-init-src" and "global-init-type" were originally
used to blacklist entities in ASan init-order checker. However, they
were never documented, and later were replaced by "=init" category.

Old blacklist entries should be converted as follows:
  * global-init:foo -> global:foo=init
  * global-init-src:bar -> src:bar=init
  * global-init-type:baz -> type:baz=init

llvm-svn: 222401
2014-11-20 01:27:19 +00:00
Richard Smith 5b555da775 PR21531: fix crash on invalid with unexpanded pack in case value.
llvm-svn: 222400
2014-11-20 01:24:12 +00:00
Chad Rosier 36577d037f Revert "[Reassociate] Update test cases due to r222142."
This reverts commit r222144.  Commit r222142 is being reverted due to
a spec2006/gcc execution-time regression.

Update mips-varargs test as well.

llvm-svn: 222397
2014-11-19 23:20:35 +00:00
Daniel Jasper ccb68b487e clang-format: [Java] Accept generic types in enum declaration
Before:
  enum Foo implements Bar<X, Y> {
    ABC {
      ...
    }
    , CDE {
      ...
    };
  }

After:
  enum Foo implements Bar<X, Y> {
    ABC {
      ...
    },
    CDE {
      ...
    };
  }

Patch by Harry Terkelsen.

llvm-svn: 222394
2014-11-19 22:38:18 +00:00
Jordan Rose 85216ef0c3 [CMake] Always include the Clang repo version, just like the autoconf build.
Now that LLVM's helper script GetSVN.cmake actually works consistently,
there's no reason not to use it. We avoid having to regenerate SVNVersion.inc
every time by marking it as dependent on Git's reflog or SVN's entries file.

This should end most of the issues of the AST format changing and breaking
old module files: CMake-Clang should now detect that the version changed just
like Autoconf-Clang has.

Based on r190557. Depends on LLVM r222391.

llvm-svn: 222393
2014-11-19 22:03:48 +00:00
Jordan Rose 210bfe9c52 Constify a few IdentifierInfo * parameters.
No functionality change.

llvm-svn: 222392
2014-11-19 22:03:46 +00:00
Richard Smith be6dd818fb Fix bug where a trivial constexpr copy/move operation couldn't copy from an
empty non-constexpr object. Such a copy doesn't break any of the constexpr
rules.

llvm-svn: 222387
2014-11-19 21:27:17 +00:00
David Blaikie 423eb5a6a5 DebugInfo: Don't emit a 'global variable' when a static member declaration is referenced without a definition, just ensure the enclosing class (with the static member declaration) is emitted.
Addresses PR21511 by emitting appropriate metadata rather than
faux-global definitions for a variable that doesn't have a definition.

llvm-svn: 222377
2014-11-19 19:42:40 +00:00
Frederic Riss dce60a747c Fix a temporary MDNode leak.
While emitting debug information for function forward decalrations, we
create DISubprogram objects that aran't stored in the AllSubprograms
list, and thus won't get finalized by the DIBuilder. During the DIBuilder
finalize(), the temporary MDNode allocated for the DISubprogram
Variables field gets RAUWd with a non temporary DIArray. For the forward
declarations, simply delete that temporary node before we delete the
parent node, so that it doesn't leak.

llvm-svn: 222373
2014-11-19 18:53:46 +00:00
Saleem Abdulrasool 4325aaa6d9 Driver: correct typo
Fix a typo in the search path identified by Justin Bogner.

llvm-svn: 222371
2014-11-19 17:59:00 +00:00
Daniel Jasper fe2cf6673a clang-format: [Java] Ignore C++-specific keywords
Before:
  public void union
  (Object o);
  public void struct
  (Object o);
  public void delete (Object o);

After:
  public void union(Object o);
  public void struct(Object o);
  public void delete(Object o);

Patch by Harry Terkelsen, thank you!

llvm-svn: 222357
2014-11-19 14:11:11 +00:00
Daniel Sanders 59229dcb29 Allow EmitVAArg() to promote types and use this to fix some N32/N64 vararg issues for Mips.
Summary:
With this patch, passing a va_list to another function and reading 10 int's from
it works correctly on a big-endian target.

Based on a pair of patches by David Chisnall, one of which I've reworked
for the current trunk.

Reviewers: theraven, atanasyan

Reviewed By: theraven, atanasyan

Subscribers: cfe-commits

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

llvm-svn: 222339
2014-11-19 10:01:35 +00:00
David Blaikie 82e95a3c79 Update for LLVM API change to make Small(Ptr)Set::insert return pair<iterator, bool> as per the C++ standard's associative container concept.
llvm-svn: 222335
2014-11-19 07:49:47 +00:00
Richard Trieu 791b86ec55 Add the exception for strings in logical and expressions to -Wstring-conversion
for C code.

llvm-svn: 222327
2014-11-19 06:08:18 +00:00
David Blaikie 3c8c46efd7 clang-format a recent commit I made
llvm-svn: 222317
2014-11-19 05:48:40 +00:00
Nico Weber b58e51c304 Wrap to 80 columns, no behavior change.
llvm-svn: 222315
2014-11-19 05:21:39 +00:00
David Blaikie 13156b689e Standardize on StringMap::insert, removing uses of StringMap::GetOrCreateValue.
llvm-svn: 222306
2014-11-19 03:06:06 +00:00
David Blaikie 61b86d4338 Update for LLVM API change
llvm-svn: 222303
2014-11-19 02:56:13 +00:00
Daniel Jasper 3aa9a6a126 clang-format: Add option to disable alignment after opening brackets
Before:
  SomeFunction(parameter,
               parameter);

After:
  SomeFunction(parameter,
      parameter);

Patch by Harry Terkelsen, thank you!

llvm-svn: 222284
2014-11-18 23:55:27 +00:00
Daniel Jasper 6761b42b90 clang-format: Fix space between generic type parameter and square
bracket

Before:
  public Foo<X, Y> [] foos;

After:
  public Foo<X, Y>[] foos;

Patch by Harry Terkelsen. Thank you!

llvm-svn: 222283
2014-11-18 23:48:01 +00:00
Eric Christopher 917e952d2d Fix 80-column violations, trailing whitespace, comment text.
llvm-svn: 222269
2014-11-18 22:36:15 +00:00
Eric Christopher 8be702dbaa This test also requires an aarch64 target.
llvm-svn: 222268
2014-11-18 22:36:11 +00:00
Fariborz Jahanian ef202d96c7 [Sema] Patch to issue warning on comparing parameters with
nonnull attribute when comparison is always true/false. 
Original patch by Steven Wu. I have added extra code to prevent issuing of
warning  when the nonnull parameter is modified prior to the comparison.
This addition prevents false positives in the most obvious cases.
There may still be false positive warnings in some cases (as one of my tests
indicates), but benefit far outweighs such cases. rdar://18712242

llvm-svn: 222264
2014-11-18 21:57:54 +00:00
NAKAMURA Takumi cb6579c0f1 OMPAtomicDirective::Create(): Fix \param. [-Wdocumentation]
llvm-svn: 222237
2014-11-18 15:05:01 +00:00
Alexey Bataev 62cec44ca4 [OPENMP] Additional processing of 'omp atomic read' directive.
According to OpenMP standard, Section 2.12.6, atomic Construct, '#pragma omp atomic read' is allowed to be used only for expression statements of form 'v = x;', where x and v (as applicable) are both l-value expressions with scalar type. Patch adds checks for it.

llvm-svn: 222231
2014-11-18 10:14:22 +00:00
Justin Hibbits 90ca05e5e5 Add PIC-level support to Clang.
Summary:
This distinguishes between -fpic and -fPIC now, with the additions in LLVM for
PIC level support.

Test Plan: No regressions

Reviewers: echristo, rafael

Reviewed By: rafael

Subscribers: rnk, emaste, llvm-commits

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

llvm-svn: 222227
2014-11-18 06:17:20 +00:00
Argyrios Kyrtzidis 1bde117bea [ASTReader] Add a convenience function to retrieve all the input files of a module file.
llvm-svn: 222224
2014-11-18 05:24:18 +00:00
Frederic Riss d253ed6565 Fully handle globals and functions in CGDebugInfo::getDeclarationOrDefinition()
Currently this function would return nothing for functions or globals that
haven't seen a definition yet. Make it return a forward declaration that will
get RAUWed with the definition if one is seen at a later point. The strategy
used to implement this is similar to what's done for types: the forward
declarations are stored in a vector and post processed upon finilization to
perform the required RAUWs.

For now the only user of getDeclarationOrDefinition() is EmitUsingDecl(), thus
this patch allows to emit correct imported declarations even in the absence of
an actual definition of the imported entity.

(Another user will be the debug info generation for argument default values
that I need to resurect).

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

llvm-svn: 222220
2014-11-18 03:40:51 +00:00
Frederic Riss 9db79f17c0 [DebugInfo] Move collection of various function/var decl properties into helper functions.
NFC. Helpers to be re-used in upcoming commit.

llvm-svn: 222219
2014-11-18 03:40:46 +00:00
Justin Bogner 94d384e423 InstrProf: Don't emit coverage for uninstantiated templates
We include unused functions and methods in -fcoverage-mapping so that
we can differentiate between uninstrumented and unused. This can cause
problems for uninstantiated templates though, since they may involve
an incomplete type that can't be mangled. This shows up in things like
libc++'s <unordered_map> and makes coverage unusable.

Avoid the issue by skipping uninstantiated methods of a templated
class.

llvm-svn: 222204
2014-11-18 00:34:46 +00:00
Manman Ren 408549644d Debug Info: context field of a global variable is DIScopeRef.
Paired commit with r222195.

llvm-svn: 222196
2014-11-18 00:29:32 +00:00
John McCall 0d8d6c094f Fix an assertion when ending a function definition.
The bug is that ExprCleanupObjects isn't always empty
in a fresh evaluation context.  New evaluation contexts just
track the current depth of the stack.

The assertion will misfire whenever we finish processing
a function body inside an expression that contained an earlier
block literal with non-trivial captures.  That's actually
a lot less likely than you'd think, though, because it has
to be a real function declaration, not just another block.
Mixed block/lambda code would work, as would a template
instantiation or a local class definition.

The code works correctly if the assertion is disabled.

rdar://16356628

llvm-svn: 222194
2014-11-18 00:19:01 +00:00
Alexander Kornienko 41c247a677 Make DiagnosticsEngine::takeClient return std::unique_ptr<>
Summary:
Make DiagnosticsEngine::takeClient return std::unique_ptr<>. Updated
callers to store conditional ownership using a pair of pointer and unique_ptr
instead of a pointer + bool. Updated code that temporarily registers clients to
use the non-owning registration (+ removed extra calls to takeClient).

Reviewers: dblaikie

Reviewed By: dblaikie

Subscribers: cfe-commits

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

llvm-svn: 222193
2014-11-17 23:46:02 +00:00
Reid Kleckner d60b82f93e Handle use of default member initializers before end of outermost class
Specifically, when we have this situation:
  struct A {
    template <typename T> struct B {
      int m1 = sizeof(A);
    };
    B<int> m2;
  };

We can't parse m1's initializer eagerly because we need A to be
complete.  Therefore we wait until the end of A's class scope to parse
it. However, we can trigger instantiation of B before the end of A,
which will attempt to instantiate the field decls eagerly, and it would
build a bad field decl instantiation that said it had an initializer but
actually lacked one.

Fixed by deferring instantiation of default member initializers until
they are needed during constructor analysis. This addresses a long
standing FIXME in the code.

Fixes PR19195.

Reviewed By: rsmith

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

llvm-svn: 222192
2014-11-17 23:36:45 +00:00
Saleem Abdulrasool b7698745e9 CodeGen: make a check stricter
When targeting Windows itanium (a MSVC environment), use itanium style
exceptions rather than SEH.  Existing test cases already test this code path.
Applying this change ensures that tests wont break due to a parallel change in
LLVM (to correctly report isMSVCEnvironment).

llvm-svn: 222179
2014-11-17 22:11:07 +00:00