Commit Graph

3023 Commits

Author SHA1 Message Date
Alp Toker e8aa4b90f9 driver: add link dependency on CodeGen
Fix the build when no targets are enabled. This dependency is incurred by two
unfortunate entries in LinkAllPasses.h included from cc1_main.cpp:

  llvm::createJumpInstrTablesPass();
  llvm::createCodeGenPreparePass();

llvm-svn: 212084
2014-07-01 02:42:02 +00:00
Craig Topper 00bbdcf9b3 Remove llvm:: from uses of ArrayRef.
llvm-svn: 211987
2014-06-28 23:22:23 +00:00
David Blaikie 66cc07b4f7 Remove 'const' from MemoryBuffers used through the SourceManager
This removes a const_cast added in r211884 that occurred due to an
inconsistency in how MemoryBuffers are handled between some parts of
clang and LLVM.

MemoryBuffers are immutable and the general convention in the LLVM
project is to omit const from immutable types as it's simply
redundant/verbose (see llvm::Type, for example). While this change
doesn't remove "const" from /every/ MemoryBuffer, it at least makes this
chain of ownership/usage consistent.

llvm-svn: 211915
2014-06-27 17:40:03 +00:00
Chandler Carruth 6666074876 Fix a bug in my previous patch by restoring the behavior that the fatal
error handler is only registered once.

To avoid the use of std::call_once (the obvious way to do this) I've
wrapped everything up into a managed static and done the work in
a constructor. Silly, but it should be effective.

Some out-of-tree libclang users reported this to me, and I've asked them
to put together a test case which exhibits this behavior, but I wanted
to fix things ASAP since the nature of the fix is straight forward.

llvm-svn: 211905
2014-06-27 16:37:27 +00:00
Chandler Carruth 37ad2582d6 This fixes libclang to cope with the now compile-time multithreaded
selection re-enabled in r211900 in LLVM.

The approach (unlike r211121) doesn't rely on std::mutex or
std::call_once to avoid breaknig cygwin bots.

llvm-svn: 211901
2014-06-27 15:14:39 +00:00
Alexey Bataev bae9a793fd [OPENMP] Parsing and sema analysis for 'copyprivate' clause.
llvm-svn: 211886
2014-06-27 10:37:06 +00:00
Alexey Bataev d1e40fbfe1 [OPENMP] Initial parsing and sema analysis for 'single' directive.
llvm-svn: 211774
2014-06-26 12:05:45 +00:00
Alexey Bataev 1e0498a92d [OPENMP] Initial parsing and sema analysis for 'section' directive.
llvm-svn: 211767
2014-06-26 08:21:58 +00:00
Alexey Bataev d3f8dd2d15 [OPENMP] Initial support for 'sections' directive.
llvm-svn: 211685
2014-06-25 11:44:49 +00:00
NAKAMURA Takumi 8068b6a2fb Revert r211121 (and r211285), "Change libclang initialization to use std::call_once instead of"
It broke mingw builder and cygwin-clang stage2, possibly lack of tls in <mutex>.

llvm-svn: 211593
2014-06-24 13:50:01 +00:00
Alexey Bataev 236070f20d [OPENMP] Initial support for 'nowait' clause.
llvm-svn: 211352
2014-06-20 11:19:47 +00:00
Alexey Bataev 142e1fc9ea [OPENMP] Initial support for 'ordered' clause.
llvm-svn: 211347
2014-06-20 09:44:06 +00:00
Alexey Bataev 56dafe87c2 [OPENMP] Initial support for 'schedule' clause.
llvm-svn: 211342
2014-06-20 07:16:17 +00:00
Alp Toker b2636c4ae1 diagtool: refactor TreeView to resemble C++
Replace lots of old-school parameter passing with neat class members.
No attempt made yet to modernize loops, but it's a start.

llvm-svn: 211327
2014-06-20 00:06:42 +00:00
Alp Toker 1b3f344713 diagtool: simplify TreeView diagnostic classification
This utility doesn't need to know about the specifics of diagnostic levels.

llvm-svn: 211323
2014-06-19 23:00:52 +00:00
Zachary Turner 10364ca123 Don't call llvm_start_multithreaded() during init. As of LLVM
revision r211277, this function is essentially a no-op.

llvm-svn: 211285
2014-06-19 18:03:56 +00:00
Alexey Bataev f29276edb7 [OPENMP] Initial support for '#pragma omp for' (fixed incompatibility with MSVC).
llvm-svn: 211140
2014-06-18 04:14:57 +00:00
Zachary Turner f68823ba3f Change libclang initialization to use std::call_once instead of
hand rolled once-initialization, and rename the mutex to be more
descriptive of its actual purpose.

