]> granicus.if.org Git - clang/log
clang
10 years agoAssert that the name of some internal variables start with \01L or \01l.
Rafael Espindola [Thu, 27 Feb 2014 16:26:32 +0000 (16:26 +0000)]
Assert that the name of some internal variables start with \01L or \01l.

No functionality change. This is just an intermediate patch for changing those
global variables to use private linkage.

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

10 years agolibclang: New functions clang_Type_getNumTemplateArguments,
Dmitri Gribenko [Thu, 27 Feb 2014 16:05:05 +0000 (16:05 +0000)]
libclang: New functions clang_Type_getNumTemplateArguments,
clang_Type_getTemplateArgument

Note that these functions don't handle variadic templates -- see tests.

Patch by Matthieu Nottale and Philippe Daouadi.

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

10 years ago[CMake] Teach build system to build/test compiler-rt with a just-built Clang
Alexey Samsonov [Thu, 27 Feb 2014 09:09:39 +0000 (09:09 +0000)]
[CMake] Teach build system to build/test compiler-rt with a just-built Clang

With this change, one may set LLVM_BUILD_EXTERNAL_COMPILER_RT option
to build compiler-rt libraries with just-built Clang.

  make compiler-rt
in the build tree will build all compiler-rt libraries with just-built Clang
and copy them to the proper location in the Clang resource directory.

  make check-compiler-rt
will run the compiler-rt test suite using just-built Clang and runtime
libraries.

The goal is to make LLVM_BUILD_EXTERNAL_COMPILER_RT the default, so that
we can always build compiler-rt libraries with Clang, not the host compiler,
and for all the platforms Clang can target.

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

10 years ago[OPENMP] First changes for Parsing and Sema for 'omp simd' directive support
Alexey Bataev [Thu, 27 Feb 2014 08:29:12 +0000 (08:29 +0000)]
[OPENMP] First changes for Parsing and Sema for 'omp simd' directive support

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

10 years ago[-Wunreachable-code] Don't warn about trivially unreachable return statements precede...
Ted Kremenek [Thu, 27 Feb 2014 06:32:32 +0000 (06:32 +0000)]
[-Wunreachable-code] Don't warn about trivially unreachable return statements preceded by 'noreturn' functions.

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

10 years agoFix test case indentation.
Ted Kremenek [Thu, 27 Feb 2014 06:32:28 +0000 (06:32 +0000)]
Fix test case indentation.

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

10 years ago[-Wunreachable-code] Don't warn about unreachable 'default:' cases.
Ted Kremenek [Thu, 27 Feb 2014 05:42:07 +0000 (05:42 +0000)]
[-Wunreachable-code] Don't warn about unreachable 'default:' cases.

They are covered by -Wcovered-switch-default.

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

10 years ago[ASTUnit] Fix use-after-free bug in ASTUnit::getMainBufferWithPrecompiledPreamble().
Argyrios Kyrtzidis [Thu, 27 Feb 2014 04:11:59 +0000 (04:11 +0000)]
[ASTUnit] Fix use-after-free bug in ASTUnit::getMainBufferWithPrecompiledPreamble().

With r197755 we started reading the contents of buffer file entries, but the
buffers may point to ASTReader blobs that have been disposed.

Fix this by having the CompilerInstance object keep a reference to the ASTReader
as well as having the ASTContext keep reference to the ExternalASTSource.

This was very difficult to construct a test case for.
rdar://16149782

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

