]> granicus.if.org Git - clang/log
clang
10 years agoGetting rid of a string literal in favor of the generalized diagnostic.
Aaron Ballman [Thu, 26 Dec 2013 16:13:50 +0000 (16:13 +0000)]
Getting rid of a string literal in favor of the generalized diagnostic.

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

10 years agoParameterizing some MS property-related diagnostics. No functional changes intended.
Aaron Ballman [Thu, 26 Dec 2013 15:46:38 +0000 (15:46 +0000)]
Parameterizing some MS property-related diagnostics. No functional changes intended.

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

10 years agoNo need for the manual quotes and extra getName() call. No functional changes intended.
Aaron Ballman [Thu, 26 Dec 2013 15:06:01 +0000 (15:06 +0000)]
No need for the manual quotes and extra getName() call. No functional changes intended.

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

10 years agoRemoving some unneeded code, and a diagnostic that was obsoleted. The type has alread...
Aaron Ballman [Thu, 26 Dec 2013 14:54:11 +0000 (14:54 +0000)]
Removing some unneeded code, and a diagnostic that was obsoleted. The type has already been determined to be a ValueDecl by virtue of the attribute subjects.

Added some test case coverage as well.

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

10 years agoDon't reserve __builtin_types_compatible_p as a C++ keyword
Alp Toker [Wed, 25 Dec 2013 01:47:02 +0000 (01:47 +0000)]
Don't reserve __builtin_types_compatible_p as a C++ keyword

Even g++ considers this a valid C++ identifier and it should only have been
visible in C mode.

Also drop the associated low-value diagnostic.

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

10 years agoAdd some missing test cases for ACLE intrinsics of AArch64 NEON.
Jiangning Liu [Wed, 25 Dec 2013 01:23:43 +0000 (01:23 +0000)]
Add some missing test cases for ACLE intrinsics of AArch64 NEON.

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

10 years agoAdd a FIXME to a failing test.
Nico Weber [Tue, 24 Dec 2013 20:48:13 +0000 (20:48 +0000)]
Add a FIXME to a failing test.

