Commit Graph

2946 Commits

Author SHA1 Message Date
Ben Langmuir 749323fadb Attempt to fix null ASTContext in ASTUnit error path
We don't need the ASTContext for the diagnostics, only the language
options, which we can get from the compiler invocation. It worries me
how many categorically different states the ASTUnit class can be in
depending on how it is being constructed/used.

llvm-svn: 206909
2014-04-22 17:40:12 +00:00
Alexander Musman 8dba66412b [OPENMP] parsing 'linear' clause (for directive 'omp simd')
Differential Revision: http://reviews.llvm.org/D3272

llvm-svn: 206891
2014-04-22 13:09:42 +00:00
Ted Kremenek dd21b89a25 Handle possible trailing '/' in xcode-select output. Patch by Jeff Olson.
llvm-svn: 206752
2014-04-21 14:13:22 +00:00
Justin Bogner 837a6f6f79 CodeGen: Use LLVM's InstrProfReader in -fprofile-instr-use=
Update clang to use the InstrProfReader from LLVM to read
instrumentation based profile data. This also switches us from the
naive text format to the binary format, since that's what's
implemented in the reader.

llvm-svn: 206658
2014-04-18 21:52:00 +00:00
Nico Weber ffaf29a07b clang-format.py: Don't omit the first two words from error messages.
This reverts r172072.  clang-format used to use DiagnosticEngine to output
errors: http://llvm.org/viewvc/llvm-project?view=revision&revision=172071. Now
it doesn't, so this code is obsolete.

llvm-svn: 206479
2014-04-17 17:51:57 +00:00
Ben Langmuir a56071c5fb When writing YAML in libclang, use yaml::escape instead of write_escaped
The YAMLParser has its own escaped string representation, and does not
handle octal escape sequences. When writing the virtual file system to a
YAML file, use yaml::escape().

llvm-svn: 206443
2014-04-17 03:31:02 +00:00
Ben Langmuir 8832c066a2 Honour -ivfsoverlay in ASTUnit to match clang
This allows code indexing, etc. to use the VFS in the same way as the
compiler.

llvm-svn: 206309
2014-04-15 18:16:25 +00:00
Benjamin Kramer 5c323b833b Replace llvm::array_endof with C++11's std::end.
No functionality change.

llvm-svn: 206111
2014-04-12 15:42:48 +00:00
Anders Waldenborg ddce74f6f8 Make c-index-test -test-print-type include pointeekind for pointer types
The idea is to give visibility to more type kinds, especially for getting
a better grasp of what appears as unexposed type kind with libclang.

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

llvm-svn: 205921
2014-04-09 19:16:08 +00:00
Daniel Jasper dfacecbd31 clang-format: Add proto files and JavaScript to git-clang-format.
llvm-svn: 205842
2014-04-09 09:22:35 +00:00
Dmitri Gribenko e570ede5d1 libclang: add clang_CXXMethod_isConst API that allows to determine if a C++
member function or member function template is declared 'const'

Patch by Kevin Funk with testcase updates by me.

llvm-svn: 205714
2014-04-07 14:59:13 +00:00
David Blaikie b31e1d16df Comment necessity of early initialization
Code review feedback from Eric Christopher on r204261.

I didn't want to go into too much detail (the revision history should
provide the full stuff) - but I can add more if that's preferred.

Also moved this up to right by the construction of the MCAsmInfo so
there's less chance that other things might sneak in in between.

llvm-svn: 205267
2014-03-31 23:47:13 +00:00
David Blaikie 07b8d4e6ed DebugInfo compression: Enable compression before any sections are created.
For those playing at home this produced some fairly subtle behavior. The
sections created in InitMCObjectFileInfo were created without compressed
debug info (a mistake, but not necessarily /broken). Since these
sections were almost always referenced by the existing MCSection object,
this almost worked.

This got weird when we got to handling the relocations for a section.
See ELFObjectWriter::WriteSection where we compute the true section for
a relocation section by simply stripping the ".rela" prefix and then
looking up that section - doing so hit the compression codepath, looked
up .zdebug_blah and found a newly constructed empty section... thus,
things got weird.

This is untestable without a cross-project test (let me know if people
would prefer that to no testing).

llvm-svn: 205261
2014-03-31 23:13:30 +00:00
NAKAMURA Takumi 8e5f80d2cf clang/tools/driver/Makefile: Quick fix corresponding to r205181.
llvm-svn: 205189
2014-03-31 14:11:11 +00:00
Alexey Bataev d48bcd8a46 [OPENMP] Implemented 'copyin' clause
llvm-svn: 205164
2014-03-31 03:36:38 +00:00
Dmitri Gribenko 237769ede5 libclang/libIndex: USR generation: mangle source location into USRs for macros,
unless the macro comes from a system header