10 years agoChange this test to not try to emit any IR. (It should fail to, but it tries to creat...
Nick Lewycky [Thu, 27 Feb 2014 03:29:38 +0000 (03:29 +0000)]
Change this test to not try to emit any IR. (It should fail to, but it tries to create an output file before encountering the error.)

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

10 years agoAs of r202325, CFGBlock predecessors may be NULL. Ignore such preds. Fixes a crasher...
Nick Lewycky [Thu, 27 Feb 2014 02:43:25 +0000 (02:43 +0000)]
As of r202325, CFGBlock predecessors may be NULL. Ignore such preds. Fixes a crasher, PR18983.

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

10 years agoAdd category test case for attribute 'objc_protocol_requires_explicit_implementation'.
Ted Kremenek [Thu, 27 Feb 2014 01:28:58 +0000 (01:28 +0000)]
Add category test case for attribute 'objc_protocol_requires_explicit_implementation'.

This test also illustrates that checking for properties is not working properly with
this attribute, as we are missing a diagnostic for a property not being implemented.

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

10 years agoPass down the debug emission kind into the compile unit for code
Eric Christopher [Thu, 27 Feb 2014 01:25:08 +0000 (01:25 +0000)]
Pass down the debug emission kind into the compile unit for code
generation purposes.
Paired with a commit to llvm.

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

10 years ago[MS ABI] Error instead of generating bad vftables for certain virtual hierarchies...
Hans Wennborg [Thu, 27 Feb 2014 01:14:31 +0000 (01:14 +0000)]
[MS ABI] Error instead of generating bad vftables for certain virtual hierarchies (PR18967)

Erroring out until we fix the bug means we don't have to keep chasing down
this same miscompile in a bunch of different places.

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

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

10 years agoFix -Wunused-variable in non-assert builds. No functionality change.
Nick Lewycky [Thu, 27 Feb 2014 00:36:00 +0000 (00:36 +0000)]
Fix -Wunused-variable in non-assert builds. No functionality change.

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

10 years agoAdd a 'use-external-names' option to VFS overlay files
Ben Langmuir [Thu, 27 Feb 2014 00:25:12 +0000 (00:25 +0000)]
Add a 'use-external-names' option to VFS overlay files

When true, sets the name of the file to be the name from
'external-contents'. Otherwise, you get the virtual path that the file
was looked up by. This will not affect any non-virtual paths, or fully
virtual paths (for which there is no reasonable 'external' name anyway).

The setting is available globally, but can be overriden on a per-file
basis.

The goal is that this setting will control which path you see in debug
info, diagnostics, etc. which are sensitive to which path is used. That
will come in future patches that pass the name through to FileManager.

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

10 years ago[-Wunreachable-code] Prune out unreachable warnings where a 'break' is preceded by...
Ted Kremenek [Thu, 27 Feb 2014 00:24:08 +0000 (00:24 +0000)]
[-Wunreachable-code] Prune out unreachable warnings where a 'break' is preceded by a call to a 'noreturn' function.

For example:

unreachable();
    break;

This code is idiomatic and defensive.  The fact that 'break' is
unreachable here is not interesting.  This occurs frequently
in LLVM/Clang itself.

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

10 years ago[CFG] encode unreachable block information for would-have-been successors for calls...
Ted Kremenek [Thu, 27 Feb 2014 00:24:05 +0000 (00:24 +0000)]
[CFG] encode unreachable block information for would-have-been successors for calls to 'noreturn' functions.

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

10 years ago[CFG] Encode unreachable block information for successors when visiting 'if' statements.
Ted Kremenek [Thu, 27 Feb 2014 00:24:03 +0000 (00:24 +0000)]
[CFG] Encode unreachable block information for successors when visiting 'if' statements.

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

10 years agoRework CFG edges to encode potentially unreachable edges, instead of just making...
Ted Kremenek [Thu, 27 Feb 2014 00:24:00 +0000 (00:24 +0000)]
Rework CFG edges to encode potentially unreachable edges, instead of just making them NULL.

This is to support some analyses, like -Wunreachable-code, that
will need to recover the original unprunned CFG edges in order
to suppress issues that aren't really bugs in practice.

There are two important changes here:

- AdjacentBlock replaces CFGBlock* for CFG successors/predecessors.
  This has the size of 2 pointers, instead of 1.  This is unlikely
  to have a significant memory impact on Sema since a single
  CFG usually exists at one time, but could impact the memory
  usage of the static analyzer.  This could possibly be optimized
  down to a single pointer with some cleverness.

- Predecessors can now contain null predecessors, which means
  some analyses doing a reverse traversal will need to take into
  account.  This already exists for successors, which contain
  successor slots for specific branch kinds (e.g., 'if') that
  expect a fixed number of successors, even if a branch is
  not reachable.

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

10 years agoFix testcase for PR18962 with an explicit triple
Reid Kleckner [Thu, 27 Feb 2014 00:22:40 +0000 (00:22 +0000)]
Fix testcase for PR18962 with an explicit triple

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

10 years agoPR18962: Fix "Unable to find record layout information for type"
Reid Kleckner [Thu, 27 Feb 2014 00:03:39 +0000 (00:03 +0000)]
PR18962: Fix "Unable to find record layout information for type"

Clang is using llvm::StructType::isOpaque() as a way of signaling if
we've finished record type conversion in
CodeGenTypes::isRecordLayoutComplete().  However, Clang was setting the
body of the type before it finished laying out the type as a base type.
Laying out the %class.C.base LLVM type attempts to convert more types,
eventually recursively attempting to layout 'C' again, at which point we
would say that layout was complete, even though we were still in the
middle of it.

By not setting the body, we correctly signal that layout is not
complete, and things work as expected.

At some point, it might be worth refactoring this to avoid looking at
the LLVM IR types under construction.

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

10 years agoargument -> parameter terminology fixes for FunctionTypeInfo
Alp Toker [Wed, 26 Feb 2014 22:27:52 +0000 (22:27 +0000)]
argument -> parameter terminology fixes for FunctionTypeInfo

This is a continuation of r199686.

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

10 years agoRefactor linkage computation in CGObjCMac.cpp.
Rafael Espindola [Wed, 26 Feb 2014 22:25:45 +0000 (22:25 +0000)]
Refactor linkage computation in CGObjCMac.cpp.

Before this patch the globals were created with the wrong linkage and patched
afterwards. From the comments it looks like something would complain about
having an internal GV with no initializer. At least in clang the verifier will
only run way after we set the initializer, so that is not a problem.

This patch should be a nop. It just figures out the linkage earlier and
converts the old calls to setLinkage to asserts. The only case where that is
not possible is when we first see a weak import that is then implemented. In
that case we have to change the linkage, but that is the only setLinkage left.

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

10 years agoSema: Definition of dllimport globals is not allowed
Nico Rieck [Wed, 26 Feb 2014 21:27:13 +0000 (21:27 +0000)]
Sema: Definition of dllimport globals is not allowed

Upgrades the warning to an error and clarifies the message by treating the
definition as error instead of the attribute.

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

10 years agoAdd newlines to fallback-style description. Patch by Kamal Essoufi\!
Alexander Kornienko [Wed, 26 Feb 2014 15:03:57 +0000 (15:03 +0000)]
Add newlines to fallback-style description. Patch by Kamal Essoufi\!

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

10 years agoAArch64: use less cluttered intrinsic for vtbl/vtbx
Tim Northover [Wed, 26 Feb 2014 11:55:15 +0000 (11:55 +0000)]
AArch64: use less cluttered intrinsic for vtbl/vtbx

The table is always 128-bit so there's no reason to specify it every time we
want the intrinsic.

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

10 years agoAdd a StmtPrinter test for implicit and explicit conversion operator calls.
Benjamin Kramer [Wed, 26 Feb 2014 10:23:43 +0000 (10:23 +0000)]
Add a StmtPrinter test for implicit and explicit conversion operator calls.

Put back a comment that I removed too aggressively.

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

10 years agoFix typo
Tobias Grosser [Wed, 26 Feb 2014 10:21:56 +0000 (10:21 +0000)]
Fix typo

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

10 years ago[CMake] Use target_link_libraries(INTERFACE|PRIVATE) on CMake-2.8.12 to increase...
NAKAMURA Takumi [Wed, 26 Feb 2014 06:53:16 +0000 (06:53 +0000)]
[CMake] Use target_link_libraries(INTERFACE|PRIVATE) on CMake-2.8.12 to increase opportunity for parallel build.

target_link_libraries(INTERFACE) doesn't bring inter-target dependencies in add_library,
although final targets have dependencies to whole dependent libraries.
It makes most libraries can be built in parallel.

target_link_libraries(PRIVATE) is used to shaared library.
Each dependent library is linked to the target.so, and its user will not see its grandchildren.
For example,

  - libclang.so has sufficient libclang*.a(s).
  - c-index-test requires just only libclang.so.

FIXME: lld is tweaked minimally. Adding INTERFACE in each library would be better thing.

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

10 years ago[CMake] Introduce cmake_policy(CMP0022) for target_link_libraries(INTERFACE|PRIVATE).
NAKAMURA Takumi [Wed, 26 Feb 2014 06:45:11 +0000 (06:45 +0000)]
[CMake] Introduce cmake_policy(CMP0022) for target_link_libraries(INTERFACE|PRIVATE).

For now, use both keywords, INTERFACE and PRIVATE via the variable,
  - ${cmake_2_8_12_INTERFACE}
  - ${cmake_2_8_12_PRIVATE}

They could be cleaned up when we introduce 2.8.12.

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

10 years ago[CMake] Use LINK_LIBS instead of target_link_libraries().
NAKAMURA Takumi [Wed, 26 Feb 2014 06:41:29 +0000 (06:41 +0000)]
[CMake] Use LINK_LIBS instead of target_link_libraries().

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

10 years ago[CMake] Apply DEPENDS intrinsics_gen in clangCodeGen.
NAKAMURA Takumi [Wed, 26 Feb 2014 06:33:27 +0000 (06:33 +0000)]
[CMake] Apply DEPENDS intrinsics_gen in clangCodeGen.

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

10 years agoclang/test/CodeGenCXX/debug-info-varargs.cpp: Appease msvc with %itanium_abi_triple.
NAKAMURA Takumi [Wed, 26 Feb 2014 03:30:03 +0000 (03:30 +0000)]
clang/test/CodeGenCXX/debug-info-varargs.cpp: Appease msvc with %itanium_abi_triple.

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

10 years ago80-col and bad line ending fixups.
Eric Christopher [Wed, 26 Feb 2014 02:49:36 +0000 (02:49 +0000)]
80-col and bad line ending fixups.

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

10 years agoPR16074, implement warnings to catch pointer to boolean true and pointer to
Richard Trieu [Wed, 26 Feb 2014 02:36:06 +0000 (02:36 +0000)]
PR16074, implement warnings to catch pointer to boolean true and pointer to
null comparison when the pointer is known to be non-null.

This catches the array to pointer decay, function to pointer decay and
address of variables.  This does not catch address of function since this
has been previously used to silence a warning.

Pointer to bool conversion is under -Wbool-conversion.
Pointer to null comparison is under -Wtautological-pointer-compare, a sub-group
of -Wtautological-compare.

void foo() {
  int arr[5];
  int x;
  // warn on these conditionals
  if (foo);
  if (arr);
  if (&x);
  if (foo == null);
  if (arr == null);
  if (&x == null);

  if (&foo);  // no warning
}

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

10 years ago[analyzer] NonNullParamChecker: don't freak out about nested transparent_unions.
Jordan Rose [Wed, 26 Feb 2014 01:20:19 +0000 (01:20 +0000)]
[analyzer] NonNullParamChecker: don't freak out about nested transparent_unions.

For now, just ignore them. Later, we could try looking through LazyCompoundVals,
but we at least shouldn't crash.

<rdar://problem/16153464>

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

10 years agoAdd -Wabsolute-value, warnings about absolute value functions.
Richard Trieu [Wed, 26 Feb 2014 01:17:28 +0000 (01:17 +0000)]
Add -Wabsolute-value, warnings about absolute value functions.

The warnings fall into three groups.
1) Using an absolute value function of the wrong type, for instance, using the
int absolute value function when the argument is a floating point type.
2) Using the improper sized absolute value function, for instance, using abs
when the argument is a long long.  llabs should be used instead.