(See discussion in the bug for why this isn't XFAILed.)

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

10 years agoclang-format: (WebKit) Disallow 1-line constructors with initializers.
Daniel Jasper [Tue, 24 Dec 2013 13:31:25 +0000 (13:31 +0000)]
clang-format: (WebKit) Disallow 1-line constructors with initializers.

Before:
  Constructor() : a(a) {}

After:
  Constructor()
      : a(a)
  {
  }

This style guide is pretty precise about this.

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

10 years agoSupport and use token kinds as diagnostic arguments
Alp Toker [Tue, 24 Dec 2013 09:48:30 +0000 (09:48 +0000)]
Support and use token kinds as diagnostic arguments

Introduce proper facilities to render token spellings using the diagnostic
formatter.

Replaces most of the hard-coded diagnostic messages related to expected tokens,
which all shared the same semantics but had to be multiply defined due to
variations in token order or quote marks.

The associated parser changes are largely mechanical but they expose
commonality in whole chunks of the parser that can now be factored away.

This commit uses C++11 typed enums along with a speculative legacy fallback
until the transition is complete.

Requires corresponding changes in LLVM r197895.

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

10 years agoDocument the Message parameter of getCustomDiagID()
Alp Toker [Mon, 23 Dec 2013 21:00:35 +0000 (21:00 +0000)]
Document the Message parameter of getCustomDiagID()

A lot of callers have been using this facility incorrectly.

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

10 years agoremove dead code.
Adrian Prantl [Mon, 23 Dec 2013 19:10:57 +0000 (19:10 +0000)]
remove dead code.

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

10 years agoFix another misuse of getCustomDiagID()
Alp Toker [Mon, 23 Dec 2013 17:59:59 +0000 (17:59 +0000)]
Fix another misuse of getCustomDiagID()

There's no need to escape strings and generate new DiagIDs for each message.

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

10 years agoclang/Analysis/FlowSensitive/DataflowSolver.h: <functional> should be just a STL...
NAKAMURA Takumi [Mon, 23 Dec 2013 16:34:51 +0000 (16:34 +0000)]
clang/Analysis/FlowSensitive/DataflowSolver.h: <functional> should be just a STL header.

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

10 years agoConsolidating some mode attribute diagnostics. No functional changes intended.
Aaron Ballman [Mon, 23 Dec 2013 15:23:11 +0000 (15:23 +0000)]
Consolidating some mode attribute diagnostics. No functional changes intended.

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

10 years agoclang-format: Fix invalid write discovered by ASAN.
Daniel Jasper [Mon, 23 Dec 2013 11:25:40 +0000 (11:25 +0000)]
clang-format: Fix invalid write discovered by ASAN.

Introduced in r197900.

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

10 years agoAdd a missing pipe in the test from r197896
Alp Toker [Mon, 23 Dec 2013 08:50:43 +0000 (08:50 +0000)]
Add a missing pipe in the test from r197896

Spotted by Edward

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

10 years agoTextDiagnosticBuffer: Fix copy-paste mistake in r197856
Alp Toker [Mon, 23 Dec 2013 07:47:48 +0000 (07:47 +0000)]
TextDiagnosticBuffer: Fix copy-paste mistake in r197856

The TextDiagnosticBuffer is meant to scrub SourceLocations as the input/output
SourceManagers may be different.

To be safe this commit restores the original behaviour though in practice
all current users seem to share a single SM.

Would be nice to replace TextDiagnosticBuffer now that more capable interfaces
like CaptureDiagnosticConsumer / StoredDiagnosticConsumer exist.

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

10 years agoclang-format: Fix various problems in formatting ObjC blocks.
Daniel Jasper [Mon, 23 Dec 2013 07:29:06 +0000 (07:29 +0000)]
clang-format: Fix various problems in formatting ObjC blocks.

Among other things, this fixes llvm.org/PR15269.

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

10 years ago[AArch64]The compare to zero intrinsics should be implemented by 'icmp/fcmp' and...
Hao Liu [Mon, 23 Dec 2013 02:44:00 +0000 (02:44 +0000)]
[AArch64]The compare to zero intrinsics should be implemented by 'icmp/fcmp' and 'sext' not 'zext'. Modify the implementation by replacing zext with sext.

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

10 years agoMake some f_Group definitions anonymous and test an alternative spelling
Alp Toker [Sun, 22 Dec 2013 22:38:57 +0000 (22:38 +0000)]
Make some f_Group definitions anonymous and test an alternative spelling

These names weren't referred to anywhere in the source so don't need a written
name.

Depends on the TableGen fix for anonymous records in LLVM r197869.

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

10 years agoRemoving the alloc_size attribute. The attribute was semantically handled, but silent...
Aaron Ballman [Sat, 21 Dec 2013 17:15:13 +0000 (17:15 +0000)]
Removing the alloc_size attribute. The attribute was semantically handled, but silently ignored. Most of this feature was already reverted in June 2012 (r159016), this just cleans up the pieces left over.

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

10 years agoThe const and nothrow attributes can be handled by the simple attribute handler....
Aaron Ballman [Sat, 21 Dec 2013 16:49:29 +0000 (16:49 +0000)]
The const and nothrow attributes can be handled by the simple attribute handler. This removes a silent dropping of the attributes when they are duplicated on a Decl.

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

10 years agoFix getCustomDiagID() usage in CodeGen and TextDiagnosticBuffer
Alp Toker [Sat, 21 Dec 2013 05:20:03 +0000 (05:20 +0000)]
Fix getCustomDiagID() usage in CodeGen and TextDiagnosticBuffer

DiagIDs are a cached resource generally only constructed from compile-time
constant or stable format strings.

Escaping arbitrary messages and constructing DiagIDs from them didn't make
sense.

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

10 years agoFix getCustomDiagID() usage in example code
Alp Toker [Sat, 21 Dec 2013 05:19:58 +0000 (05:19 +0000)]
Fix getCustomDiagID() usage in example code

This was setting a bad example. DiagIDs are a limited resource and the message
argument is evaluated as a format string.

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

10 years agoAdd -Winfinite-recursion to Clang
Richard Trieu [Sat, 21 Dec 2013 02:33:43 +0000 (02:33 +0000)]
Add -Winfinite-recursion to Clang

This new warning detects when a function will recursively call itself on every
code path though that function.  This catches simple recursive cases such as:

void foo() {
  foo();
}

As well as more complex functions like:

void bar() {
  if (test()) {
    bar();
    return;
  } else {
    bar();
  }
  return;
}

This warning uses the CFG.  As with other CFG-based warnings, this is off
by default.  Due to false positives, this warning is also disabled for
templated functions.

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

10 years ago[CMake] clang/lib/Headers: Install just-generated ${CMAKE_CURRENT_BINARY_DIR}/arm_neo...
NAKAMURA Takumi [Sat, 21 Dec 2013 01:56:00 +0000 (01:56 +0000)]
[CMake] clang/lib/Headers: Install just-generated ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h, instead of copied arm_neon.h.

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

10 years agoAssert that tag decls are never marked (in)valid after definition is complete
Alp Toker [Sat, 21 Dec 2013 01:10:54 +0000 (01:10 +0000)]
Assert that tag decls are never marked (in)valid after definition is complete

Sema relies on this assumption.

Follow-up to r197848.

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

10 years agoUse this one little trick to prevent optimizers from removing an
Richard Trieu [Sat, 21 Dec 2013 01:04:02 +0000 (01:04 +0000)]
Use this one little trick to prevent optimizers from removing an
intentional stack overflow.

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

10 years agoDon't mark record decls invalid when one of its methods is invalid, PR18284.
Nico Weber [Sat, 21 Dec 2013 00:49:51 +0000 (00:49 +0000)]
Don't mark record decls invalid when one of its methods is invalid, PR18284.

Without this patch, record decls with invalid out-of-line method delcs would
sometimes be marked invalid, but not always.  With this patch, they are
consistently never marked invalid.

(The code to do this was added in
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20100809/033154.html
, but the test from that revision is still passing.)

As far as I can tell, this was the only place where a class was marked invalid
after its definition was complete.

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

10 years agoEliminate the ItaniumVTableContext object from CodeGenVTables
Reid Kleckner [Fri, 20 Dec 2013 23:58:52 +0000 (23:58 +0000)]
Eliminate the ItaniumVTableContext object from CodeGenVTables

Now CodeGenVTables has only one VTableContext object, which is either
Itanium or Microsoft.

Fixes a FIXME with no functionality change intended.

Ideally we could avoid the downcasts by pushing the things that
reference the Itanium vtable context into ItaniumCXXABI.cpp, but we're
not there yet.

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

10 years agoDebugInfo: Do not include implicit members (implicit special members, template instan...
David Blaikie [Fri, 20 Dec 2013 23:19:47 +0000 (23:19 +0000)]
DebugInfo: Do not include implicit members (implicit special members, template instantiations, etc) in the list of members of a structure.

These members will still be lazily added to the relevant DWARF DIEs in
LLVM but when enumerating the members they will not appear. This allows
DWARF type units to be more consistent - the type unit will never
contain these special members (so all instances of the type should have
the same DIEs without some having some special members and others having
others) and the special members will be added to the skeletal
declaration that appears in the relevant compile_unit.

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

10 years agoRemove obsolete preamble FIXME
Alp Toker [Fri, 20 Dec 2013 22:27:20 +0000 (22:27 +0000)]
Remove obsolete preamble FIXME

The MD5 is checked since r197755 which is as good as comparing buffer contents
in this context.

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

10 years agoOverride the datalayout in a module with -triple.
Rafael Espindola [Fri, 20 Dec 2013 22:01:25 +0000 (22:01 +0000)]
Override the datalayout in a module with -triple.

This matches llc's behavior.

Before this patch clang would create a TargetInfo base on -triple but a llvm
CodeGen based on the triple in the module.

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

10 years agoCompare canonical return types when generating MS C++ ABI vtable thunks
Reid Kleckner [Fri, 20 Dec 2013 21:44:05 +0000 (21:44 +0000)]
Compare canonical return types when generating MS C++ ABI vtable thunks

This was part of the cause for PR17655.  We were generating thunks when
we shouldn't have.  I suspect that if we tweak the test case for PR17655
to actually require thunks, we can reproduce the same crash.

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

10 years agoMove the TargetMachine instance into EmitAssemblyHelper
Alp Toker [Fri, 20 Dec 2013 20:26:53 +0000 (20:26 +0000)]
Move the TargetMachine instance into EmitAssemblyHelper

Cleanup in preparation for enhanced DataLayout checking.

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

10 years agoclang-cl: Support /P and /E (preprocess to file or stdout)
Hans Wennborg [Fri, 20 Dec 2013 18:40:46 +0000 (18:40 +0000)]
clang-cl: Support /P and /E (preprocess to file or stdout)

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

10 years agoRemove an outdated statement about debugging optimized code.
Adrian Prantl [Fri, 20 Dec 2013 17:39:42 +0000 (17:39 +0000)]
Remove an outdated statement about debugging optimized code.

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

10 years agoDocument the -fno-limit-debug-info switch in the man page.
Adrian Prantl [Fri, 20 Dec 2013 17:39:35 +0000 (17:39 +0000)]
Document the -fno-limit-debug-info switch in the man page.

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

10 years agoEnable layering check in unavailable modules.
Daniel Jasper [Fri, 20 Dec 2013 12:09:36 +0000 (12:09 +0000)]
Enable layering check in unavailable modules.

If a header file belonging to a certain module is not found on the
filesystem, that header gets marked as unavailable. Now, the layering
warning (-fmodules-decluse) should still warn about headers of this
module being wrongfully included. Currently, headers belonging to those
modules are just treated as not belonging to modules at all which means
they can be included freely from everywhere.

To implement this (somewhat) cleanly, I have moved most of the layering
checks into the ModuleMap. This will also help with showing FixIts
later.

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

10 years agoclang-format: Better support for multi-line wide string literals.
Daniel Jasper [Fri, 20 Dec 2013 06:22:01 +0000 (06:22 +0000)]
clang-format: Better support for multi-line wide string literals.

Before:
  SomeFunction(L"A" L"B");

After:
  SomeFunction(L"A"
               L"B");

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

10 years ago[analyzer] Use DataRecursiveASTVisitor for the AnalysisConsumer.
Argyrios Kyrtzidis [Fri, 20 Dec 2013 02:02:58 +0000 (02:02 +0000)]
[analyzer] Use DataRecursiveASTVisitor for the AnalysisConsumer.

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

10 years agoMove tools/libclang/RecursiveASTVisitor.h -> include/clang/AST/DataRecursiveASTVisitor.h
Argyrios Kyrtzidis [Fri, 20 Dec 2013 02:02:54 +0000 (02:02 +0000)]
Move tools/libclang/RecursiveASTVisitor.h -> include/clang/AST/DataRecursiveASTVisitor.h

This is to make it available so the static analyzer can use it.

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

10 years ago[libclang/python] Add CompilationDatabase.getAllCompileCommands to the python bindings.
Argyrios Kyrtzidis [Fri, 20 Dec 2013 01:34:00 +0000 (01:34 +0000)]
[libclang/python] Add CompilationDatabase.getAllCompileCommands to the python bindings.

Patch by Laszlo Nagy!

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

10 years agoSerialize source range info for TypeTraitExpr.
Jordan Rose [Fri, 20 Dec 2013 01:26:47 +0000 (01:26 +0000)]
Serialize source range info for TypeTraitExpr.

This caused some crazy crashes involving std::unordered_map being
deserialized from a PCH file and then template instantiation requiring
an explicit instantiation location; unfortunately I don't really know
how to come up with a minimal test case.

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

10 years agoCorrectly compute the size in bytes of PreambleFileHash.MD5
Dmitri Gribenko [Fri, 20 Dec 2013 01:07:30 +0000 (01:07 +0000)]
Correctly compute the size in bytes of PreambleFileHash.MD5

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

10 years agoAdd a test I forgot to svn add in r197755
Dmitri Gribenko [Fri, 20 Dec 2013 00:21:47 +0000 (00:21 +0000)]
Add a test I forgot to svn add in r197755

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

10 years agoASTUnit::getMainBufferWithPrecompiledPreamble: use MD5 hash of the remapped
Dmitri Gribenko [Fri, 20 Dec 2013 00:16:25 +0000 (00:16 +0000)]
ASTUnit::getMainBufferWithPrecompiledPreamble: use MD5 hash of the remapped
files to tell if they were changed since the last time we have computed the
preamble

We used to check only the buffer size, so if the new remapped buffer has the
same size as the previous one, we would think that the buffer did not change,
and we did not rebuild the preambule, which sometimes caused us to crash.

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

10 years agoSimplify code
Dmitri Gribenko [Thu, 19 Dec 2013 23:25:59 +0000 (23:25 +0000)]
Simplify code

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

10 years ago[analyzer] Fix test in previous commit to account for compiler warning.
Jordan Rose [Thu, 19 Dec 2013 23:05:40 +0000 (23:05 +0000)]
[analyzer] Fix test in previous commit to account for compiler warning.

--analyze passes -w, but -cc1 -analyze doesn't. Oops!

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

10 years agoWordsmith "maybe" into "may be" in diagnostic, and move warning under flag.
Ted Kremenek [Thu, 19 Dec 2013 22:47:11 +0000 (22:47 +0000)]
Wordsmith "maybe" into "may be" in diagnostic, and move warning under flag.

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

10 years ago[analyzer] Always use 'bool' as the SValBuilder condition type in C++.
Jordan Rose [Thu, 19 Dec 2013 22:32:39 +0000 (22:32 +0000)]
[analyzer] Always use 'bool' as the SValBuilder condition type in C++.

We have assertions for this, but a few edge cases had snuck through where
we were still unconditionally using 'int'.

<rdar://problem/15703011>

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

10 years agoRemove dead code identified by Aaron Ballman.
Ted Kremenek [Thu, 19 Dec 2013 22:23:12 +0000 (22:23 +0000)]
Remove dead code identified by Aaron Ballman.

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

10 years agoAfter discussing with John McCall, removing the ns_bridged attribute as it is unused.
Aaron Ballman [Thu, 19 Dec 2013 22:12:51 +0000 (22:12 +0000)]
After discussing with John McCall, removing the ns_bridged attribute as it is unused.

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

10 years agoclang-format: Add special case for leading comments in braced lists.
Daniel Jasper [Thu, 19 Dec 2013 21:41:37 +0000 (21:41 +0000)]
clang-format: Add special case for leading comments in braced lists.

A comment following the "{" of a braced list seems to almost always
refer to the first element of the list and thus should be aligned
to it.

Before (with Cpp11 braced list style):
  SomeFunction({  // Comment 1
                   "first entry",
                   // Comment 2
                   "second entry"});
After:
  SomeFunction({// Comment 1
                "first entry",
                // Comment 2
                "second entry"});

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

10 years agoReverting r197715 -- it appears that MSVC is happy with the code, but clang is not.
Aaron Ballman [Thu, 19 Dec 2013 19:39:25 +0000 (19:39 +0000)]
Reverting r197715 -- it appears that MSVC is happy with the code, but clang is not.

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

10 years agoNo longer leaking Argument objects after calling createArgument. However, since an...
Aaron Ballman [Thu, 19 Dec 2013 19:33:35 +0000 (19:33 +0000)]
No longer leaking Argument objects after calling createArgument. However, since an OwningPtr cannot live in a std::vector yet, there are some manual deletions that have a FIXME attached to them. These will go away once C++11 support is allowed.

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

10 years ago[CMake] Tweak r197697 to handle CMake finding the wrong llvm-config/tblgen.
Jordan Rose [Thu, 19 Dec 2013 18:39:05 +0000 (18:39 +0000)]
[CMake] Tweak r197697 to handle CMake finding the wrong llvm-config/tblgen.

- If llvm-config fails, output an error to the user rather than allowing
  errors to cascade.
- Always get llvm-tblgen from llvm-config's bindir.

Turns out my PATH points to a really old version of LLVM; both of these
fell out of trying to make this experience nicer.

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

10 years agoType attribute do not get an AST node by default, so these statements can be removed...
Aaron Ballman [Thu, 19 Dec 2013 18:16:00 +0000 (18:16 +0000)]
Type attribute do not get an AST node by default, so these statements can be removed (it's inherited automatically from TypeAttr).

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

10 years agoRemoving the SourceLocation unused attribute argument type.
Aaron Ballman [Thu, 19 Dec 2013 18:10:57 +0000 (18:10 +0000)]
Removing the SourceLocation unused attribute argument type.

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

10 years agoObjectiveC. Sema test for property, methods
Fariborz Jahanian [Thu, 19 Dec 2013 17:22:23 +0000 (17:22 +0000)]
ObjectiveC. Sema test for property, methods
'section' attribute. // rdar://15450637

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

10 years agocheck-clang: Suppress LLVM_LIT in add_lit_testsuite, for now.
NAKAMURA Takumi [Thu, 19 Dec 2013 17:10:30 +0000 (17:10 +0000)]
check-clang: Suppress LLVM_LIT in add_lit_testsuite, for now.

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

10 years agoSmall simplification: p0 is the same as p.
Rafael Espindola [Thu, 19 Dec 2013 16:54:10 +0000 (16:54 +0000)]
Small simplification: p0 is the same as p.

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

10 years agoclang-format: Increase penalty for breaking comments.
Daniel Jasper [Thu, 19 Dec 2013 16:45:34 +0000 (16:45 +0000)]
clang-format: Increase penalty for breaking comments.

Unexpectedly, it seems that people commonly know what they were doing
when writing a comment.

Also, being more conservative about comment breaking has the advantage
of giving more flexibility. If a linebreak within the comment can
improve formatting, the author can add it (after which clang-format
won't undo it). There is no way to override clang-format's behavior if
it breaks a comment.

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

10 years ago[CMake][Standalone] Rewrite standalone build based on llvm-config. CLANG_PATH_TO_LLVM...
NAKAMURA Takumi [Thu, 19 Dec 2013 16:44:32 +0000 (16:44 +0000)]
[CMake][Standalone] Rewrite standalone build based on llvm-config. CLANG_PATH_TO_LLVM_*(s) are deprecated.

Checked on VS10(multiconfig) and some singleconfig builders.

* Assumptions

  - You should specify llvm-config as LLVM_CONFIG.
    CMake could find one in $PATH by default.

  - ENABLE_ASSERTIONS obeys LLVM's.

* Use cases

  a) With LLVM build tree

    Assume llvm-config is in your build tree.
    Everything should work as ever.

  b) With *installed* LLVM

    Assume distributions. The source tree can be optional.

    b1) The source tree is provided on the location `llvm-config --src-root`

      - Test utils, FileCheck &c., are imported and built in the new tree.
      - Gtest is built in the tree if gtest library is not found.
      - Lit is used in $(SRCROOT)/utils/lit/lit.py.

    b2) The source tree is not provided

      - clang and utilities can be built.
      - All tests, unittests and check-clang are invalidated and not built.

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