llvm-svn: 211121
2014-06-17 19:57:15 +00:00
Rafael Espindola a566efbec9 Revert "[OPENMP] Initial support for '#pragma omp for'."
This reverts commit r211096. Looks like it broke the msvc build:

SemaOpenMP.cpp(140) : error C4519: default template arguments are only allowed on a class template

llvm-svn: 211113
2014-06-17 17:20:53 +00:00
Alexey Bataev c77dd5257a [OPENMP] Initial support for '#pragma omp for'.
llvm-svn: 211096
2014-06-17 11:49:22 +00:00
Sylvestre Ledru bf9effc736 actually, just check if it is a file (including directory or symlink)
llvm-svn: 211053
2014-06-16 20:51:40 +00:00
Sylvestre Ledru c7bc52596f Check that the directory does not exist.
Otherwise, it could allows local users to obtain sensitive information or
overwrite arbitrary files via a symlink attack on temporary directories with
predictable names. 

Reported as CVE-2014-2893 ( https://security-tracker.debian.org/tracker/CVE-2014-2893 )
Found by Jakub Wilk

llvm-svn: 211051
2014-06-16 20:31:15 +00:00
Alexey Bataev c5e025831b [OPENMP] Initial support of 'reduction' clause
llvm-svn: 211007
2014-06-16 07:08:35 +00:00
Sylvestre Ledru ac5a08a56a List the function/method name in the index page of scan-build
llvm-svn: 210971
2014-06-14 08:49:40 +00:00
Sylvestre Ledru 9882e1a52c With the option '-analyzer-config stable-report-filename=true',
instead of report-XXXXXX.html, scan-build/clang analyzer generate
report-<filename>-<function, method name>-<function position>-<id>.html.
(id = i++ for several issues found in the same function/method)

llvm-svn: 210970
2014-06-14 08:45:32 +00:00
Rafael Espindola 8e650d7bf0 Refer to error_code with the std prefix.
llvm-svn: 210817
2014-06-12 20:37:59 +00:00
Rafael Espindola 8a8e554adc Include system_error directly.
llvm-svn: 210802
2014-06-12 17:19:42 +00:00
Rafael Espindola c080917ec2 Replace llvm::error_code with std::error_code.
llvm-svn: 210780
2014-06-12 14:02:15 +00:00
Zachary Turner 18532316f3 Revert "Clang changes to support LLVM removal of runtime multithreading"
This reverts r210601.

llvm-svn: 210604
2014-06-10 23:17:11 +00:00
Zachary Turner 475a76d93a Clang changes to support LLVM removal of runtime multithreading
support (llvm revision r210600).

Reviewers: rnk

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

llvm-svn: 210601
2014-06-10 23:02:10 +00:00
Craig Topper 69186e731f [C++11] Use 'nullptr'. Tools edition.
llvm-svn: 210422
2014-06-08 08:38:04 +00:00
Alp Toker 541d5070bf Avoid dubious IdentifierInfo::getNameStart() uses
These cases in particular were incurring an extra strlen() when we already knew
the length. They appear to be leftovers from when the interfaces worked with C
strings that have continued to compile due to the implicit StringRef ctor.

llvm-svn: 210403
2014-06-07 23:30:53 +00:00
Timur Iskhodzhanov eae19460a7 Fix C++ style // comments in a couple of C files
llvm-svn: 210325
2014-06-06 11:04:46 +00:00
Reid Kleckner e931c06b21 Flush C stdio streams upon process termination
Due to what can only be described as a CRT bug, stdout and amazingly
even stderr are not always flushed upon process termination, especially
when the system is under high threading pressure.  I have found two
repros for this:

1) In lib\Support\Threading.cpp, change sys::Mutex to an
std::recursive_mutex and run check-clang.  Usually between 30 and 40
tests will fail.

2) Add OutputDebugStrings in code that runs during static initialization
and static shutdown.  This will sometimes generate similar failures.

After a substantial amount of troubleshooting and debugging, I found
that I could reproduce this from the command line without running
check-clang.  Simply make the mutex change described in #1, then
manually run the following command many times by running it once, then
pressing Up -> Enter very quickly:

D:\src\llvm\build\vs2013\Debug\bin\c-index-test.EXE -cursor-at=D:\src\llvm\tools\clang\test\Index\targeted-preamble.h:2:15 D:\src\llvm\tools\clang\test\Index\targeted-cursor.c -include D:\src\llvm\build\vs2013\tools\clang\test\Index\Output\targeted-cursor.c.tmp.h -Xclang -error-on-deserialized-decl=NestedVar1      -Xclang -error-on-deserialized-decl=TopVar    | D:\src\llvm\build\vs2013\Debug\bin\FileCheck.EXE D:\src\llvm\tools\clang\test\Index\targeted-cursor.c -check-prefix=PREAMBLE-CURSOR1