From these two cases, an implicit conversion will occur which may cause
unexpected behavior.  Where possible, suggest the proper absolute value
function to use, and which header to include if the function is not available.

3) Taking the absolute value of an unsigned value.  In addition to this warning,
suggest to remove the function call.  This usually indicates a logic error
since the programmer assumed negative values would have been possible.

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

10 years agoAddress review comments for r202185, no functionality changes.
Adrian Prantl [Tue, 25 Feb 2014 23:42:18 +0000 (23:42 +0000)]
Address review comments for r202185, no functionality changes.

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

10 years agoHoist culling of -Wunreachable-code from headers before we even run the analysis.
Ted Kremenek [Tue, 25 Feb 2014 22:35:37 +0000 (22:35 +0000)]
Hoist culling of -Wunreachable-code from headers before we even run the analysis.

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

10 years agoDebug info: Generate debug info for variadic functions.
Adrian Prantl [Tue, 25 Feb 2014 19:38:11 +0000 (19:38 +0000)]
Debug info: Generate debug info for variadic functions.
Paired commit with LLVM.

rdar://problem/13690847

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

10 years agoAdd preprocessed output to ccc-analyzer's accepted language map.
Ted Kremenek [Tue, 25 Feb 2014 19:16:33 +0000 (19:16 +0000)]
Add preprocessed output to ccc-analyzer's accepted language map.

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