10 years agoFix comment typo.
Will Wilson [Thu, 19 Dec 2013 16:24:17 +0000 (16:24 +0000)]
Fix comment typo.

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

10 years agoclang-format: Slightly adapt decision of when to break before <<.
Daniel Jasper [Thu, 19 Dec 2013 16:06:40 +0000 (16:06 +0000)]
clang-format: Slightly adapt decision of when to break before <<.

Before:
  Diag(aaaaaaaaaaaaaaaaaaaaaaaaaaaa) << aaaaaaaaaaaaaaaaaaaaaaaaa(
                                              aaaaaaaaaaaaa);

After:
  Diag(aaaaaaaaaaaaaaaaaaaaaaaaaaaa)
      << aaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaa);

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

10 years ago[CMake] check-clang: Include ClangUnitTests if it can be built. Check existence of...
NAKAMURA Takumi [Thu, 19 Dec 2013 16:05:44 +0000 (16:05 +0000)]
[CMake] check-clang: Include ClangUnitTests if it can be built. Check existence of gtest.h then.

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

10 years ago[CMake] check-clang: Append items to CLANG_TEST_DEPS rather than set. CLANG_TEST_DEPS...
NAKAMURA Takumi [Thu, 19 Dec 2013 16:05:39 +0000 (16:05 +0000)]
[CMake] check-clang: Append items to CLANG_TEST_DEPS rather than set. CLANG_TEST_DEPS can be set in parent scope.

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

