summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Formatter: Prefer breaking before ObjC selector names over breaking at their ':'Nico Weber2013-01-122-5/+31
| | | | | | | | | | | | Before: if ((self = [super initWithContentRect:contentRect styleMask: styleMask backing:NSBackingStoreBuffered defer:YES])) { Now: if ((self = [super initWithContentRect:contentRect styleMask:styleMask backing:NSBackingStoreBuffered defer:YES])) { llvm-svn: 172333
* Add a comment to test to clarify the intention hereDmitri Gribenko2013-01-121-0/+3
| | | | | | Comment is taken from the commit message of r151080, by Jean-Daniel Dupas llvm-svn: 172332
* Prune an unused diagnostic, detected after improving the script in r172330Dmitri Gribenko2013-01-121-2/+0
| | | | llvm-svn: 172331
* Speed up find-unused-diagnostics. Now runs in less than a second instead of ↵Benjamin Kramer2013-01-121-11/+7
| | | | | | more than a minute. llvm-svn: 172330
* Remove unused diagnosticsDmitri Gribenko2013-01-121-4/+0
| | | | llvm-svn: 172326
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-12184-597/+577
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* Fix spurious output in JSONCompilationDatabaseArnaud A. de Grandmaison2013-01-121-5/+1
| | | | llvm-svn: 172321
* Add missing includes and forward declarations so that headers don't depend onDmitri Gribenko2013-01-1216-5/+25
| | | | | | other headers included before them. llvm-svn: 172320
* commentRafael Espindola2013-01-121-0/+3
| | | | llvm-svn: 172317
* barRafael Espindola2013-01-122-0/+7
| | | | llvm-svn: 172316
* Remove unused private field.Rafael Espindola2013-01-121-7/+3
| | | | llvm-svn: 172314
* Fix incorrect comparison operator causing loooong formatting times.Daniel Jasper2013-01-122-1/+21
| | | | llvm-svn: 172308
* Formatter: Remove an always-false condition.Nico Weber2013-01-121-2/+1
| | | | | | | | canBreakBefore() does not allow breaking after ':' for LT_ObjCMethodDecl lines, so if Newline is true in addTokenToState() for ':' then LT_ObjCMethodDecl cannot be set. No functionality change. llvm-svn: 172307
* Formatter: Remove a redundant CurrentLineType check.Nico Weber2013-01-122-3/+2
| | | | | | The containing if checks for this already. No functionality change. llvm-svn: 172306
* Disable caching of visibility.Rafael Espindola2013-01-1211-87/+124
| | | | | | | | | | | | | | The testcase in pr14929 shows that this is extremely hard to do. If we choose to apply the attribute, that causes the visibility of some decls to change and that can happen really late (during codegen). Current gcc warns and ignores the attribute in this testcase with a warning. This suggest that the correct solution is to find a point in the compilation where we can compute the visibility and * assert it was never computed before * reject any attempts to compute it again in the future (with warnings). llvm-svn: 172305
* Formatter: Initial support for formatting Objective-C method expressions. ↵Nico Weber2013-01-122-6/+109
| | | | | | | | | | | | | | | | | | | | This follows the approach suggested by djasper in PR14911: When a '[' is seen that's at the start of a line, follows a binary operator, or follows one of : [ ( return throw, that '[' and its closing ']' are marked as TT_ObjCMethodExpr and every ':' in that range that isn't part of a ternary ?: is marked as TT_ObjCMethodExpr as well. Update the layout routines to not output spaces around ':' tokens that are marked TT_ObjCMethodExpr, and only allow breaking after such tokens, not before. Before: [self adjustButton : closeButton_ ofKind : NSWindowCloseButton]; Now: [self adjustButton:closeButton_ ofKind:NSWindowCloseButton]; llvm-svn: 172304
* Formatter: * and & are binary operators before ( and [.Nico Weber2013-01-122-0/+4
| | | | llvm-svn: 172303
* Formatter: * and & are binary operators after ) and ].Nico Weber2013-01-122-1/+4
| | | | llvm-svn: 172302
* Formatter: + and - after { are unary operators.Nico Weber2013-01-122-1/+4
| | | | llvm-svn: 172301
* clang/unittests: Fixup corresponding to r172290.NAKAMURA Takumi2013-01-124-0/+12
| | | | llvm-svn: 172295
* Fix a regression from 171193: main cannot be overloaded.Rafael Espindola2013-01-122-0/+8
| | | | | | Thanks Eli Friedman for noticing it. llvm-svn: 172292
* Provide Decl::getOwningModule(), which determines the (sub)module inDouglas Gregor2013-01-1215-28/+101
| | | | | | | | | | | | | which a particular declaration resides. Use this information to customize the "definition of 'blah' must be imported from another module" diagnostic with the module the user actually has to import. Additionally, recover by importing that module, so we don't complain about other names in that module. Still TODO: coming up with decent Fix-Its for these cases, and expand this recovery approach for other name lookup failures. llvm-svn: 172290
* Formatter: add a test for :? in []Nico Weber2013-01-121-0/+7
| | | | llvm-svn: 172289
* Only produce one -Wc++98-compat warning when initializing a reference from ↵Richard Smith2013-01-122-0/+8
| | | | | | an init list with multiple elements. llvm-svn: 172285
* Add a test from pr14898.Rafael Espindola2013-01-121-0/+23
| | | | llvm-svn: 172283
* Fix -Wunused-comparison for comparisons in arguments to function-like macros.Matt Beaumont-Gay2013-01-124-5/+26
| | | | | | | | | | | Previously, -Wunused-comparison ignored comparisons in both macro bodies and macro arguments, but we would still emit a -Wunused-value warning for either. Now we correctly emit -Wunused-comparison for expressions in macro arguments. Also, add isMacroBodyExpansion to SourceManager, to go along with isMacroArgExpansion. llvm-svn: 172279
* comment parsing: when property accessors don't have commentFariborz Jahanian2013-01-123-1/+77
| | | | | | | of their own (or are syntheszed), use prperty's comment. for them. // rdar://12791315 llvm-svn: 172278
* Refine analyzer's handling of unary '!' and floating types to not assert.Ted Kremenek2013-01-112-1/+10
| | | | | | Fixes PR 14634 and <rdar://problem/12903080>. llvm-svn: 172274
* Fixed a bug that caused the AST importer to erroneouslySean Callanan2013-01-111-1/+1
| | | | | | | import incomplete definitions for RecordDecls and then mark the resulting definition as complete. llvm-svn: 172273
* libclang: use C++ casts in CXString.cppDmitri Gribenko2013-01-111-4/+5
| | | | llvm-svn: 172272
* libclang: constness for CXStringDmitri Gribenko2013-01-112-4/+4
| | | | llvm-svn: 172270
OpenPOWER on IntegriCloud