Commit Graph

606 Commits

Author SHA1 Message Date
Angel Garcia Gomez 637d1e6694 Roll-back r250822.
Summary: It breaks the build for the ASTMatchers

Subscribers: klimek, cfe-commits

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

llvm-svn: 250827
2015-10-20 13:23:58 +00:00
Angel Garcia Gomez b5250d3448 Apply modernize-use-default to clang.
Summary: Replace empty bodies of default constructors and destructors with '= default'.

Reviewers: bkramer, klimek

Subscribers: klimek, alexfh, cfe-commits

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

llvm-svn: 250822
2015-10-20 12:52:55 +00:00
Yaron Keren 70bd288534 Make local function isWhitespaceExceptNL static instead of in anonymous namespace
per the coding standard. Thanks Craig Tooper for noticing this.

llvm-svn: 243381
2015-07-28 04:54:03 +00:00
Yaron Keren a96ffd5337 Rename highly-confusing isWhitespace that returns false on \n to
isWhitespaceExceptNL. If that's wasn't bad enough, we have an identically 
named function in Basic/CharInfo.h.

While at it, remove unnecessary includes, .str() calls and #ifdef.

llvm-svn: 243260
2015-07-27 06:35:22 +00:00
Alexander Kornienko ab9db51042 Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").
llvm-svn: 240353
2015-06-22 23:07:51 +00:00
Alexander Kornienko 3d9d929e42 Fixed/added namespace ending comments using clang-tidy. NFC
The patch is generated using this command:

  $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \
      -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \
      work/llvm/tools/clang

To reduce churn, not touching namespaces spanning less than 10 lines.

llvm-svn: 240270
2015-06-22 09:47:44 +00:00
Benjamin Kramer 8017237277 Remove empty non-virtual destructors or mark them =default when non-public
These add no value but can make a class non-trivially copyable. NFC.

llvm-svn: 234689
2015-04-11 15:58:30 +00:00
Argyrios Kyrtzidis 69e6f1f257 [Rewrite] Make RewriteBuffer accessible on its own, and add a unit test for it.
llvm-svn: 231588
2015-03-08 04:00:33 +00:00
Hans Wennborg aa244c4cc4 Trim some includes. NFC.
llvm-svn: 220877
2014-10-29 22:13:46 +00:00
Daniel Jasper 09c7c93937 Delete unused method and clangAST dependency it required.
llvm-svn: 220640
2014-10-26 14:26:55 +00:00
NAKAMURA Takumi 3866e52803 [CMake] clangRewrite: Roll back clangAST in libdeps, due to clang::Stmt::printPretty().
llvm-svn: 220549
2014-10-24 08:44:01 +00:00
Daniel Jasper 4475a249e7 Remove code duplication and cut dependency from clangRewrite on
clangAST.