10 years ago[CMake] check-clang: Deprecate --path, according to r197576.
NAKAMURA Takumi [Thu, 19 Dec 2013 16:05:34 +0000 (16:05 +0000)]
[CMake] check-clang: Deprecate --path, according to r197576.

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

10 years agoSwitching getAttrs calls over to using a specific_attr_iterator. No functional change...
Aaron Ballman [Thu, 19 Dec 2013 15:35:31 +0000 (15:35 +0000)]
Switching getAttrs calls over to using a specific_attr_iterator. No functional changes intended.

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

10 years agoSwitched code from using hasAttr followed by getAttr to simply call getAttr directly...
Aaron Ballman [Thu, 19 Dec 2013 13:36:16 +0000 (13:36 +0000)]
Switched code from using hasAttr followed by getAttr to simply call getAttr directly and check the resulting value.

No functional changes intended.

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

10 years agoSwitched code from using hasAttr followed by getAttr to simply call getAttr directly.
Aaron Ballman [Thu, 19 Dec 2013 13:20:36 +0000 (13:20 +0000)]
Switched code from using hasAttr followed by getAttr to simply call getAttr directly.

No functional changes intended.

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

10 years agoHosting a call to getAttr so that we don't call it multiple times for the same attrib...
Aaron Ballman [Thu, 19 Dec 2013 13:16:35 +0000 (13:16 +0000)]
Hosting a call to getAttr so that we don't call it multiple times for the same attribute. Also removes a hasAttr that's not required. No functional changes intended.

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