llvm-svn: 205064
2014-03-28 22:21:26 +00:00
David Blaikie 7e2fd943ae Support for -Wa,-compress-debug-sections.
Also, while I'm here, support -nocompress-debug-sections too.

llvm-svn: 204959
2014-03-27 20:47:30 +00:00
Chandler Carruth e24605bbcd [cleanup] Stop specifying size overrides for BumpPtrAllocators.
These don't seem to have any real point. Let's start with
IndexingContext. I can't come up with any conceivable reason to have
many hundereds of thousands of these alive in an address space which
would make the 4x difference in allocated (but unused) memory for the
string scratch buffer a significant memory usage problem.

The EditedSource one is somewhat more surprising. This is an 8x increase
in the memory allocated (but not used) per editted source file. However,
for this to realistically be a problem, you would need to have over half
a million editted source files in a single address space, and even that
would only really have problems on 32-bit Windows where you really only
have 2gb of virtual address space. And what's more important, the fix to
this if it is actually an issue shouldn't be to shrink the allocator's
size, it is to pass a single allocator into *many* edited source file
objects and let them share the memory.

These were the only two uses of custom sized BumpPtrAllocators
(excluding ones in the JIT using a custom allocation strategy) in all of
LLVM, Clang, LLD, LLDB, or Polly. I don't think we actually need this
complexity in the primary BumpPtrAllocator at all and am planning to
remove it.

llvm-svn: 204910
2014-03-27 10:45:22 +00:00
Alexey Bataev 62c87d2509 [OPENMP] parsing of clause 'safelen' (for directive 'omp simd')
llvm-svn: 204428
2014-03-21 04:51:18 +00:00
Jordan Rose 0d7d09f804 [analyzer] scan-build: allow quotes around "-cc1" when looking at -### output.
Third time's the charm. Patch by Brennan Shacklett!

llvm-svn: 204362
2014-03-20 17:43:54 +00:00
Jordan Rose 428f2e980a [analyzer] scan-build: match whitespace instead of word boundaries around flags.
Because neither ' ' nor '-' is alphanumeric, \b won't match between them!
Since in this case we know our output is coming from a -### invocation,
we should always have spaces on both sides of the flag we're trying to match,
"-cc1".

llvm-svn: 204356
2014-03-20 16:37:54 +00:00
Benjamin Kramer efb1eb981b Tooling: Move heavyweight vectors around instead of copying.
While there convert to range-based for loops. No functionality change.

llvm-svn: 204338
2014-03-20 12:48:36 +00:00
Argyrios Kyrtzidis a9ab4d46bb [libclang] Introduce clang_VirtualFileOverlay_setCaseSensitivity that exposes the VFS option
to set the case-sensitivity for lookups.

rdar://16374696

llvm-svn: 204303
2014-03-20 04:51:48 +00:00
Jordan Rose 69ab726724 [analyzer] scan-build: when matching flags, make sure the - is the first letter.
PR19191