llvm-svn: 220502
2014-10-23 19:47:36 +00:00
Benjamin Kramer fdacdb26af Use intrusive refcounted pointers to manage RopeRefCountString lifetime.
std::shared_ptr<char []> would be even nicer, but shared_ptr doesn't work
with arrays :(

No functionality change.

llvm-svn: 217798
2014-09-15 17:58:03 +00:00
Alp Toker 0621cb2e7d Make clang's rewrite engine a core feature
The rewrite facility's footprint is small so it's not worth going to these
lengths to support disabling at configure time, particularly since key compiler
features now depend on it.

Meanwhile the Objective-C rewriters have been moved under the
ENABLE_CLANG_ARCMT umbrella for now as they're comparatively heavy and still
potentially worth excluding from lightweight builds.

Tests are now passing with any combination of feature flags. The flags
historically haven't been tested by LLVM's build servers so caveat emptor.

llvm-svn: 213171
2014-07-16 16:48:33 +00:00
Rafael Espindola c080917ec2 Replace llvm::error_code with std::error_code.
llvm-svn: 210780
2014-06-12 14:02:15 +00:00
Richard Trieu ddd01cec0e Removing an "if (this == nullptr)" check from two print methods. The condition
will never be true in a well-defined context.  The checking for null pointers
has been moved into the caller logic so it does not rely on undefined behavior.

llvm-svn: 210498
2014-06-09 22:53:25 +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
Craig Topper 8ae1203992 [C++11] Use 'nullptr'.
llvm-svn: 208163
2014-05-07 06:21:57 +00:00
Lubos Lunak 4526b46ee6 write a line marker right before adding included file
Enclosing the original #include directive inside #if 0 adds lines,
so warning/errors messages would have the line number off in
"In file included from <file>:<line>:", so add line marker to fix this.

llvm-svn: 207795
2014-05-01 21:11:57 +00:00
Lubos Lunak 72cad68b30 do not use "1" for line marker for the predefines "file" either
Similar to r207764.

llvm-svn: 207794
2014-05-01 21:10:08 +00:00
Lubos Lunak 10961c0eab do not use "1" for line marker for the main file
"1" means entering a new file (from a different one), but the main
file is not included from anything (and this would e.g. confuse -Wunused-macros
to not report unused macros in the main file, see pr15610, or also see pr18948).
The line marker is still useful e.g. if the resulting file is renamed or used
via a pipe.

llvm-svn: 207764
2014-05-01 13:50:44 +00:00
Lubos Lunak 64568ca18a revert r207756
There's nothing wrong with the change itself, but
test/Frontend/rewrite-includes-messages.c fails without another
not-yet-committed fix.

llvm-svn: 207762
2014-05-01 13:37:55 +00:00
Lubos Lunak 576a0415cb do not warn about unknown pragmas in modes that do not handle them (pr9537)
And refactor to have just one place in code that sets up the empty
pragma handlers.

llvm-svn: 207758
2014-05-01 12:54:03 +00:00
Lubos Lunak c5f2bca866 write a line marker right before adding included file
Enclosing the original #include directive inside #if 0 adds lines,
so warning/errors messages would have the line number off in
"In file included from <file>:<line>:", so add line marker to fix this.

llvm-svn: 207756
2014-05-01 12:45:08 +00:00
Nico Weber 2d942deb19 Make RewriteRope less confusing for me. No intended behavior change.
llvm-svn: 207032
2014-04-23 21:42:27 +00:00
Fariborz Jahanian db3a5dcc60 Objective-C rewriter. Use _WIN64 instead of __LLP64__
to conditinalize on 64bit length in a generated meta-data.
// rdar://16489050

llvm-svn: 206402
2014-04-16 17:03:06 +00:00
Fariborz Jahanian 287e79a263 Objective-C modern translator. Fix declaration of
__NSConstantStringImpl's length field to accomodate
window's 64bit LLP64 mode. // rdar://16489050

llvm-svn: 205353
2014-04-01 19:32:35 +00:00
Aaron Ballman 40bd0aaf68 [C++11] Replacing FunctionProtoType iterators param_type_begin() and param_type_end() with iterator_range param_types(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 204045
2014-03-17 15:23:01 +00:00
Craig Topper fb6b25b5e4 [C++11] Add 'override' keyword to virtual methods that override their base class.
llvm-svn: 203999
2014-03-15 04:29:04 +00:00
Aaron Ballman 9371dd2287 [C++11] Replacing BlockDecl iterators capture_begin() and capture_end() with iterator_range captures(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203958
2014-03-14 18:34:04 +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 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
Aaron Ballman d85eff49a3 [C++11] Replacing ObjCCategoryDecl iterators propimpl_begin() and propimpl_end() with iterator_range property_impls(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203930
2014-03-14 15:02:45 +00:00
Aaron Ballman 19a417699f [C++11] Replacing ObjCCategoryDecl iterators protocol_begin() and protocol_end() with iterator_range protocols(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203922
2014-03-14 12:55:57 +00:00
Aaron Ballman 0f6e64d505 [C++11] Replacing ObjCProtocolDecl iterators protocol_begin() and protocol_end() with iterator_range protocols(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203863
2014-03-13 22:58:06 +00:00
Aaron Ballman a49c5064a1 [C++11] Replacing ObjCInterfaceDecl iterators protocol_begin() and protocol_end() with iterator_range protocols(). Updating all of the usages of the iterators with range-based for loops.
Drive-by fixing some incorrect types where a for loop would be improperly using ObjCInterfaceDecl::protocol_iterator. No functional changes in these cases.

llvm-svn: 203842
2014-03-13 20:29:09 +00:00
Aaron Ballman e8a7dc9889 [C++11] Replacing ObjCContainerDecl iterators classmeth_begin() and classmeth_end() with iterator_range class_methods(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203840
2014-03-13 20:11:06 +00:00
Aaron Ballman f26acce6f7 [C++11] Replacing ObjCContainerDecl iterators instmeth_begin() and instmeth_end() with iterator_range instance_methods(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203839
2014-03-13 19:50:17 +00:00
Aaron Ballman d174edffa0 Renaming the recently-created (r203830) props() range API to properties() for clarity.
llvm-svn: 203835
2014-03-13 19:11:50 +00:00
Aaron Ballman dc4bea4676 [C++11] Replacing ObjCContainerDecl iterators prop_begin() and prop_end() with iterator_range props(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203830
2014-03-13 18:47:37 +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
Ahmed Charles dfca6f97bc [C++11] Replace OwningPtr include with <memory>.
llvm-svn: 203389
2014-03-09 11:36:40 +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
Aaron Ballman 23a6dcb365 [C++11] Replacing EnumDecl iterators enumerator_begin() and enumerator_end() with iterator_range enumerators(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203353
2014-03-08 18:45:14 +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
Ahmed Charles d72a5f103d Replace OwningPtr::isValid() with conversion to bool.
This is a precursor to moving to std::unique_ptr.

llvm-svn: 203277
2014-03-07 19:51:06 +00:00
Aaron Ballman 43b68bebe7 [C++11] Replacing ObjCMethodDecl iterators param_begin() and param_end() with iterator_range params(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203255
2014-03-07 17:50:17 +00:00
NAKAMURA Takumi 9698686505 [CMake] Use LINK_LIBS instead of target_link_libraries().
llvm-svn: 202238
2014-02-26 06:41:29 +00:00
Benjamin Kramer fc18842437 RewriteObjC: Factor string literal creation into a helper and make sure it gets a proper constant array type.
No change in output.

llvm-svn: 202146
2014-02-25 12:26:11 +00:00
Rafael Espindola 4fbd373815 Update for llvm api change.
llvm-svn: 202053
2014-02-24 18:20:21 +00:00