10 years agoFix usage description of clang-format-diff.py.
Daniel Jasper [Thu, 19 Dec 2013 10:21:37 +0000 (10:21 +0000)]
Fix usage description of clang-format-diff.py.

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

10 years agoUpdate SI datalayout for 32-bit private pointers
Matt Arsenault [Thu, 19 Dec 2013 05:33:14 +0000 (05:33 +0000)]
Update SI datalayout for 32-bit private pointers

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

10 years agoSwitched code from using hasAttr followed by getAttr to simply call getAttr directly...
Aaron Ballman [Thu, 19 Dec 2013 03:09:10 +0000 (03:09 +0000)]
Switched code from using hasAttr followed by getAttr to simply call getAttr directly and check the resulting value.

No functional changes intended.

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

10 years agoOn spacv8 f128 is only aligned to 64 bits.
Rafael Espindola [Thu, 19 Dec 2013 03:03:04 +0000 (03:03 +0000)]
On spacv8 f128 is only aligned to 64 bits.

LLVM already got this right.

Found on "Figure 3-1: Scalar Types" on http://sparc.com/standards/psABI3rd.pdf.

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

10 years agoSwitched code from using hasAttr followed by getAttr to simply call getAttr directly...
Aaron Ballman [Thu, 19 Dec 2013 03:02:49 +0000 (03:02 +0000)]
Switched code from using hasAttr followed by getAttr to simply call getAttr directly and check the resulting value.