10 years agoPretty Printer: Print constexpr and ref qualifiers. Don't print return types on destr...
Benjamin Kramer [Tue, 25 Feb 2014 18:49:49 +0000 (18:49 +0000)]
Pretty Printer: Print constexpr and ref qualifiers. Don't print return types on destructors.

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

10 years agoPass the sparc architecture variant to the assembler.
Roman Divacky [Tue, 25 Feb 2014 18:45:49 +0000 (18:45 +0000)]
Pass the sparc architecture variant to the assembler.

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

10 years agoclang-cl: use -fno-rtti by default
Hans Wennborg [Tue, 25 Feb 2014 18:36:22 +0000 (18:36 +0000)]
clang-cl: use -fno-rtti by default

Generating RTTI in the MS ABI is currently not supported, and the failures
are confusing to users, so let's disable it by default for now.

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

10 years agoGive sparcv9 the ability to set the target cpu. Change it from accepting
Roman Divacky [Tue, 25 Feb 2014 18:35:30 +0000 (18:35 +0000)]
Give sparcv9 the ability to set the target cpu. Change it from accepting
-march which doesnt exist on sparc gcc to -mcpu. While here adjust a
few tests to not write an unused temporary file.

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

10 years agoAdd a driver option -ivfsoverlay
Ben Langmuir [Tue, 25 Feb 2014 18:23:47 +0000 (18:23 +0000)]
Add a driver option -ivfsoverlay

