summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* Topologically sort the link options generated for modules based onDouglas Gregor2013-01-143-70/+123
| | | | | | | module-import dependencies, so we'll get the link order correct for those silly linkers that need it. llvm-svn: 172459
* When forming the link options for an imported module, also include theDouglas Gregor2013-01-143-6/+12
| | | | | | link options for the modules it imports. llvm-svn: 172448
* [analyzer] Add ProgramStatePartialTrait<const void *>.Jordan Rose2013-01-143-5/+18
| | | | | | This should fix cast-away-const warnings reported by David Greene. llvm-svn: 172446
* [analyzer] Fix cast-away-const warning by using const_cast.Jordan Rose2013-01-141-1/+1
| | | | | | Patch by David Greene, modified by me. llvm-svn: 172445
* [analyzer] -drain is not an alias for -release.Jordan Rose2013-01-142-4/+15
| | | | | | | | | | | This was previously added to support -[NSAutoreleasePool drain], which behaves like -release under non-GC and "please collect" under GC. We're not currently modeling the autorelease pool stack, though, so we can just take this out entirely. Fixes PR14927. llvm-svn: 172444
* Switch autolinking metadata format over to actual linker options, e.g.,Douglas Gregor2013-01-143-35/+38
| | | | | | | | | | | | | | | | | | | !0 = metadata !{metadata !"-lautolink"} !1 = metadata !{metadata !"-framework", metadata !"autolink_framework"} referenced from llvm.module.linkoptions, e.g., !llvm.module.linkoptions = !{!0, !1, !2, !3} This conceptually moves the logic for figuring out the syntax the linker will accept from LLVM into Clang. Moreover, it makes it easier to support MSVC's #pragma comment(linker, "some option") in the future, should anyone care to do so. llvm-svn: 172441
* Infer "link" lines for top-level frameworks. Essentially, a frameworkDouglas Gregor2013-01-145-2/+50
| | | | | | | | will have a shared library with the same name as its framework (and no suffix!) within its .framework directory. Detect this both when inferring the whole top-level framework and when parsing a module map. llvm-svn: 172439
* This patch addresses varargs processing for small complex types underBill Schmidt2013-01-142-1/+112
| | | | | | | | | | | | | | | | | | | the 64-bit PowerPC ELF ABI. The ABI requires that the real and imaginary parts of a complex argument each occupy their own doubleword. Arguments smaller than 8 bytes are right-adjusted within the doubleword. Clang expects EmitVAARG() to return a pointer to a structure in which the real and imaginary parts are packed adjacently in memory. To accomplish this, we generate code to load the code appropriately from the varargs location and pack the values into a temporary variable in the form Clang expects, returning a pointer to that structure. The test case demonstrates correct code generation for all "small" complex types on PPC64: int, short, char, and float. llvm-svn: 172438
* Implement parsing, AST, (de-)serialization, and placeholder globalDouglas Gregor2013-01-1414-8/+227
| | | | | | | | | | | | | | | | | | | | | | | | | metadata for linking against the libraries/frameworks for imported modules. The module map language is extended with a new "link" directive that specifies what library or framework to link against when a module is imported, e.g., link "clangAST" or link framework "MyFramework" Importing the corresponding module (or any of its submodules) will eventually link against the named library/framework. For now, I've added some placeholder global metadata that encodes the imported libraries/frameworks, so that we can test that this information gets through to the IR. The format of the data is still under discussion. llvm-svn: 172437
* Fixes formatting of nested brace initializers.Manuel Klimek2013-01-142-7/+44
| | | | | | | | | | | | | | | | We now format this correctly: Status::Rep Status::global_reps[3] = { { kGlobalRef, OK_CODE, NULL, NULL, NULL }, { kGlobalRef, CANCELLED_CODE, NULL, NULL, NULL }, { kGlobalRef, UNKNOWN_CODE, NULL, NULL, NULL } }; - fixed a bug where BreakBeforeClosingBrace would be set on the wrong state - added penalties for breaking between = and {, and between { and any other non-{ token llvm-svn: 172433
* Make single-line if statements optional.Daniel Jasper2013-01-143-10/+35
| | | | | | | | | Now, "if (a) return;" is only allowed, if this option is set. Also add a Chromium style which is currently identical to Google style except for this option. llvm-svn: 172431
* Fix a bug in the line merging.Daniel Jasper2013-01-142-0/+4
| | | | | | | If the first line of a merge would exactly fit into the column limit, an unsigned overflow made us not break. llvm-svn: 172426
* Fix bug that would lead to joining preprocessor directives.Daniel Jasper2013-01-142-7/+8
| | | | | | | Before: #include "a.h" #include "b.h" After: #include "a.h" #include "b.h" llvm-svn: 172424
* Put simple preprocessor directives on a single line.Daniel Jasper2013-01-142-10/+30
| | | | | | | Before: #define A \ A After: #define A A llvm-svn: 172423
* Turns out there is a simpler way of getting a set difference in bash than ↵Benjamin Kramer2013-01-141-1/+1
| | | | | | parsing diff output. llvm-svn: 172420
* Put short if statements on a single line.Daniel Jasper2013-01-142-36/+63
| | | | | | | | | | | Before: if (a) return; After: if (a) return; Not yet sure, whether this is always desired, but we can add options and make this a style parameter as we go along. llvm-svn: 172413
* Dump comments in -ast-dump.Alexander Kornienko2013-01-145-280/+265
| | | | | | | | | | | http://llvm-reviews.chandlerc.com/D269 "Added dumping of declaration comments in ASTDumper. This required moving the comment dumping code from CommentDumper so that the indentation is correct." Patch by Philip Craig! llvm-svn: 172409
* clang/test/SemaCXX/cxx11-gnu-attrs.cpp: Add explicit -triple ↵NAKAMURA Takumi2013-01-141-1/+1
| | | | | | x86_64-unknown-unknown, or it doesn't work for targetting win32. llvm-svn: 172404
* Refactor datastructure used in clang-format.Daniel Jasper2013-01-141-123/+138
| | | | | | | | | | | Main difference, add an AnnotatedLine class to hold information about a line while formatting. At the same time degrade the UnwrappedLine class to a class solely used for communicating between the UnwrappedLineParser and the Formatter. No functional changes intended. llvm-svn: 172403
* Improve understanding post increment and decrement.Daniel Jasper2013-01-142-1/+6
| | | | | | | | Before: (a->f()) ++; a[42] ++; After: (a->f())++; a[42]++; llvm-svn: 172400
* Custom DiagnosticConsumer parameter of reformat() + silence diagnostics in ↵Alexander Kornienko2013-01-143-13/+21
| | | | | | | | | | | | | | | | | | unit tests. Summary: Added tests for clang-format diagnostics. Added DiagnosticConsumer argument to clang::format::reformat(). Reviewers: klimek, djasper Reviewed By: djasper CC: cfe-commits, thakis, rafael.espindola Differential Revision: http://llvm-reviews.chandlerc.com/D290 llvm-svn: 172399
* Adds some more tests for * and &.Manuel Klimek2013-01-141-0/+6
| | | | | | | While reviewing r172303 I noticed that I wasn't sure whether we still format those correctly and didn't see any tests. llvm-svn: 172396
* Add extra tests for [[gnu::...]] attributes, missed from r172382.Richard Smith2013-01-141-0/+45
| | | | llvm-svn: 172391
* Fix regression in r172376. Don't try to detect missing 'constexpr' specifiersRichard Smith2013-01-142-2/+5
| | | | | | | on redeclarations, since that makes us pick wrong prior declarations under some circumstances. llvm-svn: 172384
* Accept [[gnu::*]] for all __attribute__((*))s which are:Richard Smith2013-01-144-58/+94
| | | | | | | | | | | 1) Supported by Clang, and 2) Supported by GCC, and 3) Documented in GCC's manual. g++ allows its C++11-style attributes to appertain only to the entity being declared, and never to a type (even for a type attribute), so we do the same. llvm-svn: 172382
* Formatter: Add a test for bitfields.Nico Weber2013-01-141-0/+7
| | | | | | | | They work fine, but this fifth use of colons (after labels, in ?:, in initalizer lists in constructors, in objc method expressions, and in bitfields) wasn't covered by tests yet. llvm-svn: 172377
* PR12008: defer adding the implicit 'const' to a constexpr member function untilRichard Smith2013-01-146-87/+129
| | | | | | we know whether it is static. llvm-svn: 172376
* *this is const in a trailing-return-type for a constexpr member function.Richard Smith2013-01-142-1/+11
| | | | llvm-svn: 172375
* libclang: remove a few const_castsDmitri Gribenko2013-01-144-9/+8
| | | | llvm-svn: 172373
* Constify argument of Preprocessor::getMacroInfoHistory and propagate toDmitri Gribenko2013-01-146-9/+10
| | | | | | callers, removing unneeded const_cast llvm-svn: 172372
* Remove an unneeded const_castDmitri Gribenko2013-01-141-1/+1
| | | | llvm-svn: 172370
* ArrayRef'ize Sema APIs related to format string checkingDmitri Gribenko2013-01-133-50/+55
| | | | llvm-svn: 172367
* Document behavior of -Wformat-nonliteral, it is different from GCCDmitri Gribenko2013-01-131-0/+58
| | | | llvm-svn: 172362
* Stronger respect the input codes line breaks wrt. comments.Daniel Jasper2013-01-132-4/+18
| | | | | | | | | | | | | | | | | | clang-format should not change whether or not there is a line break before a line comment as this strongly influences the percieved binding. User input: void f(int a, // b is awesome int b); void g(int a, // a is awesome int b); Before: void f(int a, // b is awesome int b); void g(int a, // a is awesome int b); After: <unchanged from input> llvm-svn: 172361
* Fix LLP64 build.Michael J. Spencer2013-01-131-1/+1
| | | | llvm-svn: 172357
* Format unions like structs and classes.Daniel Jasper2013-01-132-1/+3
| | | | | | | | | | | Note that I don't know whether we should put {} on a single line in this case, but it is probably a theoretical issue as in practice such structs, classes or unions won't be empty. Before: union A {} a; After: union A {} a; llvm-svn: 172355
* Refactor the x86 CPU name logic in the driver and pass -march and -mcpuChandler Carruth2013-01-132-66/+91
| | | | | | | | | | flag information down from the Clang driver into the Gold linker plugin for LTO. This allows specifying -march on the linker commandline and should hopefully have it pass all the way through to the LTO optimizer. Fixes PR14697. llvm-svn: 172354
* CGBuiltin.cpp: Fix abuse of ArrayRef in EmitOverflowIntrinsic().NAKAMURA Takumi2013-01-131-2/+1
| | | | | | | | | | | | | | | | | | | | In ArrayRef<T>(X), X should not be temporary value. It could be rewritten more redundantly; llvm::Type *XTy = X->getType(); ArrayRef<llvm::Type *> Ty(XTy); llvm::Value *Callee = CGF.CGM.getIntrinsic(IntrinsicID, Ty); Since it is safe if both XTy and Ty are temporary value in one statement, it could be shorten; llvm::Value *Callee = CGF.CGM.getIntrinsic(IntrinsicID, ArrayRef<llvm::Type*>(X->getType())); ArrayRef<T> has an implicit constructor to create uni-entry of T; llvm::Value *Callee = CGF.CGM.getIntrinsic(IntrinsicID, X->getType()); MSVC-generated clang.exe crashed. llvm-svn: 172352
* Always put a space after ",".Daniel Jasper2013-01-132-0/+3
| | | | | | | | | | I am not aware of a case where that would be wrong. The specific case I am fixing are function parameters wrapped in parenthesis (e.g. in macros). Before: function(a,(b)); After: function(a, (b)); llvm-svn: 172351
* Don't put spaces around hyphens in include paths.Daniel Jasper2013-01-132-21/+18
| | | | | | Before: #include <a - a> After: #include <a-a> llvm-svn: 172350
* Improve identification of c-style casts.Daniel Jasper2013-01-132-4/+24
| | | | | | | | | A ")" before any of "=", "{" or ";" won't be a cast. This fixes issues with the formatting of unnamed parameters. Before: void f(int *){} After: void f(int *) {} llvm-svn: 172349
* Updated documentation to reflect new multiprecision builtin functions.Michael Gottesman2013-01-131-0/+37
| | | | llvm-svn: 172345
* clang/test/CodeGen/builtins-multiprecision.c: Enhance for each test to run ↵NAKAMURA Takumi2013-01-131-10/+13
| | | | | | on theree targets, i686, amd64, win64. llvm-svn: 172344
* Fixed spelling of test name: builtins-multipercision.c => ↵Michael Gottesman2013-01-131-0/+0
| | | | | | builtins-multiprecision.c. llvm-svn: 172343
* Added a triple to the test builtins-multiprecision.c.Michael Gottesman2013-01-131-1/+1
| | | | llvm-svn: 172342
* Added builtins for multiprecision adds.Michael Gottesman2013-01-133-0/+150
| | | | | | | We lower all of these intrinsics into a 2x chained usage of uadd.with.overflow. llvm-svn: 172341
* Remove some duplication in the handling of __attribute__((ext_vector_size(N))).Richard Smith2013-01-132-40/+7
| | | | llvm-svn: 172340
* Formatter: Don't insert a space before unary operators after selector names.Nico Weber2013-01-122-2/+4
| | | | | | | | | | Before: [color getRed: &r green: &g blue: &b alpha: &a]; Now: [color getRed:&r green:&g blue:&b alpha:&a]; llvm-svn: 172337
* Formatter: Add a test for @selector in an ObjC method expression, which ↵Nico Weber2013-01-121-0/+1
| | | | | | happens to work already. llvm-svn: 172335
* Formatter: Remove debugging junk I accidentally landed in r172333.Nico Weber2013-01-122-4/+1
| | | | llvm-svn: 172334
OpenPOWER on IntegriCloud