No functional changes intended.

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

10 years agoSwitched code from using hasAttr followed by getAttr to simply call getAttr directly...
Aaron Ballman [Thu, 19 Dec 2013 02:58:51 +0000 (02:58 +0000)]
Switched code from using hasAttr followed by getAttr to simply call getAttr directly and check the resulting value. Also fixes some minor formatting issues surrounding the getAttr code.

No functional changes intended.

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

10 years agoReplacing calls to getAttr with calls to hasAttr for clarity. No functional change...
Aaron Ballman [Thu, 19 Dec 2013 02:39:40 +0000 (02:39 +0000)]
Replacing calls to getAttr with calls to hasAttr for clarity. No functional change intended -- this only replaces Boolean uses of getAttr.

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

10 years agoPCH: fix a crash caused by a circular deserialization dependency
Dmitri Gribenko [Thu, 19 Dec 2013 02:05:20 +0000 (02:05 +0000)]
PCH: fix a crash caused by a circular deserialization dependency

We started by trying to deserialize decltype(func-param) in a trailing return
type, which causes the function parameter decl to be deserialized, which pulls
in the function decl, which pulls the function type, which pulls the same
decltype() in the return type, and then we crashed.

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

10 years agoSimplify CXXMethodDecl::isVirtual() for __interface case
Dmitri Gribenko [Thu, 19 Dec 2013 01:58:52 +0000 (01:58 +0000)]
Simplify CXXMethodDecl::isVirtual() for __interface case

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