Reads the description of a virtual filesystem from a file and overlays
it over the real file system.

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

10 years agoMS ABI: Just use getTypeInfoInChars to get the field size
Reid Kleckner [Tue, 25 Feb 2014 18:08:48 +0000 (18:08 +0000)]
MS ABI: Just use getTypeInfoInChars to get the field size

This was changed to use manual desugaring and multiplication in r201832
and fixed for multi-dimensional arrays in r201917.  However, it breaks
down in the presence of typedefs.  Rather than attempting to handle all
the desugaring, just go back to calling the generic type info code.

This was discovered while compiling SIInstrWaits.cpp in the R600
backend.

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

10 years agoReapply "Pretty Printer: Fix printing of conversion operator decls and calls."
Benjamin Kramer [Tue, 25 Feb 2014 18:03:55 +0000 (18:03 +0000)]
Reapply "Pretty Printer: Fix printing of conversion operator decls and calls."

There were many additional tests that had the bad behavior baked in.

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

10 years agoRevert "Pretty Printer: Fix printing of conversion operator decls and calls."
Rafael Espindola [Tue, 25 Feb 2014 17:39:16 +0000 (17:39 +0000)]
Revert "Pretty Printer: Fix printing of conversion operator decls and calls."

This reverts commit r202167.

It broke Analysis/auto-obj-dtors-cfg-output.cpp

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

10 years agoUpdate for llvm api change.
Rafael Espindola [Tue, 25 Feb 2014 17:30:40 +0000 (17:30 +0000)]
Update for llvm api change.

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

10 years agoPretty Printer: Fix printing of conversion operator decls and calls.
Benjamin Kramer [Tue, 25 Feb 2014 17:26:26 +0000 (17:26 +0000)]
Pretty Printer: Fix printing of conversion operator decls and calls.

- Don't emit anything when we encounter a call to a conversion operator.
    "bar(a & b)" instead of "bar(a & b.operator int())"
  This preserves the semantics and is still idempotent if we print the AST multiple times.

- Properly print declarations of conversion operators.
    "explicit operator bool();" instead of "bool operator _Bool();"

PR18776.

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

10 years agoAArch64: use different type modifier in arm_neon.td
Tim Northover [Tue, 25 Feb 2014 13:53:01 +0000 (13:53 +0000)]
AArch64: use different type modifier in arm_neon.td

The 'f' modifier is designed for integer type arguments really (according to
its documentation). It's better to use the "half width, same number" modifier.

Should be no user-visible change.

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

10 years agoAdd AArch64 big endian Target (aarch64_be)
Christian Pirker [Tue, 25 Feb 2014 13:51:00 +0000 (13:51 +0000)]
Add AArch64 big endian Target (aarch64_be)

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

10 years agoRespect ToolChain::isPIEDefault() in constructing link job on Linux and FreeBSD.
Alexey Samsonov [Tue, 25 Feb 2014 13:26:03 +0000 (13:26 +0000)]
Respect ToolChain::isPIEDefault() in constructing link job on Linux and FreeBSD.

Partially based on http://llvm-reviews.chandlerc.com/D2644 by Viktor Kutuzov.

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

10 years agoFactor adding sanitizer linker flags into a separate function and make it less OS...
Alexey Samsonov [Tue, 25 Feb 2014 12:43:43 +0000 (12:43 +0000)]
Factor adding sanitizer linker flags into a separate function and make it less OS-specific

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

10 years agoSema: When merging objc string literals, give the result a constant array type.
Benjamin Kramer [Tue, 25 Feb 2014 12:26:20 +0000 (12:26 +0000)]
Sema: When merging objc string literals, give the result a constant array type.

Also assert that we never create non-array string literals again.

PR18939.

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

10 years agoRewriteObjC: Factor string literal creation into a helper and make sure it gets a...
Benjamin Kramer [Tue, 25 Feb 2014 12:26:11 +0000 (12:26 +0000)]
RewriteObjC: Factor string literal creation into a helper and make sure it gets a proper constant array type.

