summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* When checking the encoding of an 8-bit string literal, don't just check theRichard Smith2012-03-085-19/+51
| | | | | | | first codepoint! Also, don't reject empty raw string literals for spurious "encoding" issues. Also, don't rely on undefined behavior in ConvertUTF.c. llvm-svn: 152344
* Turn explicit construction of temporaries using initializer list syntax into ↵Sebastian Redl2012-03-082-4/+26
| | | | | | CXXTemporaryObjectExprs, not just CXXConstructExprs, which have a worrying tendency to vanish. Fixes PR12167. llvm-svn: 152340
* Untangle getUnderlyingDeclImpl, no functionality change.Benjamin Kramer2012-03-081-9/+7
| | | | llvm-svn: 152339
* [utils/FuzzTest] Add '--stop-on-fail' to stop the script on the first failureArgyrios Kyrtzidis2012-03-081-1/+11
| | | | | | without reverting the changes. llvm-svn: 152333
* [AST] Clean up NamedDecl::getUnderlyingDecl() change a bit.Daniel Dunbar2012-03-081-3/+7
| | | | llvm-svn: 152332
* Remove stray semi-colon.Daniel Dunbar2012-03-081-1/+1
| | | | llvm-svn: 152331
* [AST] APValue: Split the fast path of MakeUninit to be inline.Daniel Dunbar2012-03-082-2/+6
| | | | | | | - This change seems to be a tiny loss on 403.gcc/combine.c (.2%), but I think it is the right thing to do. llvm-svn: 152330
* [utils/FuzzTest] The help message says that if you don't specify --max-testsArgyrios Kyrtzidis2012-03-081-1/+1
| | | | | | "the script will run forever continually picking new tests to run", make it so. llvm-svn: 152327
* [utils/FuzzTest] For --filelist the option type is string, not integer.Argyrios Kyrtzidis2012-03-081-1/+1
| | | | llvm-svn: 152324
* [Basic] PartialDiagnostic: Manual split out the cold part of freeStorage(), theDaniel Dunbar2012-03-081-0/+10
| | | | | | | hot path will typically profitably get inlined (based on what I see from the users of PartialDiagnostic). llvm-svn: 152322
* [AST] Change NamedDecl::getUnderlyingDecl() to inline the fast (and ↵Daniel Dunbar2012-03-082-2/+8
| | | | | | incredibly common) path. llvm-svn: 152321
* Replace MarkVarRequired with a more genericRafael Espindola2012-03-088-21/+22
| | | | | | HandleCXXStaticMemberVarInstantiation. Suggested by Argyrios. llvm-svn: 152320
* Also test pr12104 with pch.Rafael Espindola2012-03-082-10/+12
| | | | llvm-svn: 152317
* Implement -fno-dwarf2-cfi-asm on linux too.Rafael Espindola2012-03-082-10/+42
| | | | llvm-svn: 152316
* Ensure we don't print 123ULL_foo when printing a user-defined integer literal.Richard Smith2012-03-082-1/+16
| | | | llvm-svn: 152303
* Add support for cooked forms of user-defined-integer-literal andRichard Smith2012-03-088-60/+164
| | | | | | | user-defined-floating-literal. Support for raw forms of these literals to follow. llvm-svn: 152302
* Taken into account Duncan's comments for r149481 dated by 2nd Feb 2012:Stepan Dyatkovskiy2012-03-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120130/136146.html Implemented CaseIterator and it solves almost all described issues: we don't need to mix operand/case/successor indexing anymore. Base iterator class is implemented as a template since it may be initialized either from "const SwitchInst*" or from "SwitchInst*". ConstCaseIt is just a read-only iterator. CaseIt is read-write iterator; it allows to change case successor and case value. Usage of iterator allows totally remove resolveXXXX methods. All indexing convertions done automatically inside the iterator's getters. Main way of iterator usage looks like this: SwitchInst *SI = ... // intialize it somehow for (SwitchInst::CaseIt i = SI->caseBegin(), e = SI->caseEnd(); i != e; ++i) { BasicBlock *BB = i.getCaseSuccessor(); ConstantInt *V = i.getCaseValue(); // Do something. } If you want to convert case number to TerminatorInst successor index, just use getSuccessorIndex iterator's method. If you want initialize iterator from TerminatorInst successor index, use CaseIt::fromSuccessorIndex(...) method. There are also related changes in llvm-clients: klee and clang. llvm-svn: 152298
* [AST] Change Type::isIntegerType to be inlined(). It is very popular.Daniel Dunbar2012-03-083-11/+22
| | | | llvm-svn: 152289
* Implement C++11 [lex.ext]p10 for string and character literals: a ud-suffix notRichard Smith2012-03-0812-45/+67
| | | | | | | | | | | | | | | | | | starting with an underscore is ill-formed. Since this rule rejects programs that were using <inttypes.h>'s macros, recover from this error by treating the ud-suffix as a separate preprocessing-token, with a DefaultError ExtWarn. The approach of treating such cases as two tokens is under discussion for standardization, but is in any case a conforming extension and allows existing codebases to keep building while the committee makes up its mind. Reword the warning on the definition of literal operators not starting with underscores (which are, strangely, legal) to more explicitly state that such operators can't be called by literals. Remove the special-case diagnostic for hexfloats, since it was both triggering in the wrong cases and incorrect. llvm-svn: 152287
* Loosen the precondition of isCXXInstanceMember() to simply returnDouglas Gregor2012-03-083-5/+15
| | | | | | "false" for declarations that aren't members of classes. Fixes PR12106. llvm-svn: 152284
* Spelling.Daniel Dunbar2012-03-081-1/+1
| | | | llvm-svn: 152281
* Sema: Don't emit a gajillion calls to sanity() -- an empty function -- in NDEBUGDaniel Dunbar2012-03-082-2/+10
| | | | | | builds. Sheesh. llvm-svn: 152279
* User-defined literal support for character literals.Richard Smith2012-03-085-6/+76
| | | | llvm-svn: 152277
* Fix -Wuninitialized to catch the case of a class being initialized with a callRichard Trieu2012-03-082-1/+4
| | | | | | to its own member function. llvm-svn: 152276
* [libclang] Fix a crash when serializing a preprocessing record that containsArgyrios Kyrtzidis2012-03-083-8/+12
| | | | | | | | an #include entry that did not resolve to header file. Part of rdar://11007039 llvm-svn: 152275
* Streamline BalancedDelimiterTracker, by eliminating the duplicateDouglas Gregor2012-03-086-119/+89
| | | | | | | | paren/brace/bracket tracking (the Consume* functions already did it), removing the use of ConsumeAnyToken(), and moving the hot paths inline with the error paths out-of-line. llvm-svn: 152274
* improve on diagnostic when block captures uninitializedFariborz Jahanian2012-03-082-2/+2
| | | | | | block variable. // rdar://10817031 llvm-svn: 152273
* Add a basic CallGraph to Analysis.Anna Zaks2012-03-086-0/+494
| | | | | | | | | | The final graph contains a single root node, which is a parent of all externally available functions(and 'main'). As well as a list of Parentless/Unreachable functions, which are either truly unreachable or are unreachable due to our analyses imprecision. The analyzer checkers debug.DumpCallGraph or debug.ViewGraph can be used to look at the produced graph. Currently, the graph is not very precise, for example, it entirely skips edges resulted from ObjC method calls. llvm-svn: 152272
* improve on diagnostic and provide a fixit hint whenFariborz Jahanian2012-03-083-7/+36
| | | | | | | an uninitialized block variable is being called inside the block literal. // rdar://10817031 llvm-svn: 152271
* [libclang] Enhance clang_getOverriddenCursors.Argyrios Kyrtzidis2012-03-087-42/+79
| | | | | | | | | | | | | | | | | | | | | | | | Basically the current design is: -for an implementation method, show as overridden the interface method. This is not useful, and is inconsistent with the C++ side -for an interface method, show as overridden the protocols methods (this is desirable) and the methods from the categories; methods from categories are not useful since they are considered the same method (same USR). -If there is a protocol method or category method reported, it does not check the super class for overridden methods. This is really problematic since overridden methods from super class is what we want to give back. Change clang_getOverriddenCursors to show as overridden any method in the class's base class, its protocols, or its categories' protocols, that has the same selector and is of the same kind (class or instance). If no such method exists, the search continues to the class's superclass, its protocols, and its categories, and so on. A method from an Objective-C implementation is considered to override the same methods as its corresponding method in the interface. rdar://10967206 llvm-svn: 152270
* Workaround module test failures by removing the version info from module hashes.Bob Wilson2012-03-071-1/+4
| | | | | | | | | | PR12196: The module hash strings are not actually hashing the compiler version string; the entire version string is being included in the hash. Depending on the module cache directory name, that can lead to failures where the path names become too long. As a temporary workaround, just remove the version string from the hash. llvm-svn: 152266
* Remove unnecessary include in ExprObjC.hRichard Trieu2012-03-071-1/+0
| | | | llvm-svn: 152239
* Be smarter in discovering list-initialization of temporaries. Fixes PR12182.Sebastian Redl2012-03-072-1/+9
| | | | llvm-svn: 152231
* Correct the documentation to give a legal example of a raw string literal.Richard Smith2012-03-071-1/+2
| | | | llvm-svn: 152216
* AST representation for user-defined literals, plus just enough of semanticRichard Smith2012-03-0729-23/+385
| | | | | | | | | | | | | | | | | | | | | analysis to make the AST representation testable. They are represented by a new UserDefinedLiteral AST node, which is a sugared CallExpr. All semantic properties, including full CodeGen support, are achieved for free by this representation. UserDefinedLiterals can never be dependent, so no custom instantiation behavior is required. They are mangled as if they were direct calls to the underlying literal operator. This matches g++'s apparent behavior (but not its actual mangling, which is broken for literal-operator-ids). User-defined *string* literals are now fully-operational, but the semantic analysis is quite hacky and needs more work. No other forms of user-defined literal are created yet, but the AST support for them is present. This patch committed after midnight because we had already hit the quota for new kinds of literal yesterday. llvm-svn: 152211
* Test fix-it added in r152198.Richard Smith2012-03-071-0/+9
| | | | llvm-svn: 152199
* Add -Wc++11-compat warning for string and character literals followed byRichard Smith2012-03-073-5/+25
| | | | | | | identifiers, in cases where those identifiers would be treated as user-defined literal suffixes in C++11. llvm-svn: 152198
* Don't even try to directly emit the value of a DeclRefExpr if that declarationRichard Smith2012-03-072-3/+12
| | | | | | is not usable in a constant expression. ~2.5% speedup on 403.gcc / combine.c. llvm-svn: 152193
* [PCH] Mark a PCH file with a flag to indicate if the serialized AST hadArgyrios Kyrtzidis2012-03-0715-26/+97
| | | | | | | | | | | | | | | | compiler errors or not. -Control whether ASTReader should reject such a PCH by a boolean flag at ASTReader's creation time. By default, such a PCH file will be rejected with an error when trying to load it. [libclang] Allow clang_saveTranslationUnit to create a PCH file even if compiler errors occurred. -Have libclang API calls accept a PCH that had compiler errors. The general idea is that we want libclang to stay functional even if a PCH had a compiler error. rdar://10976363. llvm-svn: 152192
* Correct test from r152189.Eli Friedman2012-03-071-1/+1
| | | | llvm-svn: 152191
* Make sure we consistently canonicalize types when canonicalizing ↵Eli Friedman2012-03-072-3/+11
| | | | | | TemplateTemplateParmDecls. PR12179. llvm-svn: 152189
* objective-c lldb support: don't perform ivar access control check Fariborz Jahanian2012-03-073-10/+82
| | | | | | when debugging. // rdar://10997647 llvm-svn: 152187
* More git-svn compatible version string, by request.Andrew Trick2012-03-071-11/+18
| | | | | | | | | | | | | | | | | If you're using git-svn, the clang and llvm repository will typically map to a different revision. Before we had: clang version 3.1 (trunk 152167 trunk 152162) After this change: clang version 3.1 (trunk 152167) (llvm/trunk 152162) So it's self-descriptive with an extra parens group. Which is more compatible with version string parsers is probably debatable, but this style was requested. llvm-svn: 152183
* The constant folder's diagnosic mechanism is irrelevant for C; don't botherRichard Smith2012-03-071-4/+0
| | | | | | producing a C-only diagnostic. llvm-svn: 152181
* [driver] Don't try to generate diagnostic information for linker crashes.Chad Rosier2012-03-073-0/+17
| | | | | | rdar://10993648 llvm-svn: 152180
* Silence unused variable warnings.Benjamin Kramer2012-03-071-3/+3
| | | | llvm-svn: 152170
* Refactor Clang sema attribute handling.Michael Han2012-03-0711-250/+202
| | | | | | | | | | | | | | | | | This submission improves Clang sema handling by using Clang tablegen to generate common boilerplate code. As a start, it implements AttributeList enumerator generation and case statements for AttributeList::getKind. A new field "SemaHandler" is introduced in Attr.td and by default set to 1 as most of attributes in Attr.td have semantic checking in Sema. For a small number of attributes that don't appear in Sema, the value is set to 0. Also there are a small number of attributes that only appear in Sema but not in Attr.td. Currently these attributes are still hardcoded in Sema AttributeList. Reviewed by Delesley Hutchins. llvm-svn: 152169
* AST: fix build since r152060Dylan Noblesmith2012-03-072-6/+7
| | | | | | | | | | | | The declarations of the operators no longer matched. The definitions in ASTContext.h had 'throw()' removed, but it was still present in Attr.h. Somehow the buildbots missed this. clang merely warns about a missing 'throw()' specification and suggested a Fix-It adding it back, but gcc 4.5 is not so forgiving and gives an error. llvm-svn: 152167
* [AST] VarDecl::hasDefinition() - Early exit if we find a strong definition.Daniel Dunbar2012-03-061-1/+4
| | | | llvm-svn: 152166
* [AST] FunctionDecl::getBuiltinID() - Eliminate spurious calls to getASTContextDaniel Dunbar2012-03-061-2/+5
| | | | | | -- which is very much not free -- in the common case. llvm-svn: 152165
OpenPOWER on IntegriCloud