10 years agoDebug info: (Bugfix) emit CRV qualifiers for pointers to member functions.
Adrian Prantl [Thu, 19 Dec 2013 01:38:47 +0000 (01:38 +0000)]
Debug info: (Bugfix) emit CRV qualifiers for pointers to member functions.
rdar://problem/15678916.

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

10 years ago[ms-abi] Update Alignment for VtorDisps
Warren Hunt [Thu, 19 Dec 2013 00:43:59 +0000 (00:43 +0000)]
[ms-abi] Update Alignment for VtorDisps

The alignment impact of the virtual bases apperas to be applied in
order, rather than up front.  This patch adds the new behavior and
provides a test case.

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

10 years agoAdded a comment about the launch_bounds attribute's AST node being required. Since...
Aaron Ballman [Thu, 19 Dec 2013 00:41:31 +0000 (00:41 +0000)]
Added a comment about the launch_bounds attribute's AST node being required. Since there were no test cases for the attribute, some have been added. This promptly demonstrated a bug with the semantic handling, which is also fixed.

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

10 years agoRefactor the Microsoft inheritance attribute handling so that it no longer has specia...
Aaron Ballman [Wed, 18 Dec 2013 23:44:18 +0000 (23:44 +0000)]
Refactor the Microsoft inheritance attribute handling so that it no longer has special treatment. Also fixes a minor bug where the attributes were being parsed as though they were GNU-style attributes when they were in fact keyword attributes.

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

10 years agoFix the DataLayout string produced by clang for NaCl.
Rafael Espindola [Wed, 18 Dec 2013 23:41:04 +0000 (23:41 +0000)]
Fix the DataLayout string produced by clang for NaCl.

Reviewed by Derek Schuff.

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

10 years agoImplemented delayed processing of 'unavailable' checking, just like with 'deprecated'.
Ted Kremenek [Wed, 18 Dec 2013 23:30:06 +0000 (23:30 +0000)]
Implemented delayed processing of 'unavailable' checking, just like with 'deprecated'.

Fixes <rdar://problem/15584219> and <rdar://problem/12241361>.

This change looks large, but all it does is reuse and consolidate
the delayed diagnostic logic for deprecation warnings with unavailability
warnings.  By doing so, it showed various inconsistencies between the
diagnostics, which were close, but not consistent.  It also revealed
some missing "note:"'s in the deprecated diagnostics that were showing
up in the unavailable diagnostics, etc.