No change in output.

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

10 years agoARM NEON: fix tests after r202137
Tim Northover [Tue, 25 Feb 2014 11:48:25 +0000 (11:48 +0000)]
ARM NEON: fix tests after r202137

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

10 years agoFix typo.
Serge Pavlov [Tue, 25 Feb 2014 11:32:34 +0000 (11:32 +0000)]
Fix typo.

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

10 years agoFix for Bug 18536 - Bad alignment in clang/AST/StmpOpenMP.h
Alexey Bataev [Tue, 25 Feb 2014 11:25:38 +0000 (11:25 +0000)]
Fix for Bug 18536 - Bad alignment in clang/AST/StmpOpenMP.h

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

10 years agoAArch64 NEON: add 64-bit scalar intrinsics for _f64 mla/mls etc.
Tim Northover [Tue, 25 Feb 2014 11:13:49 +0000 (11:13 +0000)]
AArch64 NEON: add 64-bit scalar intrinsics for _f64 mla/mls etc.

These seem to be supported by GCC, and do make sense architecturally so we
should probably have them.

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

10 years agoARM NEON: add _f16 support to a couple of vector-shuffling intrinsics.
Tim Northover [Tue, 25 Feb 2014 11:13:42 +0000 (11:13 +0000)]
ARM NEON: add _f16 support to a couple of vector-shuffling intrinsics.

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

10 years agoIRGen: Remove a stale comment
David Majnemer [Tue, 25 Feb 2014 10:51:14 +0000 (10:51 +0000)]
IRGen: Remove a stale comment

This comment survived the transition from ForceInline to InlineAlways,
fix it.

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

10 years agoAttr: Remove ForceInline
David Majnemer [Tue, 25 Feb 2014 09:53:29 +0000 (09:53 +0000)]
Attr: Remove ForceInline

The __forceinline keyword's semantics are now recast as AlwaysInline and
the kw___forceinline token has its language mode set for KEYMS.

This preserves the semantics of the previous implementation but with
less duplication of code.

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

10 years agoAttributeReference: Document __single_inhertiance, __multiple_inheritance, __virtual_...
David Majnemer [Tue, 25 Feb 2014 08:28:55 +0000 (08:28 +0000)]
AttributeReference: Document __single_inhertiance, __multiple_inheritance, __virtual_inheritance

Add documentation for these attributes, it includes:
- Motivation for their existence.
- Examples on how to use them.
- Examples on how to misuse them.

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

10 years agoModules: Fix malformed reStructuredText
David Majnemer [Tue, 25 Feb 2014 06:22:25 +0000 (06:22 +0000)]
Modules: Fix malformed reStructuredText

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

10 years agoFix typo in the td source too
Alp Toker [Tue, 25 Feb 2014 06:02:42 +0000 (06:02 +0000)]
Fix typo in the td source too

r202112 fixed the generated output which will hopefully go away soon.

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

10 years agoRemove dead assignment reported by Gautier DI FOLCO.
Ted Kremenek [Tue, 25 Feb 2014 05:58:54 +0000 (05:58 +0000)]
Remove dead assignment reported by Gautier DI FOLCO.

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

10 years agoRemove the FormatSecurity diagnostic group from the FormatNonLiteral warning group.
Ted Kremenek [Tue, 25 Feb 2014 05:42:31 +0000 (05:42 +0000)]
Remove the FormatSecurity diagnostic group from the FormatNonLiteral warning group.

The FormatSecurity warning group does not need to be a sub-group
of the FormatNonLiteral group.

Patch by Zach Davis!

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

10 years agoAttributeReference: Fix a typo
David Majnemer [Tue, 25 Feb 2014 05:33:01 +0000 (05:33 +0000)]
AttributeReference: Fix a typo

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

10 years agoAllow multi-component paths in VFS file nodes
Ben Langmuir [Tue, 25 Feb 2014 04:34:14 +0000 (04:34 +0000)]
Allow multi-component paths in VFS file nodes

This allows the 'name' field to contain a path, like

{ 'type': 'directory',
  'name': '/path/to/dir',
  'contents': [ ... ] }

which not only simplifies reading and writing these files (for humans),
but makes it possible to easily modify locations via textual
replacement, which would not have worked in the old scheme.

E.g. sed s:<ROOT>:<NEW ROOT>

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

10 years agoFix typos
Alp Toker [Tue, 25 Feb 2014 04:21:44 +0000 (04:21 +0000)]
Fix typos

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