llvm-svn: 204253
2014-03-19 17:42:26 +00:00
Craig Topper 36835568d8 [C++11] Add 'override' keyword to virtual methods that override their base class.
llvm-svn: 204002
2014-03-15 07:47:46 +00:00
Aaron Ballman 535bbcccb1 [C++11] Replacing DeclStmt iterators decl_begin() and decl_end() with iterator_range decls(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203947
2014-03-14 17:01:24 +00:00
Aaron Ballman 2205d2a56a [C++11] Replacing OMPThreadPrivateDecl and OMPClause iterators varlist_begin() and varlist_end() with iterator_range varlists(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203937
2014-03-14 15:55:35 +00:00
Aaron Ballman d6d25de46e [C++11] Replacing ObjCImplementationDecl iterators ivar_begin() and ivar_end() with iterator_range ivars(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203932
2014-03-14 15:16:45 +00:00
Sebastian Pop 17fac04433 static link polly
llvm-svn: 203887
2014-03-14 04:04:27 +00:00
Aaron Ballman 91cdc28d93 [C++11] Replacing UsingDecl iterators shadow_begin() and shadow_end() with iterator_range shadows(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203825
2014-03-13 18:07:29 +00:00
Aaron Ballman 0ad78303de [C++11] Replacing CXXRecordDecl iterators init_begin() and init_end() with iterator_range inits(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203819
2014-03-13 17:34:31 +00:00
Aaron Ballman 574705ed7f [C++11] Replacing CXXRecordDecl iterators bases_begin() and bases_end() with iterator_range bases(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203803
2014-03-13 15:41:46 +00:00
Justin Bogner d66a17d0a3 Revert "CodeGen: Use a binary format for instrumentation based profiling"
I've clearly done something wrong with how to get this to link
correctly. Reverting for now.

This reverts commit r203711.

llvm-svn: 203712
2014-03-12 21:06:31 +00:00
Justin Bogner ff9a058267 CodeGen: Use a binary format for instrumentation based profiling
This updates CodeGenPGO to use the ProfileDataReader introduced to
llvm in r203703 and the new API for writing out the profile introduced
to compiler-rt in r203710.

llvm-svn: 203711
2014-03-12 20:53:16 +00:00
Hans Wennborg 501eadb429 Check for LLVM_ON_WIN32 instead of _WIN32.
This is a follow-up to r203624 to address Anton's comment.

llvm-svn: 203668
2014-03-12 16:07:46 +00:00
Dmitri Gribenko 340dd5193d Use vector<T>::data() to simplify code
llvm-svn: 203665
2014-03-12 15:35:53 +00:00
Hans Wennborg ae1c5a88f4 Be case sensitive when determining driver mode based on argv[0] except on Windows
This narrows the impact of r188833 after Dimitry pointed out that it's good to be
able to tell the difference between 'cc' and 'CC'.

llvm-svn: 203624
2014-03-11 23:42:29 +00:00
Ahmed Charles f9e1e5f8de Add a main function to the clang-format.py vim integration.
This will allow using an early return statement in a subsequent change.

llvm-svn: 203501
2014-03-10 22:12:14 +00:00
Rafael Espindola a7a94d10ea Replace CLANG_IS_PRODUCTION with CLANG_PLUGIN_SUPPORT.
llvm-svn: 203473
2014-03-10 17:00:46 +00:00
Ahmed Charles dfca6f97bc [C++11] Replace OwningPtr include with <memory>.
llvm-svn: 203389
2014-03-09 11:36:40 +00:00
Aaron Ballman b97112e4bd [C++11] Replacing Decl iterators attr_begin() and attr_end() with iterator_range attrs(). Updating all of the usages of the iterators with range-based for loops.
This is a reapplication of r203236 with modifications to the definition of attrs() and following the new style guidelines on auto usage.

llvm-svn: 203362
2014-03-08 22:19:01 +00:00
Aaron Ballman e8a8baef44 [C++11] Replacing RecordDecl iterators field_begin() and field_end() with iterator_range fields(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203355
2014-03-08 20:12:42 +00:00
Rafael Espindola 181d29782e Add an option to disable plugins in clang.
An option with the same name already exists in the makefile build.

The name CLANG_IS_PRODUCTION is historical. We should probably change it, but
should change the configure build at the same time.

llvm-svn: 203325
2014-03-08 01:19:37 +00:00
Rafael Espindola bc28340573 Revert "Add an option to disable plugins in clang."
This reverts commit r203320.

There is some order dependency going on that I missed.

llvm-svn: 203321
2014-03-08 00:41:53 +00:00
Rafael Espindola 8c49cd1b06 Add an option to disable plugins in clang.
An option with the same name already exists in the makefile build.

llvm-svn: 203320
2014-03-08 00:33:15 +00:00
Benjamin Kramer 4cadf292a5 [C++11] Revert uses of lambdas with array_pod_sort.
Looks like GCC implements the lambda->function pointer conversion differently.

llvm-svn: 203293
2014-03-07 21:51:58 +00:00
Benjamin Kramer 15ae783e14 [C++11] Convert sort predicates into lambdas.
No functionality change.

llvm-svn: 203289
2014-03-07 21:35:40 +00:00
Ahmed Charles b89843299a Replace OwningPtr with std::unique_ptr.
This compiles cleanly with lldb/lld/clang-tools-extra/llvm.

llvm-svn: 203279
2014-03-07 20:03:18 +00:00
Aaron Ballman 629afaefe0 [C++11] Replacing DeclBase iterators decls_begin() and decls_end() with iterator_range decls(). The same is true for the noload versions of these APIs. Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203278
2014-03-07 19:56:05 +00:00
Ahmed Charles 9a16beb8bc Change OwningPtr::take() to OwningPtr::release().
This is a precursor to moving to std::unique_ptr.

llvm-svn: 203275
2014-03-07 19:33:25 +00:00