This change also changes the wording of the core deprecation diagnostics.
Instead of saying "function has been explicitly marked deprecated"
we now saw "'X' has been been explicitly marked deprecated".  It
turns out providing a bit more context is useful, and often we
got the actual term wrong or it was not very precise
 (e.g., "function" instead of "destructor").  By just saying the name
of the thing that is deprecated/deleted/unavailable we define
this issue away.  This diagnostic can likely be further wordsmithed
to be shorter.

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

10 years agoUse getAsCXXRecordDecl to shorten some gets and casts
Reid Kleckner [Wed, 18 Dec 2013 23:17:05 +0000 (23:17 +0000)]
Use getAsCXXRecordDecl to shorten some gets and casts

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

10 years agoObjectiveC. support "section" attribute on properties
Fariborz Jahanian [Wed, 18 Dec 2013 23:09:57 +0000 (23:09 +0000)]
ObjectiveC. support "section" attribute on properties
and methods. rdar://15450637

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

10 years agoRequire the type of a by-copy capture to be complete before creating its field.
Douglas Gregor [Wed, 18 Dec 2013 23:02:36 +0000 (23:02 +0000)]
Require the type of a by-copy capture to be complete before creating its field.

The problem here is more serious than the fix implies. Adding a field
to a class updates the triviality bits for the class (among other
things). Failing to require a complete type before adding the field
meant that these updates don't happen in the well-formed case where
the capture is an uninstantiated class template specialization,
leading the lambda itself to be treated as having a trivial copy
constructor when it shouldn't. Fixes <rdar://problem/15560464>.

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

10 years agoAdd a test for mipsel-nacl too.
Rafael Espindola [Wed, 18 Dec 2013 22:40:42 +0000 (22:40 +0000)]
Add a test for mipsel-nacl too.

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

10 years agoEnhance OpenMP parser tests from r197553 / r197598
Alp Toker [Wed, 18 Dec 2013 22:34:19 +0000 (22:34 +0000)]
Enhance OpenMP parser tests from r197553 / r197598

Move some of the verifier directives away from the end of the pragma line.

This ensures that the diagnostics relate to the trailing token being tested and
not the verifier comments which are themselves part of the token stream.

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

10 years agoDebug info: Implement (rvalue) reference qualifiers for C++11 non-static
Adrian Prantl [Wed, 18 Dec 2013 21:48:18 +0000 (21:48 +0000)]
Debug info: Implement (rvalue) reference qualifiers for C++11 non-static
member functions. Paired commit with LLVM.

rdar://problem/15356637

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

10 years agoAllow Objective-C pointer conversions following an explicit user conversion.
Douglas Gregor [Wed, 18 Dec 2013 21:46:16 +0000 (21:46 +0000)]
Allow Objective-C pointer conversions following an explicit user conversion.

Finishes the work started in r194224, and fixes <rdar://problem/15494681>.

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

10 years agoclang-format-diff.py: fix -regex/-iregex matching
Alp Toker [Wed, 18 Dec 2013 21:34:07 +0000 (21:34 +0000)]
clang-format-diff.py: fix -regex/-iregex matching

While debating the finer points of file extension matching, we somehow missed
the bigger problem that the current code will match anything starting with the
default or user-specified pattern (e.g. lit.site.cfg.in).

Fix this by doing what find(1) does, implicitly wrapping the pattern with ^$.

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

10 years agoObjective-C. After providing a fix-it for a
Fariborz Jahanian [Wed, 18 Dec 2013 21:04:43 +0000 (21:04 +0000)]
Objective-C. After providing a fix-it for a
cstring, converted to NSString, produce the
matching AST for it. This also required some
refactoring of the previous code. // rdar://14106083

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

10 years agoMake setABIAPCS and setABIAAPCS easier to reason about.
Rafael Espindola [Wed, 18 Dec 2013 20:24:51 +0000 (20:24 +0000)]
Make setABIAPCS and setABIAAPCS easier to reason about.

These functions now always set the same variables in the same order and they
don't overlap with thep constructor.

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

10 years agoSplit setABI in two helpers. No functionality change.
Rafael Espindola [Wed, 18 Dec 2013 19:47:32 +0000 (19:47 +0000)]
Split setABI in two helpers. No functionality change.

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

10 years agoFix OpenMP recovery with trailing tokens following the pragma
Alp Toker [Wed, 18 Dec 2013 19:10:54 +0000 (19:10 +0000)]
Fix OpenMP recovery with trailing tokens following the pragma

The recovery was failing due to a missing case in SkipUntil().

Also add back tests from r197553 that were reverted in the previous commit.

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