10 years ago[libclang] Introduce libclang APIs for creating a buffer with a JSON virtual file...
Argyrios Kyrtzidis [Tue, 25 Feb 2014 03:59:23 +0000 (03:59 +0000)]
[libclang] Introduce libclang APIs for creating a buffer with a JSON virtual file overlay description.

The current API only supports adding 'virtual file path' -> 'real file path' mappings.

rdar://15986708

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

10 years ago[libclang] Include "BuildSystem.h" along with "Index.h"
Argyrios Kyrtzidis [Tue, 25 Feb 2014 03:59:16 +0000 (03:59 +0000)]
[libclang] Include "BuildSystem.h" along with "Index.h"

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

10 years agoAST: Simplify CharUnits::alignmentAtOffset
David Majnemer [Tue, 25 Feb 2014 01:47:33 +0000 (01:47 +0000)]
AST: Simplify CharUnits::alignmentAtOffset

CharUnits::alignmentAtOffset is equivalent to llvm::MinAlign but
slightly less efficient.  Use it's implementation instead.

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

10 years agoIRGen: Simplify alignment calculation in setBitFieldInfo
David Majnemer [Tue, 25 Feb 2014 01:20:15 +0000 (01:20 +0000)]
IRGen: Simplify alignment calculation in setBitFieldInfo

Take advantage of CharUnits::alignmentAtOffset instead of calculating it
by hand.

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

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

10 years agoMS ABI: Return sret parameters when using inalloca
Reid Kleckner [Tue, 25 Feb 2014 00:59:14 +0000 (00:59 +0000)]
MS ABI: Return sret parameters when using inalloca

Previously the X86 backend would look for the sret attribute and handle
this for us.  inalloca takes that all away, so we have to do the return
ourselves now.

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

10 years agoclang/test/Preprocessor/init.c: Split conditions to win32 and non-win32.
NAKAMURA Takumi [Tue, 25 Feb 2014 00:30:14 +0000 (00:30 +0000)]
clang/test/Preprocessor/init.c: Split conditions to win32 and non-win32.

FIXME: Implement and check x86_64-cygwin.

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

10 years agoSuppress clang/test/Driver/clang_f_opts.c for targeting cygming since r202058 is...
NAKAMURA Takumi [Tue, 25 Feb 2014 00:30:04 +0000 (00:30 +0000)]
Suppress clang/test/Driver/clang_f_opts.c for targeting cygming since r202058 is incompatible to gcc driver.

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

10 years agoImprove some gtest assertions
Ben Langmuir [Mon, 24 Feb 2014 23:44:17 +0000 (23:44 +0000)]
Improve some gtest assertions

As requested during review, compare pointers to NULL explicitly to make what's
going on more clear.

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

10 years agoAST: Small code cleanup
David Majnemer [Mon, 24 Feb 2014 23:43:27 +0000 (23:43 +0000)]
AST: Small code cleanup

Move the pointer to be adjacent to the variable instead of the type.

No functional change.

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

10 years agoSema: Make getPreferredTypeAlign respect alignments specified with an aligned attribu...
David Majnemer [Mon, 24 Feb 2014 23:34:17 +0000 (23:34 +0000)]
Sema: Make getPreferredTypeAlign respect alignments specified with an aligned attribute on a typedef

When calculating the preferred alignment of a type, consider if a alignment
attribute came from a typedef declaration.  If one did, do not naturally align
the type.

Patch by Stephan Tolksdorf, with a little tweaking and an additional testcase by me.

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

10 years agoPass through context for DiagHandler in VFS
Ben Langmuir [Mon, 24 Feb 2014 20:56:37 +0000 (20:56 +0000)]
Pass through context for DiagHandler in VFS

This allows the unit tests to not use global state when checking
diagnostics.

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

10 years agoIf preprocessing results in a token with leading whitespace that was expanded
Richard Smith [Mon, 24 Feb 2014 20:50:36 +0000 (20:50 +0000)]
If preprocessing results in a token with leading whitespace that was expanded
from a macro in column 0, ensure that we print whitespace before it in the -E
output. Patch by Harald van Dijk!

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

10 years agoFollow up to r201927: remove the Sema::InFunctionDeclarator field.
Peter Collingbourne [Mon, 24 Feb 2014 20:45:14 +0000 (20:45 +0000)]
Follow up to r201927: remove the Sema::InFunctionDeclarator field.

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

10 years agoIf the first token in a macro that appears at the start of a line expands to
Richard Smith [Mon, 24 Feb 2014 20:45:00 +0000 (20:45 +0000)]
If the first token in a macro that appears at the start of a line expands to
nothing, be sure to inform the *next* token expanded from the macro that it is
now at the start of a line. Patch by Harald van Dijk!

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

