summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Fix issue where a token paste which forms a /* or // would discard the rest ofRichard Smith2012-06-131-2/+2
| | | | | | | | the input: token-pasting was producing a tok::eof. Patch by Andy Gibbs! llvm-svn: 158412
* Allow __attribute__((unused)) for fields and make it silenceDaniel Jasper2012-06-132-1/+2
| | | | | | -Wunused-private-field. llvm-svn: 158411
* Remove the trailing backslash from the comment to remove the warning aboutKaelyn Uhrain2012-06-131-1/+1
| | | | | | a multi-line comment, fixing builds with e.g. -Werror=comment enabled. llvm-svn: 158406
* Fix off-by-one error in UTF-16 encoding: don't try to use a surrogate pair ↵Richard Smith2012-06-131-1/+1
| | | | | | for U+FFFF. llvm-svn: 158391
* PR13099: Teach -Wformat about raw string literals, UTF-8 strings and Unicode ↵Richard Smith2012-06-133-11/+74
| | | | | | escape sequences. llvm-svn: 158390
* Add missing narrowing check: converting from a signed integral type to a widerRichard Smith2012-06-131-5/+11
| | | | | | unsigned type is narrowing if the source is non-constant or negative. llvm-svn: 158377
* Grab bag of Microsoft Mangler fixes:Charles Davis2012-06-131-169/+425
| | | | | | | | | | - Support mangling virtual function tables (base tables need work on the ManglerContext interface). - Correct mangling of local scopes (i.e. functions and C++ methods). - Replace every llvm_unreachable() for actually-reachable code with a diagnostic. llvm-svn: 158376
* [ms-inline-asm] The __asm keyword is a statement separator, so multiple asmChad Rosier2012-06-121-0/+5
| | | | | | statements are allowed on the same line. llvm-svn: 158372
* [ms-inline-asm] Cleanup MS style inline assembly parsing.Chad Rosier2012-06-121-9/+46
| | | | | | | | | | Specifically, improve the handling of whitespace, stop saving tokens that are in comments and fix the case where we have a comment followed by a closing brace on the next line. Unfortunately, there's no easy way of testing this code. llvm-svn: 158367
* When code completion walks the members of a protocol or interface,Douglas Gregor2012-06-121-13/+45
| | | | | | make sure that we walk the definition. Fixes <rdar://problem/11427742>. llvm-svn: 158357
* Remove unused variable.Bill Wendling2012-06-121-1/+0
| | | | llvm-svn: 158353
* Add XOP permute intrinsics.Craig Topper2012-06-121-0/+28
| | | | llvm-svn: 158351
* If parsing a trailing-return-type fails, don't pretend we didn't have one atRichard Smith2012-06-125-18/+22
| | | | | | all. Suppresses follow-on errors mentioned in PR13074. llvm-svn: 158348
* Remove unused variable.Dmitri Gribenko2012-06-121-5/+0
| | | | llvm-svn: 158343
* Revert "[analyzer] Treat LValueBitCasts like regular pointer bit casts."Jordan Rose2012-06-123-12/+7
| | | | | | | | | This does not actually give us the right behavior for reinterpret_cast of references. Reverting so I can think about it some more. This reverts commit 50a75a6e26a49011150067adac556ef978639fe6. llvm-svn: 158341
* [analyzer] Treat LValueBitCasts like regular pointer bit casts.Jordan Rose2012-06-113-7/+12
| | | | | | | | | | | | | These casts only appear in very well-defined circumstances, in which the target of a reinterpret_cast or a function formal parameter is an lvalue reference. According to the C++ standard, the following are equivalent: reinterpret_cast<T&>( x) *reinterpret_cast<T*>(&x) [expr.reinterpret.cast]p11 llvm-svn: 158338
* Add PPC support for translating gcc-style -mcpu options into LLVM ↵Hal Finkel2012-06-113-0/+121
| | | | | | | | | | | | | | -target-cpu options. This functionality is based on what is done on ARM, and enables selecting PPC CPUs in a way compatible with gcc's driver. Also, mirroring gcc (and what is done on x86), -mcpu=native support was added. This uses the host cpu detection from LLVM (which will also soon be updated by refactoring code currently in backend). In order for this to work, the target needs a list of valid CPUs -- we now accept all CPUs accepted by LLVM. A few preprocessor defines for common CPU types have been added. llvm-svn: 158334
* Make CodeGenFunction::EmitMSAsmStmt throw a fatal error as MS-style inlineChad Rosier2012-06-111-37/+2
| | | | | | assembly is completely untested and unsupported. llvm-svn: 158329
* Etch out the code path for MS-style inline assembly.Chad Rosier2012-06-1112-33/+165
| | | | llvm-svn: 158325
* [analyzer] Add ObjCLoopChecker: objects from NSArray et al are non-nil.Jordan Rose2012-06-113-4/+86
| | | | | | | | | | | | While collections containing nil elements can still be iterated over in an Objective-C for-in loop, the most common Cocoa collections -- NSArray, NSDictionary, and NSSet -- cannot contain nil elements. This checker adds that assumption to the analyzer state. This was the cause of some minor false positives concerning CFRelease calls on objects in an NSArray. llvm-svn: 158319
* [analyzer] When looking for a known class, only traverse the hierarchy once.Jordan Rose2012-06-111-48/+50
| | | | | | | | | This has a small hit in the case where only one class is interesting (NilArgChecker) but is a big improvement when looking for one of several interesting classes (VariadicMethodTypeChecker), in which the most common case is that there is no match. llvm-svn: 158318
* We were computing the visibility and linkage of template parameters, butRafael Espindola2012-06-111-4/+4
| | | | | | | | | only using the linkage. Use and test both, documenting that considering the visibility and linkage of template parameters is a difference from gcc. llvm-svn: 158309
* Add XOP shift and compare intrinsics.Craig Topper2012-06-111-4/+92
| | | | llvm-svn: 158300
* Documentation cleanup, fixing Doxygen markup. Mostly this avoids common termsJames Dennett2012-06-112-6/+6
| | | | | | | | | | | | | | such as "protocol" and "expression" being implicitly turned into links to mistakenly-generated Doxygen pages: - Escaping @ symbols when Doxygen would otherwise incorrectly interpret them; - Escaping # symbols when they're not intended as explicit Doxygen link requests, such as when discussing preprocessor directives; - In one odd case, unescaping @ in @__experimental_modules_import, because Doxygen wrote '\@' to the output in that case, causing the example in the description of ImportDecl to be wrong; and - Fixing a typo: @breif -> @brief. llvm-svn: 158299
* Const'ify CompilerInvocation::toArgs().Argyrios Kyrtzidis2012-06-111-1/+1
| | | | llvm-svn: 158298
* PR12964: __int128 and unsigned __int128 are promoted integral types, be sure toRichard Smith2012-06-101-17/+23
| | | | | | consider them when enumerating builtin operator candidates. llvm-svn: 158293
* Add XOP vprot* instruction intrinsicsCraig Topper2012-06-101-0/+40
| | | | llvm-svn: 158292
* Remove CXXRecordDecl flags which are unused after r158289.Richard Smith2012-06-105-108/+22
| | | | | | | | | | | | | | | | | | | | | We need an efficient mechanism to determine whether a defaulted default constructor is constexpr, in order to determine whether a class is a literal type, so keep the incrementally-built form on CXXRecordDecl. Remove the on-demand computation of same, so that we only have one method for determining whether a default constructor is constexpr. This doesn't affect correctness, since default constructor lookup is much simpler than selecting a constructor for copying or moving. We don't need a corresponding mechanism for defaulted copy or move constructors, since they can't affect whether a type is a literal type. Conversely, checking whether such functions are constexpr can require non-trivial effort, so we defer such checks until the copy or move constructor is required. Thus we now only compute whether a copy or move constructor is constexpr on demand, and only compute whether a default constructor is constexpr in advance. This is unfortunate, but seems like the best solution. llvm-svn: 158290
* Fix PR13052 properly, by performing special member lookup to determine whetherRichard Smith2012-06-101-15/+128
| | | | | | | | | | an explicitly-defaulted default constructor would be constexpr. This is necessary in weird (but well-formed) cases where a class has more than one copy or move constructor. Cleanup of now-unused parts of CXXRecordDecl to follow. llvm-svn: 158289
* PR13064: Store whether an in-class initializer uses direct or copyRichard Smith2012-06-1018-77/+84
| | | | | | | initialization, and use that information to produce the right kind of initialization during template instantiation. llvm-svn: 158288
* More XOP intrinsicsCraig Topper2012-06-101-0/+108
| | | | llvm-svn: 158287
* Begin adding XOP intrinsicsCraig Topper2012-06-103-1/+117
| | | | llvm-svn: 158286
* Add XOP feature flag.Craig Topper2012-06-091-8/+28
| | | | llvm-svn: 158284
* Replace a char counting helper function with std::count.Benjamin Kramer2012-06-091-12/+2
| | | | | | No functionality change. llvm-svn: 158272
* [C++11 Compat] Fix breaking change in C++11 pair copyctor.Michael J. Spencer2012-06-081-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | While this code is valid C++98, it is not valid C++11. The problem can be reduced to: class MDNode; class DIType { operator MDNode*() const {return 0;} }; class WeakVH { WeakVH(MDNode*) {} }; int main() { DIType di; std::pair<void*, WeakVH> p(std::make_pair((void*)0, di))); } This was not detected by any of the bots we have because they either compile C++98 with libstdc++ (which allows it), or C++11 with libc++ (which incorrectly allows it). I ran into the problem when compiling with VS 2012 RC. Thanks to Richard for explaining the issue. llvm-svn: 158245
* Correct method name in comment: from LexRawToken to LexFromRawLexer, accordingDmitri Gribenko2012-06-081-2/+2
| | | | | | to a change done long ago in r57393. llvm-svn: 158243
* Convert comments to proper Doxygen comments.Dmitri Gribenko2012-06-082-8/+8
| | | | llvm-svn: 158241
* Warn in ObjC++ when an 'auto' variable deduces type 'id'.Jordan Rose2012-06-081-0/+11
| | | | | | | | | | | | | | | | | | | | This could happen for cases like this: - (NSArray *)getAllNames:(NSArray *)images { NSMutableArray *results = [NSMutableArray array]; for (auto img in images) { [results addObject:img.name]; } return results; } Here the property access will fail because 'img' has type 'id', rather than, say, NSImage. This warning will not fire in templated code, since the 'id' could have come from a template parameter. llvm-svn: 158239
* PR13051: Only suggest the 'template' and 'operator' keywords when performingRichard Smith2012-06-081-2/+11
| | | | | | typo-correction after a scope specifier. llvm-svn: 158231
* Disallow using ObjC literals in direct comparisons (== and friends).Jordan Rose2012-06-081-0/+157
| | | | | | | | | | | | | | | Objective-C literals conceptually always create new objects, but may be optimized by the compiler or runtime (constant folding, singletons, etc). Comparing addresses of these objects is relying on this optimization behavior, which is really an implementation detail. In the case of == and !=, offer a fixit to a call to -isEqual:, if the method is available. This fixit is directly on the error so that it is automatically applied. Most of the time, this is really a newbie mistake, hence the fixit. llvm-svn: 158230
* If fixits appear to overlap, move the second one over in the output.Jordan Rose2012-06-081-6/+14
| | | | | | | | This occurs when you have two insertions and the first one is so long that the second fixit's column is before the first fixit ends. The edits themselves don't actually overlap, but our command-line preview does. llvm-svn: 158229
* PR13051: If a constructor is explicitly defaulted, it isn't marked as beingRichard Smith2012-06-082-0/+19
| | | | | | | | | | | | constexpr until we get to the end of the class definition. When that happens, be sure to remember that the class actually does have a constexpr constructor. This is a stopgap solution, which still doesn't cover the case of a class with multiple copy constructors (only some of which are constexpr). We should be performing constructor lookup when implicitly defining a constructor in order to determine whether all constructors it invokes are constexpr. llvm-svn: 158228
* Remove a commented out variable declaration. This was originally a debuggingRichard Trieu2012-06-081-1/+0
| | | | | | variable which wasn't removed when the original patch was committed. llvm-svn: 158225
* [analyzer] MallocSizeofChecker false positive: when sizeof is argumentAnna Zaks2012-06-081-5/+0
| | | | | | | | | | | | | | to addition. We should not to warn in case the malloc size argument is an addition containing 'sizeof' operator - it is common to use the pattern to pack values of different sizes into a buffer. Ex: uint8_t *buffer = (uint8_t*)malloc(dataSize + sizeof(length)); llvm-svn: 158219
* Disable _Pragma during HTML macro rewriting to keep from crashing.Jordan Rose2012-06-083-2/+12
| | | | | | | | | | | | | | | | | | | The preprocessor's handling of diagnostic push/pops is stateful, so encountering pragmas during a re-parse causes problems. HTMLRewrite already filters out normal # directives including #pragma, so it's clear it's not expected to be interpreting pragmas in this mode. This fix adds a flag to Preprocessor to explicitly disable pragmas. The "right" fix might be to separate pragma lexing from pragma parsing so that we can throw away pragmas like we do preprocessor directives, but right now it's important to get the fix in. Note that this has nothing to do with the "hack" of re-using the input preprocessor in HTMLRewrite. Even if we someday copy the preprocessor instead of re-using it, the copy would (and should) include the diagnostic level tables and have the same problems. llvm-svn: 158214
* Switch LineTableInfo to use FileID instead of int for file references,Douglas Gregor2012-06-083-11/+11
| | | | | | from Tom Honermann! llvm-svn: 158211
* [libclang] Don't crash when saving a PCH from a prefix headerArgyrios Kyrtzidis2012-06-082-4/+13
| | | | | | | | that does not exist. rdar://11607033 llvm-svn: 158193
* [libclang/AST]Argyrios Kyrtzidis2012-06-081-1/+1
| | | | | | | | | | | | | AST: For auto-synthesized ivars give them the location of the related property (previously they had no source location). This allows them to be indexed by libclang. libclang: Make sure synthesized ivars are indexed before the methods that may reference them. Fixes rdar://11607001. llvm-svn: 158189
* Allow friend declarations of defaulted special member functions. OnlyRichard Smith2012-06-081-1/+1
| | | | | | definitions of such members are prohibited, not mere declarations. llvm-svn: 158186
* Fix up the 'typename' suggestion logic introduced in r157085, based onKaelyn Uhrain2012-06-081-11/+9
| | | | | | feedback from Doug Gregor. llvm-svn: 158185
OpenPOWER on IntegriCloud