Sporadically they will fail, and attaching a debugger to a failed
instance indicates that stdin of FileCheck.exe is empty.

Note that due to the repro in #2, we can rule out a bug in the STL's
mutex implementation, and instead conclude that this is a real flake in
the windows test harness.

Test Plan:
Without patch: Ran check-clang 10 times and saw over 30 Unexpected failures on every run.
With patch: Ran check-clang 10 times and saw 0 unexpected failures across all runs.

Reviewers: rnk

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

Patch by Zachary Turner!

llvm-svn: 210225
2014-06-05 00:13:43 +00:00
Alexander Musman 1bb328cca5 [OPENMP] Parsing/Sema for OMPLasprivateClause.
Parsing this clause, allowing it on directive ‘omp simd’ and semantic checks.

llvm-svn: 210184
2014-06-04 13:06:39 +00:00
Alp Toker 1d257e1d0a Remove the last remaining llvm/Config/config.h includes
This corrects long-standing misuses of LLVM's internal config.h.

In most cases the public llvm-config.h header was intended and we can now
remove the old hacks thanks to LLVM r210144.

The config.h header is private, won't be installed and should no longer be
included by clang or other modules.

llvm-svn: 210145
2014-06-04 03:28:55 +00:00
Alp Toker 4429314aef cc1as: invert return bool to indicate failure
This simplifies code flow and matches the convention used in surrounding code.

No functional change.

llvm-svn: 209936
2014-05-31 00:02:27 +00:00
Alp Toker e98ea7c9b6 cc1as: fix a potential leak and unremoved output file in error conditions
llvm-svn: 209935
2014-05-31 00:02:21 +00:00
Alexander Musman f0d76e7dc3 Parsing/Sema for OMPAlignedClause.
llvm-svn: 209816
2014-05-29 14:36:25 +00:00
Eli Bendersky 2581e66e7a Expose CUDA function attributes to the C interface.
Until now all CUDA-specific attributes were represented with
CXCursor_UnexposedAttr; now they are actually implemented, including the Python
bindings.

llvm-svn: 209767
2014-05-28 19:29:58 +00:00
Alexander Musman 8bd31e69a4 Parsing/Sema for OMPCollapseClause.
Actual usage in Sema for collapsing loops will in some future patch.

llvm-svn: 209660
2014-05-27 15:12:19 +00:00
Sylvestre Ledru e8103abdbc revert "r209526 List the function/method name in the index page of scan-build "
Depends on http://reviews.llvm.org/D3762

llvm-svn: 209527
2014-05-23 16:47:42 +00:00
Sylvestre Ledru 970d3189e6 List the function/method name in the index page of scan-build
llvm-svn: 209526
2014-05-23 16:40:46 +00:00
Sylvestre Ledru df70a7ba99 Replace system() by native perl calls
llvm-svn: 209524
2014-05-23 16:10:00 +00:00
Daniel Jasper c64b09acc3 clang-format: Introduce DisableFormat that prevents formatting.
And "none" pseudo-style indicating that formatting should be not
applied.

(1) Using .clang-format with "DisableFormat: true" effectively prevents
formatting for all files within the folder containing such .clang-format
file.

(2) Using -fallback-style=none together with -style=file prevents
formatting when .clang-format is not found, which can be used in on-save
callback.

Patch by Adam Strzelecki. Thank you!

llvm-svn: 209446
2014-05-22 15:12:22 +00:00
Daniel Jasper 62f73ec1ef clang-format: Fix vim-integration for empty files.
Discovered by Ahmed Charles in http://reviews.llvm.org/D3018.

llvm-svn: 209417
2014-05-22 11:37:05 +00:00
Alp Toker fdafb94f01 RAV reunification: merge Lambda body visitation to DRAV
llvm-svn: 209246
2014-05-20 22:03:39 +00:00
Justin Bogner 9c785294fb VirtualFileSystem: Add YAMLVFSWriter to generate VFS mapping files
This moves the logic to write a JSON VFS mapping from the C api into
VirtualFileSystem, so that we can use it internally.

No functional change.

llvm-svn: 209241
2014-05-20 21:43:27 +00:00
Oliver Stannard 9b2a7d4f2d Pass -gdwarf-N options to integrated assembler
llvm-svn: 209124
2014-05-19 13:39:13 +00:00
Alp Toker 2d57cea256 Provide and use a safe Token::getRawIdentifier() accessor
llvm-svn: 209061
2014-05-17 04:53:25 +00:00