10 years agoAdd a test for r202059.
Roman Divacky [Mon, 24 Feb 2014 19:24:15 +0000 (19:24 +0000)]
Add a test for r202059.

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

10 years agoObjective-C. Remove an assertion which asserts
Fariborz Jahanian [Mon, 24 Feb 2014 19:10:37 +0000 (19:10 +0000)]
Objective-C. Remove an assertion which asserts
on correctly handled block layout IRGen.
// rdar://16111839

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

10 years agoImplement getDwarfEHStackPointer() and initDwarfEHRegSizeTable() for sparcv9.
Roman Divacky [Mon, 24 Feb 2014 18:46:27 +0000 (18:46 +0000)]
Implement getDwarfEHStackPointer() and initDwarfEHRegSizeTable() for sparcv9.

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

10 years agoImplement -fno-short-wchar
Richard Barton [Mon, 24 Feb 2014 18:43:28 +0000 (18:43 +0000)]
Implement -fno-short-wchar

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

10 years agoUpdate for llvm api change.
Rafael Espindola [Mon, 24 Feb 2014 18:20:21 +0000 (18:20 +0000)]
Update for llvm api change.

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

10 years ago[Win32 ABI] Defer operator delete checks until vtable is marked used
Hans Wennborg [Mon, 24 Feb 2014 15:58:24 +0000 (15:58 +0000)]
[Win32 ABI] Defer operator delete checks until vtable is marked used

We were previously checking at every destructor declaration, but that was a bit
excessive. Since the deleting destructor is emitted with the vtable, do the
check when the vtable is marked used.

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

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

10 years agoDon't assume that F_None is the default. It is about to change.
Rafael Espindola [Mon, 24 Feb 2014 15:06:52 +0000 (15:06 +0000)]
Don't assume that F_None is the default. It is about to change.

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

10 years agoClarifying the wording for the noduplicate attribute.
Aaron Ballman [Mon, 24 Feb 2014 13:46:15 +0000 (13:46 +0000)]
Clarifying the wording for the noduplicate attribute.

Patch by Marcello Maggioni!

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

10 years agoFix AST matcher documentation for overloaded matchers.
Manuel Klimek [Mon, 24 Feb 2014 10:40:22 +0000 (10:40 +0000)]
Fix AST matcher documentation for overloaded matchers.

Before this patch we would only use the fist occurance of a matcher
function in the documentation, for example leaving out
hasType(Matcher<QualType>).

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

10 years agoFix docs generation for the AST matchers:
Manuel Klimek [Mon, 24 Feb 2014 10:28:36 +0000 (10:28 +0000)]
Fix docs generation for the AST matchers:

1. Move internal functions into ASTMatchersInternal.
2. Adapt dump_ast_matchers.py to the new VariadicOperatorMatcherFunc
   signature.
3. Update the actual docs with the updated tool / code.

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

10 years agoASTMatchers: added CXXMethodDecl matcher isPure()
Dmitri Gribenko [Mon, 24 Feb 2014 09:27:46 +0000 (09:27 +0000)]
ASTMatchers: added CXXMethodDecl matcher isPure()

The isPure() CXXMethodDecl matcher matches pure method declaration like "A::x"
in this example:

class A {
  virtual void x() = 0;
}

Patch by Konrad Kleine.

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

10 years agoAdd driver test for multiple preprocessor inputs
Alp Toker [Mon, 24 Feb 2014 08:17:02 +0000 (08:17 +0000)]
Add driver test for multiple preprocessor inputs

Fix an unintentional stdin read in the darwin-asan-nofortify.c test and replace
it with an explicit test for multiple -E inputs passed to the driver.

Noticed while working on the in-process driver patch.

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

10 years agoUse a more conventional logical op instead of bitwise and
Alp Toker [Mon, 24 Feb 2014 04:35:58 +0000 (04:35 +0000)]
Use a more conventional logical op instead of bitwise and

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

10 years ago[AArch64] Change int64_t from 'long long int' to 'long int' for AArch64 target.
Kevin Qin [Mon, 24 Feb 2014 02:45:03 +0000 (02:45 +0000)]
[AArch64] Change int64_t from 'long long int' to 'long int' for AArch64 target.

Most 64-bit targets define int64_t as long int, and AArch64 should
make same definition to follow LP64 model. In GNU tool chain, int64_t
is defined as long int for 64-bit target. So to get consistent with GNU,
it's better Changing int64_t from 'long long int' to 'long int',
otherwise clang will get different name mangling suffix compared with g++.

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