[llvm-branch-commits] [cfe-branch] r156839 - in /cfe/branches/tooling: ./ bindings/python/clang/ bindings/python/tests/cindex/ docs/ include/clang/AST/ include/clang/Basic/ include/clang/Driver/ include/clang/Frontend/ include/clang/Lex/ include/clang/Parse/ include/clang/Sema/ include/clang/Tooling/ lib/AST/ lib/Analysis/ lib/Basic/ lib/CodeGen/ lib/Driver/ lib/Edit/ lib/Frontend/ lib/Lex/ lib/Parse/ lib/Rewrite/ lib/Sema/ lib/Serialization/ lib/StaticAnalyzer/Checkers/ lib/StaticAnalyzer/Core/ lib/StaticAnalyzer/Frontend/ l...
Manuel Klimek
klimek at google.com
Tue May 15 11:51:10 PDT 2012
Author: klimek
Date: Tue May 15 13:51:08 2012
New Revision: 156839
URL: http://llvm.org/viewvc/llvm-project?rev=156839&view=rev
Log:
Merging mainline.
Added:
cfe/branches/tooling/include/clang/Tooling/ArgumentsAdjusters.h
- copied unchanged from r156833, cfe/trunk/include/clang/Tooling/ArgumentsAdjusters.h
cfe/branches/tooling/lib/Tooling/ArgumentsAdjusters.cpp
- copied unchanged from r156833, cfe/trunk/lib/Tooling/ArgumentsAdjusters.cpp
cfe/branches/tooling/test/Analysis/misc-ps-arm.m
- copied unchanged from r156833, cfe/trunk/test/Analysis/misc-ps-arm.m
cfe/branches/tooling/test/Analysis/objc-boxing.m
- copied unchanged from r156833, cfe/trunk/test/Analysis/objc-boxing.m
cfe/branches/tooling/test/Analysis/region-store.c
- copied unchanged from r156833, cfe/trunk/test/Analysis/region-store.c
cfe/branches/tooling/test/Analysis/templates.cpp
- copied unchanged from r156833, cfe/trunk/test/Analysis/templates.cpp
cfe/branches/tooling/test/Analysis/test-variably-modified-types.c
- copied unchanged from r156833, cfe/trunk/test/Analysis/test-variably-modified-types.c
cfe/branches/tooling/test/CXX/dcl.decl/dcl.meaning/dcl.fct/dcl.fct.def.default/p1.cpp
- copied unchanged from r156833, cfe/trunk/test/CXX/dcl.decl/dcl.meaning/dcl.fct/dcl.fct.def.default/p1.cpp
cfe/branches/tooling/test/CodeGen/attr-coldhot.c
- copied unchanged from r156833, cfe/trunk/test/CodeGen/attr-coldhot.c
cfe/branches/tooling/test/CodeGen/bounds-checking.c
- copied unchanged from r156833, cfe/trunk/test/CodeGen/bounds-checking.c
cfe/branches/tooling/test/CodeGen/debug-info-vla.c
- copied unchanged from r156833, cfe/trunk/test/CodeGen/debug-info-vla.c
cfe/branches/tooling/test/CodeGen/mips-byval-arg.c
- copied unchanged from r156833, cfe/trunk/test/CodeGen/mips-byval-arg.c
cfe/branches/tooling/test/CodeGen/mips-vector-return.c
- copied unchanged from r156833, cfe/trunk/test/CodeGen/mips-vector-return.c
cfe/branches/tooling/test/CodeGenCXX/cxx11-initializer-aggregate.cpp
- copied unchanged from r156833, cfe/trunk/test/CodeGenCXX/cxx11-initializer-aggregate.cpp
cfe/branches/tooling/test/CodeGenObjC/boxing.m
- copied unchanged from r156833, cfe/trunk/test/CodeGenObjC/boxing.m
cfe/branches/tooling/test/Driver/bounds-checking.c
- copied unchanged from r156833, cfe/trunk/test/Driver/bounds-checking.c
cfe/branches/tooling/test/Driver/nodefaultlib.c
- copied unchanged from r156833, cfe/trunk/test/Driver/nodefaultlib.c
cfe/branches/tooling/test/Driver/target-triple-deployment.c
- copied unchanged from r156833, cfe/trunk/test/Driver/target-triple-deployment.c
cfe/branches/tooling/test/FixIt/fixit-interface-as-param.m
- copied unchanged from r156833, cfe/trunk/test/FixIt/fixit-interface-as-param.m
cfe/branches/tooling/test/Index/boxed-exprs.h
- copied unchanged from r156833, cfe/trunk/test/Index/boxed-exprs.h
cfe/branches/tooling/test/Index/boxed-exprs.m
- copied unchanged from r156833, cfe/trunk/test/Index/boxed-exprs.m
cfe/branches/tooling/test/Misc/serialized-diags-frontend.c
- copied unchanged from r156833, cfe/trunk/test/Misc/serialized-diags-frontend.c
cfe/branches/tooling/test/PCH/format-strings.c
- copied unchanged from r156833, cfe/trunk/test/PCH/format-strings.c
cfe/branches/tooling/test/Rewriter/objc-modern-getclass-proto.mm
- copied unchanged from r156833, cfe/trunk/test/Rewriter/objc-modern-getclass-proto.mm
cfe/branches/tooling/test/Rewriter/rewrite-modern-default-property-synthesis.mm
- copied unchanged from r156833, cfe/trunk/test/Rewriter/rewrite-modern-default-property-synthesis.mm
cfe/branches/tooling/test/Sema/attr-coldhot.c
- copied unchanged from r156833, cfe/trunk/test/Sema/attr-coldhot.c
cfe/branches/tooling/test/SemaObjC/no-ivar-in-interface-block.m
- copied unchanged from r156833, cfe/trunk/test/SemaObjC/no-ivar-in-interface-block.m
cfe/branches/tooling/test/Tooling/multi-jobs.cpp
- copied unchanged from r156833, cfe/trunk/test/Tooling/multi-jobs.cpp
cfe/branches/tooling/tools/scan-build/scan-build.1
- copied unchanged from r156833, cfe/trunk/tools/scan-build/scan-build.1
Modified:
cfe/branches/tooling/ (props changed)
cfe/branches/tooling/bindings/python/clang/cindex.py
cfe/branches/tooling/bindings/python/tests/cindex/test_cursor.py
cfe/branches/tooling/docs/ReleaseNotes.html
cfe/branches/tooling/docs/Tooling.html
cfe/branches/tooling/include/clang/AST/DeclObjC.h
cfe/branches/tooling/include/clang/AST/NSAPI.h
cfe/branches/tooling/include/clang/AST/RecursiveASTVisitor.h
cfe/branches/tooling/include/clang/AST/Type.h
cfe/branches/tooling/include/clang/AST/TypeLoc.h
cfe/branches/tooling/include/clang/Basic/Attr.td
cfe/branches/tooling/include/clang/Basic/Builtins.def
cfe/branches/tooling/include/clang/Basic/BuiltinsHexagon.def
cfe/branches/tooling/include/clang/Basic/DiagnosticGroups.td
cfe/branches/tooling/include/clang/Basic/DiagnosticSemaKinds.td
cfe/branches/tooling/include/clang/Basic/LangOptions.def
cfe/branches/tooling/include/clang/Basic/arm_neon.td
cfe/branches/tooling/include/clang/Driver/Options.td
cfe/branches/tooling/include/clang/Frontend/DiagnosticRenderer.h
cfe/branches/tooling/include/clang/Frontend/TextDiagnostic.h
cfe/branches/tooling/include/clang/Frontend/TextDiagnosticPrinter.h
cfe/branches/tooling/include/clang/Lex/Preprocessor.h
cfe/branches/tooling/include/clang/Parse/Parser.h
cfe/branches/tooling/include/clang/Sema/Sema.h
cfe/branches/tooling/include/clang/Tooling/Tooling.h
cfe/branches/tooling/lib/AST/Decl.cpp
cfe/branches/tooling/lib/AST/Expr.cpp
cfe/branches/tooling/lib/AST/ItaniumMangle.cpp
cfe/branches/tooling/lib/AST/NSAPI.cpp
cfe/branches/tooling/lib/AST/StmtDumper.cpp
cfe/branches/tooling/lib/AST/Type.cpp
cfe/branches/tooling/lib/Analysis/FormatString.cpp
cfe/branches/tooling/lib/Basic/Targets.cpp
cfe/branches/tooling/lib/CodeGen/CGBuiltin.cpp
cfe/branches/tooling/lib/CodeGen/CGDebugInfo.cpp
cfe/branches/tooling/lib/CodeGen/CGExpr.cpp
cfe/branches/tooling/lib/CodeGen/CodeGenFunction.cpp
cfe/branches/tooling/lib/CodeGen/CodeGenFunction.h
cfe/branches/tooling/lib/CodeGen/CodeGenModule.cpp
cfe/branches/tooling/lib/CodeGen/TargetInfo.cpp
cfe/branches/tooling/lib/Driver/ToolChains.cpp
cfe/branches/tooling/lib/Driver/ToolChains.h
cfe/branches/tooling/lib/Driver/Tools.cpp
cfe/branches/tooling/lib/Edit/EditedSource.cpp
cfe/branches/tooling/lib/Edit/RewriteObjCFoundationAPI.cpp
cfe/branches/tooling/lib/Frontend/CompilerInstance.cpp
cfe/branches/tooling/lib/Frontend/CompilerInvocation.cpp
cfe/branches/tooling/lib/Frontend/DiagnosticRenderer.cpp
cfe/branches/tooling/lib/Frontend/SerializedDiagnosticPrinter.cpp
cfe/branches/tooling/lib/Frontend/TextDiagnostic.cpp
cfe/branches/tooling/lib/Frontend/TextDiagnosticPrinter.cpp
cfe/branches/tooling/lib/Lex/PPMacroExpansion.cpp
cfe/branches/tooling/lib/Parse/ParseDecl.cpp
cfe/branches/tooling/lib/Parse/ParseDeclCXX.cpp
cfe/branches/tooling/lib/Parse/ParseObjc.cpp
cfe/branches/tooling/lib/Parse/Parser.cpp
cfe/branches/tooling/lib/Rewrite/RewriteModernObjC.cpp
cfe/branches/tooling/lib/Sema/AnalysisBasedWarnings.cpp
cfe/branches/tooling/lib/Sema/SemaChecking.cpp
cfe/branches/tooling/lib/Sema/SemaDecl.cpp
cfe/branches/tooling/lib/Sema/SemaDeclAttr.cpp
cfe/branches/tooling/lib/Sema/SemaDeclCXX.cpp
cfe/branches/tooling/lib/Sema/SemaDeclObjC.cpp
cfe/branches/tooling/lib/Sema/SemaExpr.cpp
cfe/branches/tooling/lib/Sema/SemaExprCXX.cpp
cfe/branches/tooling/lib/Sema/SemaExprObjC.cpp
cfe/branches/tooling/lib/Sema/SemaObjCProperty.cpp
cfe/branches/tooling/lib/Sema/SemaOverload.cpp
cfe/branches/tooling/lib/Sema/SemaStmt.cpp
cfe/branches/tooling/lib/Sema/SemaTemplate.cpp
cfe/branches/tooling/lib/Sema/SemaTemplateInstantiateDecl.cpp
cfe/branches/tooling/lib/Sema/SemaType.cpp
cfe/branches/tooling/lib/Sema/TargetAttributesSema.cpp
cfe/branches/tooling/lib/Sema/TreeTransform.h
cfe/branches/tooling/lib/Serialization/ASTReaderDecl.cpp
cfe/branches/tooling/lib/Serialization/ASTWriterDecl.cpp
cfe/branches/tooling/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
cfe/branches/tooling/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
cfe/branches/tooling/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp
cfe/branches/tooling/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
cfe/branches/tooling/lib/StaticAnalyzer/Core/ExprEngine.cpp
cfe/branches/tooling/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
cfe/branches/tooling/lib/StaticAnalyzer/Core/ObjCMessage.cpp
cfe/branches/tooling/lib/StaticAnalyzer/Core/RegionStore.cpp
cfe/branches/tooling/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp
cfe/branches/tooling/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
cfe/branches/tooling/lib/Tooling/CMakeLists.txt
cfe/branches/tooling/lib/Tooling/CompilationDatabase.cpp
cfe/branches/tooling/lib/Tooling/Tooling.cpp
cfe/branches/tooling/test/ARCMT/objcmt-numeric-literals.m
cfe/branches/tooling/test/ARCMT/objcmt-numeric-literals.m.result
cfe/branches/tooling/test/ARCMT/objcmt-subscripting-literals.m
cfe/branches/tooling/test/ARCMT/objcmt-subscripting-literals.m.result
cfe/branches/tooling/test/Analysis/array-struct-region.c
cfe/branches/tooling/test/Analysis/casts.c
cfe/branches/tooling/test/Analysis/malloc-plist.c
cfe/branches/tooling/test/Analysis/outofbound.c
cfe/branches/tooling/test/Analysis/retain-release-path-notes.m
cfe/branches/tooling/test/Analysis/retain-release.m
cfe/branches/tooling/test/Analysis/self-init.m
cfe/branches/tooling/test/Analysis/string.c
cfe/branches/tooling/test/Analysis/taint-tester.c
cfe/branches/tooling/test/CXX/class/p6-0x.cpp
cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.simple/p5-cxx0x.cpp
cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.typedef/p2-0x.cpp
cfe/branches/tooling/test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.default/p2.cpp
cfe/branches/tooling/test/CXX/dcl.decl/dcl.init/dcl.init.aggr/p1-0x.cpp
cfe/branches/tooling/test/CXX/dcl.decl/dcl.meaning/dcl.fct/dcl.fct.def.default/p2.cpp
cfe/branches/tooling/test/CXX/dcl.decl/dcl.meaning/dcl.fct/p9-0x.cpp
cfe/branches/tooling/test/CXX/expr/expr.unary/expr.unary.op/p6.cpp
cfe/branches/tooling/test/CXX/special/class.copy/p15-inclass.cpp
cfe/branches/tooling/test/CXX/temp/temp.spec/p5.cpp
cfe/branches/tooling/test/CXX/temp/temp.spec/temp.expl.spec/p14.cpp
cfe/branches/tooling/test/CXX/temp/temp.spec/temp.explicit/p9-linkage.cpp
cfe/branches/tooling/test/CodeGen/2005-07-20-SqrtNoErrno.c
cfe/branches/tooling/test/CodeGen/2007-02-25-C-DotDotDot.c
cfe/branches/tooling/test/CodeGen/2008-03-05-syncPtr.c
cfe/branches/tooling/test/CodeGen/2008-04-08-NoExceptions.c
cfe/branches/tooling/test/CodeGen/2009-09-24-SqrtErrno.c
cfe/branches/tooling/test/CodeGen/Atomics.c
cfe/branches/tooling/test/CodeGen/address-space.c
cfe/branches/tooling/test/CodeGen/attributes.c
cfe/branches/tooling/test/CodeGen/compound-literal.c
cfe/branches/tooling/test/CodeGen/func-aligned.c
cfe/branches/tooling/test/CodeGen/func-return-member.c
cfe/branches/tooling/test/CodeGen/incomplete-function-type.c
cfe/branches/tooling/test/CodeGen/integer-overflow.c
cfe/branches/tooling/test/CodeGen/mips64-class-return.cpp
cfe/branches/tooling/test/CodeGen/object-size.c
cfe/branches/tooling/test/CodeGen/pr12251.c
cfe/branches/tooling/test/CodeGen/pragma-visibility.c
cfe/branches/tooling/test/CodeGenCXX/cxx0x-initializer-references.cpp
cfe/branches/tooling/test/CodeGenCXX/mangle-ref-qualifiers.cpp
cfe/branches/tooling/test/CodeGenCXX/virtual-destructor-calls.cpp
cfe/branches/tooling/test/CodeGenCXX/visibility.cpp
cfe/branches/tooling/test/CodeGenObjC/objc-literal-debugger-test.m
cfe/branches/tooling/test/Index/complete-with-annotations.cpp
cfe/branches/tooling/test/Index/overrides.m
cfe/branches/tooling/test/PCH/exprs.h
cfe/branches/tooling/test/Parser/MicrosoftExtensions.cpp
cfe/branches/tooling/test/Parser/altivec.c
cfe/branches/tooling/test/Parser/cxx-throw.cpp
cfe/branches/tooling/test/Parser/cxx11-type-specifier.cpp
cfe/branches/tooling/test/Preprocessor/mmx.c
cfe/branches/tooling/test/Preprocessor/pp-record.c
cfe/branches/tooling/test/Preprocessor/predefined-arch-macros.c
cfe/branches/tooling/test/Rewriter/objc-modern-boxing.mm
cfe/branches/tooling/test/Sema/array-bounds-ptr-arith.c
cfe/branches/tooling/test/Sema/array-init.c
cfe/branches/tooling/test/Sema/attr-aligned.c
cfe/branches/tooling/test/Sema/attr-section.c
cfe/branches/tooling/test/Sema/attr-visibility.c
cfe/branches/tooling/test/Sema/dllimport-dllexport.c
cfe/branches/tooling/test/Sema/exprs.c
cfe/branches/tooling/test/Sema/format-strings.c
cfe/branches/tooling/test/Sema/implicit-builtin-decl.c
cfe/branches/tooling/test/Sema/knr-def-call.c
cfe/branches/tooling/test/SemaCXX/PR10243.cpp
cfe/branches/tooling/test/SemaCXX/altivec.cpp
cfe/branches/tooling/test/SemaCXX/bool.cpp
cfe/branches/tooling/test/SemaCXX/constant-expression-cxx11.cpp
cfe/branches/tooling/test/SemaCXX/conversion.cpp
cfe/branches/tooling/test/SemaCXX/cxx0x-cursory-default-delete.cpp
cfe/branches/tooling/test/SemaCXX/cxx0x-defaulted-functions.cpp
cfe/branches/tooling/test/SemaCXX/default1.cpp
cfe/branches/tooling/test/SemaCXX/expressions.cpp
cfe/branches/tooling/test/SemaCXX/member-init.cpp
cfe/branches/tooling/test/SemaCXX/overload-call.cpp
cfe/branches/tooling/test/SemaCXX/overload-member-call.cpp
cfe/branches/tooling/test/SemaCXX/uninitialized.cpp
cfe/branches/tooling/test/SemaCXX/warn-literal-conversion.cpp
cfe/branches/tooling/test/SemaCXX/warn-unreachable.cpp (props changed)
cfe/branches/tooling/test/SemaObjC/arc-property.m
cfe/branches/tooling/test/SemaObjC/boxing-illegal-types.m
cfe/branches/tooling/test/SemaObjC/id.m
cfe/branches/tooling/test/SemaObjC/objc-literal-nsnumber.m
cfe/branches/tooling/test/SemaObjC/objc-literal-sig.m
cfe/branches/tooling/test/SemaObjC/property-ivar-mismatch.m
cfe/branches/tooling/test/SemaTemplate/dependent-base-classes.cpp
cfe/branches/tooling/test/SemaTemplate/member-template-access-expr.cpp
cfe/branches/tooling/test/SemaTemplate/overload-candidates.cpp
cfe/branches/tooling/tools/driver/cc1as_main.cpp
cfe/branches/tooling/tools/libclang/CIndexDiagnostic.cpp
cfe/branches/tooling/tools/libclang/CMakeLists.txt
cfe/branches/tooling/tools/libclang/CXCursor.cpp
cfe/branches/tooling/unittests/Tooling/CompilationDatabaseTest.cpp
cfe/branches/tooling/unittests/Tooling/RecursiveASTVisitorTest.cpp
cfe/branches/tooling/utils/TableGen/ClangAttrEmitter.cpp
cfe/branches/tooling/utils/TableGen/NeonEmitter.cpp
cfe/branches/tooling/utils/TableGen/NeonEmitter.h
cfe/branches/tooling/www/analyzer/available_checks.html
cfe/branches/tooling/www/analyzer/latest_checker.html.incl
cfe/branches/tooling/www/analyzer/release_notes.html
Propchange: cfe/branches/tooling/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue May 15 13:51:08 2012
@@ -1,3 +1,3 @@
/cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:146581-156373
+/cfe/trunk:146581-156833
/cfe/trunk/test/SemaTemplate:126920
Modified: cfe/branches/tooling/bindings/python/clang/cindex.py
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/bindings/python/clang/cindex.py?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/bindings/python/clang/cindex.py (original)
+++ cfe/branches/tooling/bindings/python/clang/cindex.py Tue May 15 13:51:08 2012
@@ -126,7 +126,7 @@
"value supported." % enumeration)
self.save_error = enumeration
- Exception.__init__(self, message)
+ Exception.__init__(self, 'Error %d: %s' % (enumeration, message))
### Structures and Utility Classes ###
@@ -1024,6 +1024,28 @@
return self._type
@property
+ def canonical(self):
+ """Return the canonical Cursor corresponding to this Cursor.
+
+ The canonical cursor is the cursor which is representative for the
+ underlying entity. For example, if you have multiple forward
+ declarations for the same class, the canonical cursor for the forward
+ declarations will be identical.
+ """
+ if not hasattr(self, '_canonical'):
+ self._canonical = Cursor_canonical(self)
+
+ return self._canonical
+
+ @property
+ def result_type(self):
+ """Retrieve the Type of the result for this Cursor."""
+ if not hasattr(self, '_result_type'):
+ self._result_type = Type_get_result(self.type)
+
+ return self._result_type
+
+ @property
def underlying_typedef_type(self):
"""Return the underlying type of a typedef declaration.
@@ -1739,6 +1761,9 @@
options is a bitwise or of TranslationUnit.PARSE_XXX flags which will
control parsing behavior.
+ index is an Index instance to utilize. If not provided, a new Index
+ will be created for this TranslationUnit.
+
To parse source from the filesystem, the filename of the file to parse
is specified by the filename argument. Or, filename could be None and
the args list would contain the filename(s) to parse.
@@ -1925,7 +1950,7 @@
raise TranslationUnitSaveError(result,
'Error saving TranslationUnit.')
- def codeComplete(self, path, line, column, unsaved_files=[], options=0):
+ def codeComplete(self, path, line, column, unsaved_files=None, options=0):
"""
Code complete in this translation unit.
@@ -2139,6 +2164,11 @@
Cursor_ref.restype = Cursor
Cursor_ref.errcheck = Cursor.from_result
+Cursor_canonical = lib.clang_getCanonicalCursor
+Cursor_canonical.argtypes = [Cursor]
+Cursor_canonical.restype = Cursor
+Cursor_canonical.errcheck = Cursor.from_result
+
Cursor_type = lib.clang_getCursorType
Cursor_type.argtypes = [Cursor]
Cursor_type.restype = Type
Modified: cfe/branches/tooling/bindings/python/tests/cindex/test_cursor.py
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/bindings/python/tests/cindex/test_cursor.py?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/bindings/python/tests/cindex/test_cursor.py (original)
+++ cfe/branches/tooling/bindings/python/tests/cindex/test_cursor.py Tue May 15 13:51:08 2012
@@ -67,6 +67,18 @@
assert tu_nodes[2].displayname == 'f0(int, int)'
assert tu_nodes[2].is_definition() == True
+def test_canonical():
+ source = 'struct X; struct X; struct X { int member; };'
+ tu = get_tu(source)
+
+ cursors = []
+ for cursor in tu.cursor.get_children():
+ if cursor.spelling == 'X':
+ cursors.append(cursor)
+
+ assert len(cursors) == 3
+ assert cursors[1].canonical == cursors[2].canonical
+
def test_underlying_type():
tu = get_tu('typedef int foo;')
typedef = get_cursor(tu, 'foo')
@@ -172,3 +184,11 @@
break
else:
assert False, "Couldn't find annotation"
+
+def test_result_type():
+ tu = get_tu('int foo();')
+ foo = get_cursor(tu, 'foo')
+
+ assert foo is not None
+ t = foo.result_type
+ assert t.kind == TypeKind.INT
Modified: cfe/branches/tooling/docs/ReleaseNotes.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/docs/ReleaseNotes.html?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/docs/ReleaseNotes.html (original)
+++ cfe/branches/tooling/docs/ReleaseNotes.html Tue May 15 13:51:08 2012
@@ -31,6 +31,7 @@
<li><a href="#cxxchanges">C++ Language Changes</a></li>
<li><a href="#objcchanges">Objective-C Language Changes</a></li>
<li><a href="#apichanges">Internal API Changes</a></li>
+ <li><a href="#pythonchanges">Python Binding Changes</a></li>
</ul>
</li>
<li><a href="#knownproblems">Known Problems</a></li>
@@ -111,7 +112,12 @@
<p>All warning and language selection flags which previously accepted
<code>c1x</code> have been updated to accept <code>c11</code>. The old
-<code>c1x</code> forms have been removed.
+<code>c1x</code> forms have been removed.</p>
+
+<p>Clang 3.1 adds a family of <code>__c11_atomic</code> builtins corresponding
+ directly to the <code>_explict</code> versions of the C11 atomic functions.
+ This means that C11's <code><stdatomic.h></code> can be implemented in
+ a small set of trivial macros. </p>
<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -->
<h3 id="cxxchanges">C++ Language Changes in Clang</h3>
@@ -156,6 +162,40 @@
<h4 id="api1">API change 1</h4>
...
+<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -->
+<h3 id="pythonchanges">Python Binding Changes</h3>
+<!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -->
+
+The following methods have been added:
+<ul>
+ <li>SourceLocation.from_position (static)</li>
+ <li>SourceLocation.__eq__ and SourceLocation.__ne__</li>
+ <li>SourceRange.__eq__ and SourceRange.__ne__</li>
+ <li>Diagnostic.category_number (property)</li>
+ <li>Diagnostic.category_name (property)</li>
+ <li>Diagnostic.option (property)</li>
+ <li>Diagnostic.disable_option (property)</li>
+ <li>CursorKind.is_translation_unit</li>
+ <li>CursorKind.is_preprocessing</li>
+ <li>CursorKind.is_unexposed</li>
+ <li>Cursor.from_location (static)</li>
+ <li>Cursor.underlying_typedef_type (property)</li>
+ <li>Cursor.enum_type (property)</li>
+ <li>Cursor.objc_type_encoding (property)</li>
+ <li>Cursor.hash</li>
+ <li>TypeKind.spelling</li>
+ <li>Type.argument_types</li>
+ <li>Type.element_type (property)</li>
+ <li>Type.element_count (property)</li>
+ <li>Type.is_function_variadic</li>
+ <li>Type.is_pod</li>
+ <li>Type.get_array_element_type</li>
+ <li>Type.get_array_size</li>
+ <li>Type.__eq__ and Type.__ne__</li>
+ <li>File.from_name (static)</li>
+ <li>File.__str__ and File.__repr__</li>
+</ul>
+
<!-- ======================================================================= -->
<h2 id="knownproblems">Significant Known Problems</h2>
<!-- ======================================================================= -->
Modified: cfe/branches/tooling/docs/Tooling.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/docs/Tooling.html?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/docs/Tooling.html (original)
+++ cfe/branches/tooling/docs/Tooling.html Tue May 15 13:51:08 2012
@@ -23,7 +23,7 @@
when you have a good reason not to use LibClang.</p>
<p>Canonical examples of when to use LibClang:</p>
<ul>
- <li>XCode</li>
+ <li>Xcode</li>
<li>Clang Python Bindings</li>
</ul>
<p>Use LibClang when you...</p>
Modified: cfe/branches/tooling/include/clang/AST/DeclObjC.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/AST/DeclObjC.h?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/AST/DeclObjC.h (original)
+++ cfe/branches/tooling/include/clang/AST/DeclObjC.h Tue May 15 13:51:08 2012
@@ -150,6 +150,15 @@
/// "standard" position, a enum SelectorLocationsKind.
unsigned SelLocsKind : 2;
+ /// \brief Whether this method overrides any other in the class hierarchy.
+ ///
+ /// A method is said to override any method in the class's
+ /// base classes, its protocols, or its categories' protocols, that has
+ /// the same selector and is of the same kind (class or instance).
+ /// A method in an implementation is not considered as overriding the same
+ /// method in the interface or its categories.
+ unsigned IsOverriding : 1;
+
// Result type of this method.
QualType MethodDeclType;
@@ -230,7 +239,7 @@
IsDefined(isDefined), IsRedeclaration(0), HasRedeclaration(0),
DeclImplementation(impControl), objcDeclQualifier(OBJC_TQ_None),
RelatedResultType(HasRelatedResultType),
- SelLocsKind(SelLoc_StandardNoSpace),
+ SelLocsKind(SelLoc_StandardNoSpace), IsOverriding(0),
MethodDeclType(T), ResultTInfo(ResultTInfo),
ParamsAndSelLocs(0), NumParams(0),
EndLoc(endLoc), Body(0), SelfDecl(0), CmdDecl(0) {
@@ -396,6 +405,16 @@
bool isDefined() const { return IsDefined; }
void setDefined(bool isDefined) { IsDefined = isDefined; }
+ /// \brief Whether this method overrides any other in the class hierarchy.
+ ///
+ /// A method is said to override any method in the class's
+ /// base classes, its protocols, or its categories' protocols, that has
+ /// the same selector and is of the same kind (class or instance).
+ /// A method in an implementation is not considered as overriding the same
+ /// method in the interface or its categories.
+ bool isOverriding() const { return IsOverriding; }
+ void setOverriding(bool isOverriding) { IsOverriding = isOverriding; }
+
// Related to protocols declared in @protocol
void setDeclImplementation(ImplementationControl ic) {
DeclImplementation = ic;
Modified: cfe/branches/tooling/include/clang/AST/NSAPI.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/AST/NSAPI.h?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/AST/NSAPI.h (original)
+++ cfe/branches/tooling/include/clang/AST/NSAPI.h Tue May 15 13:51:08 2012
@@ -126,10 +126,19 @@
/// \brief Determine the appropriate NSNumber factory method kind for a
/// literal of the given type.
- static llvm::Optional<NSNumberLiteralMethodKind>
- getNSNumberFactoryMethodKind(QualType T);
+ llvm::Optional<NSNumberLiteralMethodKind>
+ getNSNumberFactoryMethodKind(QualType T) const;
+
+ /// \brief Returns true if \param T is a typedef of "BOOL" in objective-c.
+ bool isObjCBOOLType(QualType T) const;
+ /// \brief Returns true if \param T is a typedef of "NSInteger" in objective-c.
+ bool isObjCNSIntegerType(QualType T) const;
+ /// \brief Returns true if \param T is a typedef of "NSUInteger" in objective-c.
+ bool isObjCNSUIntegerType(QualType T) const;
private:
+ bool isObjCTypedef(QualType T, StringRef name, IdentifierInfo *&II) const;
+
ASTContext &Ctx;
mutable IdentifierInfo *ClassIds[NumClassIds];
@@ -145,6 +154,8 @@
/// \brief The Objective-C NSNumber selectors used to create NSNumber literals.
mutable Selector NSNumberClassSelectors[NumNSNumberLiteralMethods];
mutable Selector NSNumberInstanceSelectors[NumNSNumberLiteralMethods];
+
+ mutable IdentifierInfo *BOOLId, *NSIntegerId, *NSUIntegerId;
};
} // end namespace clang
Modified: cfe/branches/tooling/include/clang/AST/RecursiveASTVisitor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/AST/RecursiveASTVisitor.h?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/AST/RecursiveASTVisitor.h (original)
+++ cfe/branches/tooling/include/clang/AST/RecursiveASTVisitor.h Tue May 15 13:51:08 2012
@@ -1241,7 +1241,9 @@
DEF_TRAVERSE_DECL(AccessSpecDecl, { })
DEF_TRAVERSE_DECL(BlockDecl, {
- TRY_TO(TraverseTypeLoc(D->getSignatureAsWritten()->getTypeLoc()));
+ TypeSourceInfo *TInfo = D->getSignatureAsWritten();
+ if (TInfo)
+ TRY_TO(TraverseTypeLoc(TInfo->getTypeLoc()));
TRY_TO(TraverseStmt(D->getBody()));
// This return statement makes sure the traversal of nodes in
// decls_begin()/decls_end() (done in the DEF_TRAVERSE_DECL macro)
@@ -1451,10 +1453,11 @@
TRY_TO(TraverseDecl(FD));
break;
- // No need to visit explicit instantiations, we'll find the node
- // eventually.
+ // FIXME: For now traverse explicit instantiations here. Change that
+ // once they are represented as dedicated nodes in the AST.
case TSK_ExplicitInstantiationDeclaration:
case TSK_ExplicitInstantiationDefinition:
+ TRY_TO(TraverseDecl(FD));
break;
case TSK_ExplicitSpecialization:
Modified: cfe/branches/tooling/include/clang/AST/Type.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/AST/Type.h?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/AST/Type.h (original)
+++ cfe/branches/tooling/include/clang/AST/Type.h Tue May 15 13:51:08 2012
@@ -1750,9 +1750,9 @@
friend class ASTWriter;
};
-template <> inline const TypedefType *Type::getAs() const {
- return dyn_cast<TypedefType>(this);
-}
+/// \brief This will check for a TypedefType by removing any existing sugar
+/// until it reaches a TypedefType or a non-sugared type.
+template <> const TypedefType *Type::getAs() const;
// We can do canonical leaf types faster, because we don't have to
// worry about preserving child type decoration.
Modified: cfe/branches/tooling/include/clang/AST/TypeLoc.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/AST/TypeLoc.h?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/AST/TypeLoc.h (original)
+++ cfe/branches/tooling/include/clang/AST/TypeLoc.h Tue May 15 13:51:08 2012
@@ -831,6 +831,7 @@
struct ObjCInterfaceLocInfo {
SourceLocation NameLoc;
+ SourceLocation NameEndLoc;
};
/// \brief Wrapper for source info for ObjC interfaces.
@@ -850,9 +851,17 @@
void setNameLoc(SourceLocation Loc) {
getLocalData()->NameLoc = Loc;
}
-
+
SourceRange getLocalSourceRange() const {
- return SourceRange(getNameLoc());
+ return SourceRange(getNameLoc(), getNameEndLoc());
+ }
+
+ SourceLocation getNameEndLoc() const {
+ return getLocalData()->NameEndLoc;
+ }
+
+ void setNameEndLoc(SourceLocation Loc) {
+ getLocalData()->NameEndLoc = Loc;
}
void initializeLocal(ASTContext &Context, SourceLocation Loc) {
Modified: cfe/branches/tooling/include/clang/Basic/Attr.td
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Basic/Attr.td?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Basic/Attr.td (original)
+++ cfe/branches/tooling/include/clang/Basic/Attr.td Tue May 15 13:51:08 2012
@@ -93,6 +93,9 @@
list<string> Namespaces = [];
// Set to true for attributes with arguments which require delayed parsing.
bit LateParsed = 0;
+ // Set to false to prevent an attribute from being propagated from a template
+ // to the instantiation.
+ bit Clone = 1;
// Set to true for attributes which must be instantiated within templates
bit TemplateDependent = 0;
// Set to true for attributes that have a corresponding AST node.
@@ -101,6 +104,8 @@
bit SemaHandler = 1;
// Set to true for attributes that are completely ignored.
bit Ignored = 0;
+ // Set to true if each of the spellings is a distinct attribute.
+ bit DistinctSpellings = 0;
// Any additional text that should be included verbatim in the class.
code AdditionalMembers = [{}];
}
@@ -241,6 +246,10 @@
let Args = [FunctionArgument<"FunctionDecl">];
}
+def Cold : InheritableAttr {
+ let Spellings = ["cold"];
+}
+
def Common : InheritableAttr {
let Spellings = ["common"];
}
@@ -346,6 +355,10 @@
let Spellings = ["gnu_inline"];
}
+def Hot : InheritableAttr {
+ let Spellings = ["hot"];
+}
+
def IBAction : InheritableAttr {
let Spellings = ["ibaction"];
}
@@ -530,6 +543,7 @@
def Ownership : InheritableAttr {
let Spellings = ["ownership_holds", "ownership_returns", "ownership_takes"];
+ let DistinctSpellings = 1;
let Args = [EnumArgument<"OwnKind", "OwnershipKind",
["ownership_holds", "ownership_returns", "ownership_takes"],
["Holds", "Returns", "Takes"]>,
@@ -649,6 +663,7 @@
}
def Visibility : InheritableAttr {
+ let Clone = 0;
let Spellings = ["visibility"];
let Args = [EnumArgument<"Visibility", "VisibilityType",
["default", "hidden", "internal", "protected"],
Modified: cfe/branches/tooling/include/clang/Basic/Builtins.def
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Basic/Builtins.def?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Basic/Builtins.def (original)
+++ cfe/branches/tooling/include/clang/Basic/Builtins.def Tue May 15 13:51:08 2012
@@ -848,13 +848,13 @@
LIBBUILTIN(fmal, "LdLdLdLd", "fc", "math.h", ALL_LANGUAGES)
LIBBUILTIN(fmaf, "ffff", "fc", "math.h", ALL_LANGUAGES)
-LIBBUILTIN(fmax, "dd", "fe", "math.h", ALL_LANGUAGES)
-LIBBUILTIN(fmaxl, "LdLd", "fe", "math.h", ALL_LANGUAGES)
-LIBBUILTIN(fmaxf, "ff", "fe", "math.h", ALL_LANGUAGES)
-
-LIBBUILTIN(fmin, "dd", "fe", "math.h", ALL_LANGUAGES)
-LIBBUILTIN(fminl, "LdLd", "fe", "math.h", ALL_LANGUAGES)
-LIBBUILTIN(fminf, "ff", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(fmax, "ddd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(fmaxl, "LdLdLd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(fmaxf, "fff", "fe", "math.h", ALL_LANGUAGES)
+
+LIBBUILTIN(fmin, "ddd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(fminl, "LdLdLd", "fe", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(fminf, "fff", "fe", "math.h", ALL_LANGUAGES)
LIBBUILTIN(log, "dd", "fe", "math.h", ALL_LANGUAGES)
LIBBUILTIN(logl, "LdLd", "fe", "math.h", ALL_LANGUAGES)
Modified: cfe/branches/tooling/include/clang/Basic/BuiltinsHexagon.def
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Basic/BuiltinsHexagon.def?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Basic/BuiltinsHexagon.def (original)
+++ cfe/branches/tooling/include/clang/Basic/BuiltinsHexagon.def Tue May 15 13:51:08 2012
@@ -1,4 +1,4 @@
-//==--- BuiltinsHexagon.def - Hexagon Builtin function database --*- C++ -*-==//
+//===-- BuiltinsHexagon.def - Hexagon Builtin function database --*- C++ -*-==//
//
// The LLVM Compiler Infrastructure
//
@@ -7,683 +7,872 @@
//
//===----------------------------------------------------------------------===//
//
-// This file defines the X86-specific builtin function database. Users of
+// This file defines the Hexagon-specific builtin function database. Users of
// this file must define the BUILTIN macro to make use of this information.
//
//===----------------------------------------------------------------------===//
-BUILTIN(__builtin_HEXAGON_C2_cmpeq, "bii", "")
-BUILTIN(__builtin_HEXAGON_C2_cmpgt, "bii", "")
-BUILTIN(__builtin_HEXAGON_C2_cmpgtu, "bii", "")
-BUILTIN(__builtin_HEXAGON_C2_cmpeqp, "bLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_C2_cmpgtp, "bLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_C2_cmpgtup, "bLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_C2_bitsset, "bii", "")
-BUILTIN(__builtin_HEXAGON_C2_bitsclr, "bii", "")
-BUILTIN(__builtin_HEXAGON_C2_cmpeqi, "bii", "")
-BUILTIN(__builtin_HEXAGON_C2_cmpgti, "bii", "")
-BUILTIN(__builtin_HEXAGON_C2_cmpgtui, "bii", "")
-BUILTIN(__builtin_HEXAGON_C2_cmpgei, "bii", "")
-BUILTIN(__builtin_HEXAGON_C2_cmpgeui, "bii", "")
-BUILTIN(__builtin_HEXAGON_C2_cmplt, "bii", "")
-BUILTIN(__builtin_HEXAGON_C2_cmpltu, "bii", "")
-BUILTIN(__builtin_HEXAGON_C2_bitsclri, "bii", "")
-BUILTIN(__builtin_HEXAGON_C2_and, "bii", "")
-BUILTIN(__builtin_HEXAGON_C2_or, "bii", "")
-BUILTIN(__builtin_HEXAGON_C2_xor, "bii", "")
-BUILTIN(__builtin_HEXAGON_C2_andn, "bii", "")
-BUILTIN(__builtin_HEXAGON_C2_not, "bi", "")
-BUILTIN(__builtin_HEXAGON_C2_orn, "bii", "")
-BUILTIN(__builtin_HEXAGON_C2_pxfer_map, "bi", "")
-BUILTIN(__builtin_HEXAGON_C2_any8, "bi", "")
-BUILTIN(__builtin_HEXAGON_C2_all8, "bi", "")
-BUILTIN(__builtin_HEXAGON_C2_vitpack, "iii", "")
-BUILTIN(__builtin_HEXAGON_C2_mux, "iiii", "")
-BUILTIN(__builtin_HEXAGON_C2_muxii, "iiii", "")
-BUILTIN(__builtin_HEXAGON_C2_muxir, "iiii", "")
-BUILTIN(__builtin_HEXAGON_C2_muxri, "iiii", "")
-BUILTIN(__builtin_HEXAGON_C2_vmux, "LLiiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_C2_mask, "LLii", "")
-BUILTIN(__builtin_HEXAGON_A2_vcmpbeq, "bLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vcmpbgtu, "bLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vcmpheq, "bLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vcmphgt, "bLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vcmphgtu, "bLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vcmpweq, "bLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vcmpwgt, "bLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vcmpwgtu, "bLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_C2_tfrpr, "ii", "")
-BUILTIN(__builtin_HEXAGON_C2_tfrrp, "bi", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_acc_hh_s0, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_acc_hh_s1, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_acc_hl_s0, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_acc_hl_s1, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_acc_lh_s0, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_acc_lh_s1, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_acc_ll_s0, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_acc_ll_s1, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_nac_hh_s0, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_nac_hh_s1, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_nac_hl_s0, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_nac_hl_s1, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_nac_lh_s0, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_nac_lh_s1, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_nac_ll_s0, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_nac_ll_s1, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_acc_sat_hh_s0, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_acc_sat_hh_s1, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_acc_sat_hl_s0, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_acc_sat_hl_s1, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_acc_sat_lh_s0, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_acc_sat_lh_s1, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_acc_sat_ll_s0, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_acc_sat_ll_s1, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_nac_sat_hh_s0, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_nac_sat_hh_s1, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_nac_sat_hl_s0, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_nac_sat_hl_s1, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_nac_sat_lh_s0, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_nac_sat_lh_s1, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_nac_sat_ll_s0, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_nac_sat_ll_s1, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_hh_s0, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_hh_s1, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_hl_s0, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_hl_s1, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_lh_s0, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_lh_s1, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_ll_s0, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_ll_s1, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_sat_hh_s0, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_sat_hh_s1, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_sat_hl_s0, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_sat_hl_s1, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_sat_lh_s0, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_sat_lh_s1, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_sat_ll_s0, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_sat_ll_s1, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_rnd_hh_s0, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_rnd_hh_s1, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_rnd_hl_s0, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_rnd_hl_s1, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_rnd_lh_s0, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_rnd_lh_s1, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_rnd_ll_s0, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_rnd_ll_s1, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_sat_rnd_hh_s0, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_sat_rnd_hh_s1, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_sat_rnd_hl_s0, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_sat_rnd_hl_s1, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_sat_rnd_lh_s0, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_sat_rnd_lh_s1, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_sat_rnd_ll_s0, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_sat_rnd_ll_s1, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_acc_hh_s0, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_acc_hh_s1, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_acc_hl_s0, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_acc_hl_s1, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_acc_lh_s0, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_acc_lh_s1, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_acc_ll_s0, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_acc_ll_s1, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_nac_hh_s0, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_nac_hh_s1, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_nac_hl_s0, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_nac_hl_s1, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_nac_lh_s0, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_nac_lh_s1, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_nac_ll_s0, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_nac_ll_s1, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_hh_s0, "LLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_hh_s1, "LLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_hl_s0, "LLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_hl_s1, "LLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_lh_s0, "LLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_lh_s1, "LLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_ll_s0, "LLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_ll_s1, "LLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_rnd_hh_s0, "LLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_rnd_hh_s1, "LLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_rnd_hl_s0, "LLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_rnd_hl_s1, "LLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_rnd_lh_s0, "LLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_rnd_lh_s1, "LLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_rnd_ll_s0, "LLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyd_rnd_ll_s1, "LLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyu_acc_hh_s0, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyu_acc_hh_s1, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyu_acc_hl_s0, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyu_acc_hl_s1, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyu_acc_lh_s0, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyu_acc_lh_s1, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyu_acc_ll_s0, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyu_acc_ll_s1, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyu_nac_hh_s0, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyu_nac_hh_s1, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyu_nac_hl_s0, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyu_nac_hl_s1, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyu_nac_lh_s0, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyu_nac_lh_s1, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyu_nac_ll_s0, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyu_nac_ll_s1, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyu_hh_s0, "Uiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyu_hh_s1, "Uiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyu_hl_s0, "Uiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyu_hl_s1, "Uiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyu_lh_s0, "Uiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyu_lh_s1, "Uiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyu_ll_s0, "Uiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyu_ll_s1, "Uiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyud_acc_hh_s0, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyud_acc_hh_s1, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyud_acc_hl_s0, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyud_acc_hl_s1, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyud_acc_lh_s0, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyud_acc_lh_s1, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyud_acc_ll_s0, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyud_acc_ll_s1, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyud_nac_hh_s0, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyud_nac_hh_s1, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyud_nac_hl_s0, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyud_nac_hl_s1, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyud_nac_lh_s0, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyud_nac_lh_s1, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyud_nac_ll_s0, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyud_nac_ll_s1, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyud_hh_s0, "ULLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyud_hh_s1, "ULLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyud_hl_s0, "ULLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyud_hl_s1, "ULLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyud_lh_s0, "ULLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyud_lh_s1, "ULLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyud_ll_s0, "ULLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyud_ll_s1, "ULLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpysmi, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_macsip, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_macsin, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_dpmpyss_s0, "LLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_dpmpyss_acc_s0, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_dpmpyss_nac_s0, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_dpmpyuu_s0, "ULLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_dpmpyuu_acc_s0, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_dpmpyuu_nac_s0, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpy_up, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyu_up, "Uiii", "")
-BUILTIN(__builtin_HEXAGON_M2_dpmpyss_rnd_s0, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyi, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mpyui, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_maci, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_acci, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_accii, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_nacci, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_naccii, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_subacc, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M2_vmpy2s_s0, "LLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_vmpy2s_s1, "LLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_vmac2s_s0, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_vmac2s_s1, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_vmpy2s_s0pack, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_vmpy2s_s1pack, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_vmac2, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_vmpy2es_s0, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_vmpy2es_s1, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_vmac2es_s0, "LLiLLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_vmac2es_s1, "LLiLLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_vmac2es, "LLiLLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_vrmac_s0, "LLiLLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_vrmpy_s0, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_vdmpyrs_s0, "iLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_vdmpyrs_s1, "iLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_vdmacs_s0, "LLiLLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_vdmacs_s1, "LLiLLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_vdmpys_s0, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_vdmpys_s1, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_cmpyrs_s0, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_cmpyrs_s1, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_cmpyrsc_s0, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_cmpyrsc_s1, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_cmacs_s0, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_cmacs_s1, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_cmacsc_s0, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_cmacsc_s1, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_cmpys_s0, "LLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_cmpys_s1, "LLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_cmpysc_s0, "LLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_cmpysc_s1, "LLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_cnacs_s0, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_cnacs_s1, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_cnacsc_s0, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_cnacsc_s1, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_vrcmpys_s1, "LLiLLii", "")
-BUILTIN(__builtin_HEXAGON_M2_vrcmpys_acc_s1, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_M2_vrcmpys_s1rp, "iLLii", "")
-BUILTIN(__builtin_HEXAGON_M2_mmacls_s0, "LLiLLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_mmacls_s1, "LLiLLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_mmachs_s0, "LLiLLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_mmachs_s1, "LLiLLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_mmpyl_s0, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_mmpyl_s1, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_mmpyh_s0, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_mmpyh_s1, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_mmacls_rs0, "LLiLLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_mmacls_rs1, "LLiLLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_mmachs_rs0, "LLiLLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_mmachs_rs1, "LLiLLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_mmpyl_rs0, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_mmpyl_rs1, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_mmpyh_rs0, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_mmpyh_rs1, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_hmmpyl_rs1, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_hmmpyh_rs1, "iii", "")
-BUILTIN(__builtin_HEXAGON_M2_mmaculs_s0, "LLiLLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_mmaculs_s1, "LLiLLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_mmacuhs_s0, "LLiLLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_mmacuhs_s1, "LLiLLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_mmpyul_s0, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_mmpyul_s1, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_mmpyuh_s0, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_mmpyuh_s1, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_mmaculs_rs0, "LLiLLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_mmaculs_rs1, "LLiLLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_mmacuhs_rs0, "LLiLLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_mmacuhs_rs1, "LLiLLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_mmpyul_rs0, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_mmpyul_rs1, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_mmpyuh_rs0, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_mmpyuh_rs1, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_vrcmaci_s0, "LLiLLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_vrcmacr_s0, "LLiLLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_vrcmaci_s0c, "LLiLLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_vrcmacr_s0c, "LLiLLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_cmaci_s0, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_cmacr_s0, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_vrcmpyi_s0, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_vrcmpyr_s0, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_vrcmpyi_s0c, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_vrcmpyr_s0c, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_cmpyi_s0, "LLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_cmpyr_s0, "LLiii", "")
-BUILTIN(__builtin_HEXAGON_M2_vcmpy_s0_sat_i, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_vcmpy_s0_sat_r, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_vcmpy_s1_sat_i, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_vcmpy_s1_sat_r, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_vcmac_s0_sat_i, "LLiLLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_vcmac_s0_sat_r, "LLiLLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_S2_vcrotate, "LLiLLii", "")
-BUILTIN(__builtin_HEXAGON_A2_add, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_sub, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_addsat, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_subsat, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_addi, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_addh_l16_ll, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_addh_l16_hl, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_addh_l16_sat_ll, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_addh_l16_sat_hl, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_subh_l16_ll, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_subh_l16_hl, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_subh_l16_sat_ll, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_subh_l16_sat_hl, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_addh_h16_ll, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_addh_h16_lh, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_addh_h16_hl, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_addh_h16_hh, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_addh_h16_sat_ll, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_addh_h16_sat_lh, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_addh_h16_sat_hl, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_addh_h16_sat_hh, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_subh_h16_ll, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_subh_h16_lh, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_subh_h16_hl, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_subh_h16_hh, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_subh_h16_sat_ll, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_subh_h16_sat_lh, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_subh_h16_sat_hl, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_subh_h16_sat_hh, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_aslh, "ii", "")
-BUILTIN(__builtin_HEXAGON_A2_asrh, "ii", "")
-BUILTIN(__builtin_HEXAGON_A2_addp, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_addpsat, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_addsp, "LLiiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_subp, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_neg, "ii", "")
-BUILTIN(__builtin_HEXAGON_A2_negsat, "ii", "")
-BUILTIN(__builtin_HEXAGON_A2_abs, "ii", "")
-BUILTIN(__builtin_HEXAGON_A2_abssat, "ii", "")
-BUILTIN(__builtin_HEXAGON_A2_vconj, "LLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_negp, "LLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_absp, "LLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_max, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_maxu, "Uiii", "")
-BUILTIN(__builtin_HEXAGON_A2_min, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_minu, "Uiii", "")
-BUILTIN(__builtin_HEXAGON_A2_maxp, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_maxup, "ULLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_minp, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_minup, "ULLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_tfr, "ii", "")
-BUILTIN(__builtin_HEXAGON_A2_tfrsi, "ii", "")
-BUILTIN(__builtin_HEXAGON_A2_tfrp, "LLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_tfrpi, "LLii", "")
-BUILTIN(__builtin_HEXAGON_A2_zxtb, "ii", "")
-BUILTIN(__builtin_HEXAGON_A2_sxtb, "ii", "")
-BUILTIN(__builtin_HEXAGON_A2_zxth, "ii", "")
-BUILTIN(__builtin_HEXAGON_A2_sxth, "ii", "")
-BUILTIN(__builtin_HEXAGON_A2_combinew, "LLiii", "")
-BUILTIN(__builtin_HEXAGON_A2_combineii, "LLiii", "")
-BUILTIN(__builtin_HEXAGON_A2_combine_hh, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_combine_hl, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_combine_lh, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_combine_ll, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_tfril, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_tfrih, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_and, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_or, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_xor, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_not, "ii", "")
-BUILTIN(__builtin_HEXAGON_M2_xor_xacc, "iiii", "")
-BUILTIN(__builtin_HEXAGON_A2_subri, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_andir, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_orir, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_andp, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_orp, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_xorp, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_notp, "LLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_sxtw, "LLii", "")
-BUILTIN(__builtin_HEXAGON_A2_sat, "iLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_sath, "ii", "")
-BUILTIN(__builtin_HEXAGON_A2_satuh, "ii", "")
-BUILTIN(__builtin_HEXAGON_A2_satub, "ii", "")
-BUILTIN(__builtin_HEXAGON_A2_satb, "ii", "")
-BUILTIN(__builtin_HEXAGON_A2_vaddub, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vaddubs, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vaddh, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vaddhs, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vadduhs, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vaddw, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vaddws, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_svavgh, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_svavghs, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_svnavgh, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_svaddh, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_svaddhs, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_svadduhs, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_svsubh, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_svsubhs, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_svsubuhs, "iii", "")
-BUILTIN(__builtin_HEXAGON_A2_vraddub, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vraddub_acc, "LLiLLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_vradduh, "iLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vsubub, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vsububs, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vsubh, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vsubhs, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vsubuhs, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vsubw, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vsubws, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vabsh, "LLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vabshsat, "LLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vabsw, "LLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vabswsat, "LLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_vabsdiffw, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_M2_vabsdiffh, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vrsadub, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vrsadub_acc, "LLiLLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vavgub, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vavguh, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vavgh, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vnavgh, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vavgw, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vnavgw, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vavgwr, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vnavgwr, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vavgwcr, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vnavgwcr, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vavghcr, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vnavghcr, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vavguw, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vavguwr, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vavgubr, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vavguhr, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vavghr, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vnavghr, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vminh, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vmaxh, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vminub, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vmaxub, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vminuh, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vmaxuh, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vminw, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vmaxw, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vminuw, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A2_vmaxuw, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_S2_asr_r_r, "iii", "")
-BUILTIN(__builtin_HEXAGON_S2_asl_r_r, "iii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsr_r_r, "iii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsl_r_r, "iii", "")
-BUILTIN(__builtin_HEXAGON_S2_asr_r_p, "LLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_asl_r_p, "LLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsr_r_p, "LLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsl_r_p, "LLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_asr_r_r_acc, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_asl_r_r_acc, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsr_r_r_acc, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsl_r_r_acc, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_asr_r_p_acc, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_asl_r_p_acc, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsr_r_p_acc, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsl_r_p_acc, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_asr_r_r_nac, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_asl_r_r_nac, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsr_r_r_nac, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsl_r_r_nac, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_asr_r_p_nac, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_asl_r_p_nac, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsr_r_p_nac, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsl_r_p_nac, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_asr_r_r_and, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_asl_r_r_and, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsr_r_r_and, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsl_r_r_and, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_asr_r_r_or, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_asl_r_r_or, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsr_r_r_or, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsl_r_r_or, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_asr_r_p_and, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_asl_r_p_and, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsr_r_p_and, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsl_r_p_and, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_asr_r_p_or, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_asl_r_p_or, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsr_r_p_or, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsl_r_p_or, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_asr_r_r_sat, "iii", "")
-BUILTIN(__builtin_HEXAGON_S2_asl_r_r_sat, "iii", "")
-BUILTIN(__builtin_HEXAGON_S2_asr_i_r, "iii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsr_i_r, "iii", "")
-BUILTIN(__builtin_HEXAGON_S2_asl_i_r, "iii", "")
-BUILTIN(__builtin_HEXAGON_S2_asr_i_p, "LLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsr_i_p, "LLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_asl_i_p, "LLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_asr_i_r_acc, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsr_i_r_acc, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_asl_i_r_acc, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_asr_i_p_acc, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsr_i_p_acc, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_asl_i_p_acc, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_asr_i_r_nac, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsr_i_r_nac, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_asl_i_r_nac, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_asr_i_p_nac, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsr_i_p_nac, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_asl_i_p_nac, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsr_i_r_xacc, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_asl_i_r_xacc, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsr_i_p_xacc, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_asl_i_p_xacc, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_asr_i_r_and, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsr_i_r_and, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_asl_i_r_and, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_asr_i_r_or, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsr_i_r_or, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_asl_i_r_or, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_asr_i_p_and, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsr_i_p_and, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_asl_i_p_and, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_asr_i_p_or, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsr_i_p_or, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_asl_i_p_or, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_asl_i_r_sat, "iii", "")
-BUILTIN(__builtin_HEXAGON_S2_asr_i_r_rnd, "iii", "")
-BUILTIN(__builtin_HEXAGON_S2_asr_i_r_rnd_goodsyntax, "iii", "")
-BUILTIN(__builtin_HEXAGON_S2_addasl_rrri, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_valignib, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_valignrb, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_vspliceib, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_vsplicerb, "LLiLLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_vsplatrh, "LLii", "")
-BUILTIN(__builtin_HEXAGON_S2_vsplatrb, "ii", "")
-BUILTIN(__builtin_HEXAGON_S2_insert, "iiiii", "")
-BUILTIN(__builtin_HEXAGON_S2_tableidxb_goodsyntax, "iiiii", "")
-BUILTIN(__builtin_HEXAGON_S2_tableidxh_goodsyntax, "iiiii", "")
-BUILTIN(__builtin_HEXAGON_S2_tableidxw_goodsyntax, "iiiii", "")
-BUILTIN(__builtin_HEXAGON_S2_tableidxd_goodsyntax, "iiiii", "")
-BUILTIN(__builtin_HEXAGON_S2_extractu, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S2_insertp, "LLiLLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_S2_extractup, "LLiLLiii", "")
-BUILTIN(__builtin_HEXAGON_S2_insert_rp, "iiiLLi", "")
-BUILTIN(__builtin_HEXAGON_S2_extractu_rp, "iiLLi", "")
-BUILTIN(__builtin_HEXAGON_S2_insertp_rp, "LLiLLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_S2_extractup_rp, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_S2_tstbit_i, "bii", "")
-BUILTIN(__builtin_HEXAGON_S2_setbit_i, "iii", "")
-BUILTIN(__builtin_HEXAGON_S2_togglebit_i, "iii", "")
-BUILTIN(__builtin_HEXAGON_S2_clrbit_i, "iii", "")
-BUILTIN(__builtin_HEXAGON_S2_tstbit_r, "bii", "")
-BUILTIN(__builtin_HEXAGON_S2_setbit_r, "iii", "")
-BUILTIN(__builtin_HEXAGON_S2_togglebit_r, "iii", "")
-BUILTIN(__builtin_HEXAGON_S2_clrbit_r, "iii", "")
-BUILTIN(__builtin_HEXAGON_S2_asr_i_vh, "LLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsr_i_vh, "LLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_asl_i_vh, "LLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_asr_r_vh, "LLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_asl_r_vh, "LLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsr_r_vh, "LLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsl_r_vh, "LLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_asr_i_vw, "LLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_asr_i_svw_trun, "iLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_asr_r_svw_trun, "iLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsr_i_vw, "LLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_asl_i_vw, "LLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_asr_r_vw, "LLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_asl_r_vw, "LLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsr_r_vw, "LLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_lsl_r_vw, "LLiLLii", "")
-BUILTIN(__builtin_HEXAGON_S2_vrndpackwh, "iLLi", "")
-BUILTIN(__builtin_HEXAGON_S2_vrndpackwhs, "iLLi", "")
-BUILTIN(__builtin_HEXAGON_S2_vsxtbh, "LLii", "")
-BUILTIN(__builtin_HEXAGON_S2_vzxtbh, "LLii", "")
-BUILTIN(__builtin_HEXAGON_S2_vsathub, "iLLi", "")
-BUILTIN(__builtin_HEXAGON_S2_svsathub, "ii", "")
-BUILTIN(__builtin_HEXAGON_S2_svsathb, "ii", "")
-BUILTIN(__builtin_HEXAGON_S2_vsathb, "iLLi", "")
-BUILTIN(__builtin_HEXAGON_S2_vtrunohb, "iLLi", "")
-BUILTIN(__builtin_HEXAGON_S2_vtrunewh, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_S2_vtrunowh, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_S2_vtrunehb, "iLLi", "")
-BUILTIN(__builtin_HEXAGON_S2_vsxthw, "LLii", "")
-BUILTIN(__builtin_HEXAGON_S2_vzxthw, "LLii", "")
-BUILTIN(__builtin_HEXAGON_S2_vsatwh, "iLLi", "")
-BUILTIN(__builtin_HEXAGON_S2_vsatwuh, "iLLi", "")
-BUILTIN(__builtin_HEXAGON_S2_packhl, "LLiii", "")
-BUILTIN(__builtin_HEXAGON_A2_swiz, "ii", "")
-BUILTIN(__builtin_HEXAGON_S2_vsathub_nopack, "LLiLLi", "")
-BUILTIN(__builtin_HEXAGON_S2_vsathb_nopack, "LLiLLi", "")
-BUILTIN(__builtin_HEXAGON_S2_vsatwh_nopack, "LLiLLi", "")
-BUILTIN(__builtin_HEXAGON_S2_vsatwuh_nopack, "LLiLLi", "")
-BUILTIN(__builtin_HEXAGON_S2_shuffob, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_S2_shuffeb, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_S2_shuffoh, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_S2_shuffeh, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_S2_parityp, "iLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_S2_lfsp, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_S2_clbnorm, "ii", "")
-BUILTIN(__builtin_HEXAGON_S2_clb, "ii", "")
-BUILTIN(__builtin_HEXAGON_S2_cl0, "ii", "")
-BUILTIN(__builtin_HEXAGON_S2_cl1, "ii", "")
-BUILTIN(__builtin_HEXAGON_S2_clbp, "iLLi", "")
-BUILTIN(__builtin_HEXAGON_S2_cl0p, "iLLi", "")
-BUILTIN(__builtin_HEXAGON_S2_cl1p, "iLLi", "")
-BUILTIN(__builtin_HEXAGON_S2_brev, "ii", "")
-BUILTIN(__builtin_HEXAGON_S2_ct0, "ii", "")
-BUILTIN(__builtin_HEXAGON_S2_ct1, "ii", "")
-BUILTIN(__builtin_HEXAGON_S2_interleave, "LLiLLi", "")
-BUILTIN(__builtin_HEXAGON_S2_deinterleave, "LLiLLi", "")
+// The format of this database matches clang/Basic/Builtins.def.
-BUILTIN(__builtin_SI_to_SXTHI_asrh, "ii", "")
-
-BUILTIN(__builtin_M2_vrcmpys_s1, "LLiLLii", "")
-BUILTIN(__builtin_M2_vrcmpys_acc_s1, "LLiLLiLLii", "")
-BUILTIN(__builtin_M2_vrcmpys_s1rp, "iLLii", "")
-
-BUILTIN(__builtin_M2_vradduh, "iLLiLLi", "")
-BUILTIN(__builtin_A2_addsp, "LLiiLLi", "")
-BUILTIN(__builtin_A2_addpsat, "LLiLLiLLi", "")
+// The builtins below are not autogenerated from iset.py.
+// Make sure you do not overwrite these.
-BUILTIN(__builtin_A2_maxp, "LLiLLiLLi", "")
-BUILTIN(__builtin_A2_maxup, "LLiLLiLLi", "")
-
-BUILTIN(__builtin_HEXAGON_A4_orn, "iii", "")
-BUILTIN(__builtin_HEXAGON_A4_andn, "iii", "")
-BUILTIN(__builtin_HEXAGON_A4_ornp, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A4_andnp, "LLiLLiLLi", "")
-BUILTIN(__builtin_HEXAGON_A4_combineir, "LLiii", "")
-BUILTIN(__builtin_HEXAGON_A4_combineri, "LLiii", "")
-BUILTIN(__builtin_HEXAGON_C4_cmpneqi, "bii", "")
-BUILTIN(__builtin_HEXAGON_C4_cmpneq, "bii", "")
-BUILTIN(__builtin_HEXAGON_C4_cmpltei, "bii", "")
-BUILTIN(__builtin_HEXAGON_C4_cmplte, "bii", "")
-BUILTIN(__builtin_HEXAGON_C4_cmplteui, "bii", "")
-BUILTIN(__builtin_HEXAGON_C4_cmplteu, "bii", "")
-BUILTIN(__builtin_HEXAGON_A4_rcmpneq, "iii", "")
-BUILTIN(__builtin_HEXAGON_A4_rcmpneqi, "iii", "")
-BUILTIN(__builtin_HEXAGON_A4_rcmpeq, "iii", "")
-BUILTIN(__builtin_HEXAGON_A4_rcmpeqi, "iii", "")
-BUILTIN(__builtin_HEXAGON_C4_fastcorner9, "bii", "")
-BUILTIN(__builtin_HEXAGON_C4_fastcorner9_not, "bii", "")
-BUILTIN(__builtin_HEXAGON_C4_and_andn, "biii", "")
-BUILTIN(__builtin_HEXAGON_C4_and_and, "biii", "")
-BUILTIN(__builtin_HEXAGON_C4_and_orn, "biii", "")
-BUILTIN(__builtin_HEXAGON_C4_and_or, "biii", "")
-BUILTIN(__builtin_HEXAGON_C4_or_andn, "biii", "")
-BUILTIN(__builtin_HEXAGON_C4_or_and, "biii", "")
-BUILTIN(__builtin_HEXAGON_C4_or_orn, "biii", "")
-BUILTIN(__builtin_HEXAGON_C4_or_or, "biii", "")
-BUILTIN(__builtin_HEXAGON_S4_addaddi, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S4_subaddi, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M4_xor_xacc, "LLiLLiLLiLLi", "")
-
-BUILTIN(__builtin_HEXAGON_M4_and_and, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M4_and_or, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M4_and_xor, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M4_and_andn, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M4_xor_and, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M4_xor_or, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M4_xor_andn, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M4_or_and, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M4_or_or, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M4_or_xor, "iiii", "")
-BUILTIN(__builtin_HEXAGON_M4_or_andn, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S4_or_andix, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S4_or_andi, "iiii", "")
-BUILTIN(__builtin_HEXAGON_S4_or_ori, "iiii", "")
+BUILTIN(__builtin_SI_to_SXTHI_asrh, "ii", "")
+BUILTIN(__builtin_circ_ldd, "LLi*LLi*LLi*ii", "")
-BUILTIN(__builtin_HEXAGON_A4_modwrapu, "iii", "")
+// The builtins above are not autogenerated from iset.py.
+// Make sure you do not overwrite these.
-BUILTIN(__builtin_HEXAGON_A4_cround_ri, "iii", "")
-BUILTIN(__builtin_HEXAGON_A4_cround_rr, "iii", "")
-BUILTIN(__builtin_HEXAGON_A4_round_ri, "iii", "")
-BUILTIN(__builtin_HEXAGON_A4_round_rr, "iii", "")
-BUILTIN(__builtin_HEXAGON_A4_round_ri_sat, "iii", "")
-BUILTIN(__builtin_HEXAGON_A4_round_rr_sat, "iii", "")
+BUILTIN(__builtin_HEXAGON_C2_cmpeq,"bii","")
+BUILTIN(__builtin_HEXAGON_C2_cmpgt,"bii","")
+BUILTIN(__builtin_HEXAGON_C2_cmpgtu,"bii","")
+BUILTIN(__builtin_HEXAGON_C2_cmpeqp,"bLLiLLi","")
+BUILTIN(__builtin_HEXAGON_C2_cmpgtp,"bLLiLLi","")
+BUILTIN(__builtin_HEXAGON_C2_cmpgtup,"bLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A4_rcmpeqi,"iii","")
+BUILTIN(__builtin_HEXAGON_A4_rcmpneqi,"iii","")
+BUILTIN(__builtin_HEXAGON_A4_rcmpeq,"iii","")
+BUILTIN(__builtin_HEXAGON_A4_rcmpneq,"iii","")
+BUILTIN(__builtin_HEXAGON_C2_bitsset,"bii","")
+BUILTIN(__builtin_HEXAGON_C2_bitsclr,"bii","")
+BUILTIN(__builtin_HEXAGON_C4_nbitsset,"bii","")
+BUILTIN(__builtin_HEXAGON_C4_nbitsclr,"bii","")
+BUILTIN(__builtin_HEXAGON_C2_cmpeqi,"bii","")
+BUILTIN(__builtin_HEXAGON_C2_cmpgti,"bii","")
+BUILTIN(__builtin_HEXAGON_C2_cmpgtui,"bii","")
+BUILTIN(__builtin_HEXAGON_C2_cmpgei,"bii","")
+BUILTIN(__builtin_HEXAGON_C2_cmpgeui,"bii","")
+BUILTIN(__builtin_HEXAGON_C2_cmplt,"bii","")
+BUILTIN(__builtin_HEXAGON_C2_cmpltu,"bii","")
+BUILTIN(__builtin_HEXAGON_C2_bitsclri,"bii","")
+BUILTIN(__builtin_HEXAGON_C4_nbitsclri,"bii","")
+BUILTIN(__builtin_HEXAGON_C4_cmpneqi,"bii","")
+BUILTIN(__builtin_HEXAGON_C4_cmpltei,"bii","")
+BUILTIN(__builtin_HEXAGON_C4_cmplteui,"bii","")
+BUILTIN(__builtin_HEXAGON_C4_cmpneq,"bii","")
+BUILTIN(__builtin_HEXAGON_C4_cmplte,"bii","")
+BUILTIN(__builtin_HEXAGON_C4_cmplteu,"bii","")
+BUILTIN(__builtin_HEXAGON_C2_and,"bii","")
+BUILTIN(__builtin_HEXAGON_C2_or,"bii","")
+BUILTIN(__builtin_HEXAGON_C2_xor,"bii","")
+BUILTIN(__builtin_HEXAGON_C2_andn,"bii","")
+BUILTIN(__builtin_HEXAGON_C2_not,"bi","")
+BUILTIN(__builtin_HEXAGON_C2_orn,"bii","")
+BUILTIN(__builtin_HEXAGON_C4_and_and,"biii","")
+BUILTIN(__builtin_HEXAGON_C4_and_or,"biii","")
+BUILTIN(__builtin_HEXAGON_C4_or_and,"biii","")
+BUILTIN(__builtin_HEXAGON_C4_or_or,"biii","")
+BUILTIN(__builtin_HEXAGON_C4_and_andn,"biii","")
+BUILTIN(__builtin_HEXAGON_C4_and_orn,"biii","")
+BUILTIN(__builtin_HEXAGON_C4_or_andn,"biii","")
+BUILTIN(__builtin_HEXAGON_C4_or_orn,"biii","")
+BUILTIN(__builtin_HEXAGON_C2_pxfer_map,"bi","")
+BUILTIN(__builtin_HEXAGON_C2_any8,"bi","")
+BUILTIN(__builtin_HEXAGON_C2_all8,"bi","")
+BUILTIN(__builtin_HEXAGON_C2_vitpack,"iii","")
+BUILTIN(__builtin_HEXAGON_C2_mux,"iiii","")
+BUILTIN(__builtin_HEXAGON_C2_muxii,"iiii","")
+BUILTIN(__builtin_HEXAGON_C2_muxir,"iiii","")
+BUILTIN(__builtin_HEXAGON_C2_muxri,"iiii","")
+BUILTIN(__builtin_HEXAGON_C2_vmux,"LLiiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_C2_mask,"LLii","")
+BUILTIN(__builtin_HEXAGON_A2_vcmpbeq,"bLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A4_vcmpbeqi,"bLLii","")
+BUILTIN(__builtin_HEXAGON_A4_vcmpbeq_any,"bLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vcmpbgtu,"bLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A4_vcmpbgtui,"bLLii","")
+BUILTIN(__builtin_HEXAGON_A4_vcmpbgt,"bLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A4_vcmpbgti,"bLLii","")
+BUILTIN(__builtin_HEXAGON_A4_cmpbeq,"bii","")
+BUILTIN(__builtin_HEXAGON_A4_cmpbeqi,"bii","")
+BUILTIN(__builtin_HEXAGON_A4_cmpbgtu,"bii","")
+BUILTIN(__builtin_HEXAGON_A4_cmpbgtui,"bii","")
+BUILTIN(__builtin_HEXAGON_A4_cmpbgt,"bii","")
+BUILTIN(__builtin_HEXAGON_A4_cmpbgti,"bii","")
+BUILTIN(__builtin_HEXAGON_A2_vcmpheq,"bLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vcmphgt,"bLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vcmphgtu,"bLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A4_vcmpheqi,"bLLii","")
+BUILTIN(__builtin_HEXAGON_A4_vcmphgti,"bLLii","")
+BUILTIN(__builtin_HEXAGON_A4_vcmphgtui,"bLLii","")
+BUILTIN(__builtin_HEXAGON_A4_cmpheq,"bii","")
+BUILTIN(__builtin_HEXAGON_A4_cmphgt,"bii","")
+BUILTIN(__builtin_HEXAGON_A4_cmphgtu,"bii","")
+BUILTIN(__builtin_HEXAGON_A4_cmpheqi,"bii","")
+BUILTIN(__builtin_HEXAGON_A4_cmphgti,"bii","")
+BUILTIN(__builtin_HEXAGON_A4_cmphgtui,"bii","")
+BUILTIN(__builtin_HEXAGON_A2_vcmpweq,"bLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vcmpwgt,"bLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vcmpwgtu,"bLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A4_vcmpweqi,"bLLii","")
+BUILTIN(__builtin_HEXAGON_A4_vcmpwgti,"bLLii","")
+BUILTIN(__builtin_HEXAGON_A4_vcmpwgtui,"bLLii","")
+BUILTIN(__builtin_HEXAGON_A4_boundscheck,"biLLi","")
+BUILTIN(__builtin_HEXAGON_A4_tlbmatch,"bLLii","")
+BUILTIN(__builtin_HEXAGON_C2_tfrpr,"ii","")
+BUILTIN(__builtin_HEXAGON_C2_tfrrp,"bi","")
+BUILTIN(__builtin_HEXAGON_C4_fastcorner9,"bii","")
+BUILTIN(__builtin_HEXAGON_C4_fastcorner9_not,"bii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_acc_hh_s0,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_acc_hh_s1,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_acc_hl_s0,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_acc_hl_s1,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_acc_lh_s0,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_acc_lh_s1,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_acc_ll_s0,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_acc_ll_s1,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_nac_hh_s0,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_nac_hh_s1,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_nac_hl_s0,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_nac_hl_s1,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_nac_lh_s0,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_nac_lh_s1,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_nac_ll_s0,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_nac_ll_s1,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_acc_sat_hh_s0,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_acc_sat_hh_s1,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_acc_sat_hl_s0,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_acc_sat_hl_s1,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_acc_sat_lh_s0,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_acc_sat_lh_s1,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_acc_sat_ll_s0,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_acc_sat_ll_s1,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_nac_sat_hh_s0,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_nac_sat_hh_s1,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_nac_sat_hl_s0,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_nac_sat_hl_s1,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_nac_sat_lh_s0,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_nac_sat_lh_s1,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_nac_sat_ll_s0,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_nac_sat_ll_s1,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_hh_s0,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_hh_s1,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_hl_s0,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_hl_s1,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_lh_s0,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_lh_s1,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_ll_s0,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_ll_s1,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_sat_hh_s0,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_sat_hh_s1,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_sat_hl_s0,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_sat_hl_s1,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_sat_lh_s0,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_sat_lh_s1,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_sat_ll_s0,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_sat_ll_s1,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_rnd_hh_s0,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_rnd_hh_s1,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_rnd_hl_s0,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_rnd_hl_s1,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_rnd_lh_s0,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_rnd_lh_s1,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_rnd_ll_s0,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_rnd_ll_s1,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_sat_rnd_hh_s0,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_sat_rnd_hh_s1,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_sat_rnd_hl_s0,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_sat_rnd_hl_s1,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_sat_rnd_lh_s0,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_sat_rnd_lh_s1,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_sat_rnd_ll_s0,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_sat_rnd_ll_s1,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_acc_hh_s0,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_acc_hh_s1,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_acc_hl_s0,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_acc_hl_s1,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_acc_lh_s0,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_acc_lh_s1,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_acc_ll_s0,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_acc_ll_s1,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_nac_hh_s0,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_nac_hh_s1,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_nac_hl_s0,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_nac_hl_s1,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_nac_lh_s0,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_nac_lh_s1,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_nac_ll_s0,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_nac_ll_s1,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_hh_s0,"LLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_hh_s1,"LLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_hl_s0,"LLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_hl_s1,"LLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_lh_s0,"LLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_lh_s1,"LLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_ll_s0,"LLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_ll_s1,"LLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_rnd_hh_s0,"LLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_rnd_hh_s1,"LLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_rnd_hl_s0,"LLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_rnd_hl_s1,"LLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_rnd_lh_s0,"LLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_rnd_lh_s1,"LLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_rnd_ll_s0,"LLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyd_rnd_ll_s1,"LLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyu_acc_hh_s0,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyu_acc_hh_s1,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyu_acc_hl_s0,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyu_acc_hl_s1,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyu_acc_lh_s0,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyu_acc_lh_s1,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyu_acc_ll_s0,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyu_acc_ll_s1,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyu_nac_hh_s0,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyu_nac_hh_s1,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyu_nac_hl_s0,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyu_nac_hl_s1,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyu_nac_lh_s0,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyu_nac_lh_s1,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyu_nac_ll_s0,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyu_nac_ll_s1,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyu_hh_s0,"Uiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyu_hh_s1,"Uiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyu_hl_s0,"Uiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyu_hl_s1,"Uiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyu_lh_s0,"Uiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyu_lh_s1,"Uiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyu_ll_s0,"Uiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyu_ll_s1,"Uiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyud_acc_hh_s0,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyud_acc_hh_s1,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyud_acc_hl_s0,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyud_acc_hl_s1,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyud_acc_lh_s0,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyud_acc_lh_s1,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyud_acc_ll_s0,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyud_acc_ll_s1,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyud_nac_hh_s0,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyud_nac_hh_s1,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyud_nac_hl_s0,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyud_nac_hl_s1,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyud_nac_lh_s0,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyud_nac_lh_s1,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyud_nac_ll_s0,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyud_nac_ll_s1,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyud_hh_s0,"ULLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyud_hh_s1,"ULLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyud_hl_s0,"ULLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyud_hl_s1,"ULLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyud_lh_s0,"ULLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyud_lh_s1,"ULLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyud_ll_s0,"ULLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyud_ll_s1,"ULLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpysmi,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_macsip,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_macsin,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_dpmpyss_s0,"LLiii","")
+BUILTIN(__builtin_HEXAGON_M2_dpmpyss_acc_s0,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_dpmpyss_nac_s0,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_dpmpyuu_s0,"ULLiii","")
+BUILTIN(__builtin_HEXAGON_M2_dpmpyuu_acc_s0,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_dpmpyuu_nac_s0,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_up,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_up_s1,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpy_up_s1_sat,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyu_up,"Uiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpysu_up,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_dpmpyss_rnd_s0,"iii","")
+BUILTIN(__builtin_HEXAGON_M4_mac_up_s1_sat,"iiii","")
+BUILTIN(__builtin_HEXAGON_M4_nac_up_s1_sat,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyi,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mpyui,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_maci,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_acci,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_accii,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_nacci,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_naccii,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_subacc,"iiii","")
+BUILTIN(__builtin_HEXAGON_M4_mpyrr_addr,"iiii","")
+BUILTIN(__builtin_HEXAGON_M4_mpyri_addr_u2,"iiii","")
+BUILTIN(__builtin_HEXAGON_M4_mpyri_addr,"iiii","")
+BUILTIN(__builtin_HEXAGON_M4_mpyri_addi,"iiii","")
+BUILTIN(__builtin_HEXAGON_M4_mpyrr_addi,"iiii","")
+BUILTIN(__builtin_HEXAGON_M2_vmpy2s_s0,"LLiii","")
+BUILTIN(__builtin_HEXAGON_M2_vmpy2s_s1,"LLiii","")
+BUILTIN(__builtin_HEXAGON_M2_vmac2s_s0,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_vmac2s_s1,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_vmpy2su_s0,"LLiii","")
+BUILTIN(__builtin_HEXAGON_M2_vmpy2su_s1,"LLiii","")
+BUILTIN(__builtin_HEXAGON_M2_vmac2su_s0,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_vmac2su_s1,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_vmpy2s_s0pack,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_vmpy2s_s1pack,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_vmac2,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_vmpy2es_s0,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_vmpy2es_s1,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_vmac2es_s0,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_vmac2es_s1,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_vmac2es,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_vrmac_s0,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_vrmpy_s0,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_vdmpyrs_s0,"iLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_vdmpyrs_s1,"iLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M5_vrmpybuu,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M5_vrmacbuu,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M5_vrmpybsu,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M5_vrmacbsu,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M5_vmpybuu,"LLiii","")
+BUILTIN(__builtin_HEXAGON_M5_vmpybsu,"LLiii","")
+BUILTIN(__builtin_HEXAGON_M5_vmacbuu,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M5_vmacbsu,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M5_vdmpybsu,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M5_vdmacbsu,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_vdmacs_s0,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_vdmacs_s1,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_vdmpys_s0,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_vdmpys_s1,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_cmpyrs_s0,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_cmpyrs_s1,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_cmpyrsc_s0,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_cmpyrsc_s1,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_cmacs_s0,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_cmacs_s1,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_cmacsc_s0,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_cmacsc_s1,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_cmpys_s0,"LLiii","")
+BUILTIN(__builtin_HEXAGON_M2_cmpys_s1,"LLiii","")
+BUILTIN(__builtin_HEXAGON_M2_cmpysc_s0,"LLiii","")
+BUILTIN(__builtin_HEXAGON_M2_cmpysc_s1,"LLiii","")
+BUILTIN(__builtin_HEXAGON_M2_cnacs_s0,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_cnacs_s1,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_cnacsc_s0,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_cnacsc_s1,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_vrcmpys_s1,"LLiLLii","")
+BUILTIN(__builtin_HEXAGON_M2_vrcmpys_acc_s1,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_M2_vrcmpys_s1rp,"iLLii","")
+BUILTIN(__builtin_HEXAGON_M2_mmacls_s0,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_mmacls_s1,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_mmachs_s0,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_mmachs_s1,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_mmpyl_s0,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_mmpyl_s1,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_mmpyh_s0,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_mmpyh_s1,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_mmacls_rs0,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_mmacls_rs1,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_mmachs_rs0,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_mmachs_rs1,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_mmpyl_rs0,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_mmpyl_rs1,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_mmpyh_rs0,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_mmpyh_rs1,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M4_vrmpyeh_s0,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M4_vrmpyeh_s1,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M4_vrmpyeh_acc_s0,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M4_vrmpyeh_acc_s1,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M4_vrmpyoh_s0,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M4_vrmpyoh_s1,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M4_vrmpyoh_acc_s0,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M4_vrmpyoh_acc_s1,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_hmmpyl_rs1,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_hmmpyh_rs1,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_hmmpyl_s1,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_hmmpyh_s1,"iii","")
+BUILTIN(__builtin_HEXAGON_M2_mmaculs_s0,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_mmaculs_s1,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_mmacuhs_s0,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_mmacuhs_s1,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_mmpyul_s0,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_mmpyul_s1,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_mmpyuh_s0,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_mmpyuh_s1,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_mmaculs_rs0,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_mmaculs_rs1,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_mmacuhs_rs0,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_mmacuhs_rs1,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_mmpyul_rs0,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_mmpyul_rs1,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_mmpyuh_rs0,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_mmpyuh_rs1,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_vrcmaci_s0,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_vrcmacr_s0,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_vrcmaci_s0c,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_vrcmacr_s0c,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_cmaci_s0,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_cmacr_s0,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M2_vrcmpyi_s0,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_vrcmpyr_s0,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_vrcmpyi_s0c,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_vrcmpyr_s0c,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_cmpyi_s0,"LLiii","")
+BUILTIN(__builtin_HEXAGON_M2_cmpyr_s0,"LLiii","")
+BUILTIN(__builtin_HEXAGON_M4_cmpyi_wh,"iLLii","")
+BUILTIN(__builtin_HEXAGON_M4_cmpyr_wh,"iLLii","")
+BUILTIN(__builtin_HEXAGON_M4_cmpyi_whc,"iLLii","")
+BUILTIN(__builtin_HEXAGON_M4_cmpyr_whc,"iLLii","")
+BUILTIN(__builtin_HEXAGON_M2_vcmpy_s0_sat_i,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_vcmpy_s0_sat_r,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_vcmpy_s1_sat_i,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_vcmpy_s1_sat_r,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_vcmac_s0_sat_i,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_vcmac_s0_sat_r,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_S2_vcrotate,"LLiLLii","")
+BUILTIN(__builtin_HEXAGON_S4_vrcrotate_acc,"LLiLLiLLiii","")
+BUILTIN(__builtin_HEXAGON_S4_vrcrotate,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_S2_vcnegh,"LLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_vrcnegh,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_M4_pmpyw,"LLiii","")
+BUILTIN(__builtin_HEXAGON_M4_vpmpyh,"LLiii","")
+BUILTIN(__builtin_HEXAGON_M4_pmpyw_acc,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_M4_vpmpyh_acc,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_A2_add,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_sub,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_addsat,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_subsat,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_addi,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_addh_l16_ll,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_addh_l16_hl,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_addh_l16_sat_ll,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_addh_l16_sat_hl,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_subh_l16_ll,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_subh_l16_hl,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_subh_l16_sat_ll,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_subh_l16_sat_hl,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_addh_h16_ll,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_addh_h16_lh,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_addh_h16_hl,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_addh_h16_hh,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_addh_h16_sat_ll,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_addh_h16_sat_lh,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_addh_h16_sat_hl,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_addh_h16_sat_hh,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_subh_h16_ll,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_subh_h16_lh,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_subh_h16_hl,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_subh_h16_hh,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_subh_h16_sat_ll,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_subh_h16_sat_lh,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_subh_h16_sat_hl,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_subh_h16_sat_hh,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_aslh,"ii","")
+BUILTIN(__builtin_HEXAGON_A2_asrh,"ii","")
+BUILTIN(__builtin_HEXAGON_A2_addp,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_addpsat,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_addsp,"LLiiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_subp,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_neg,"ii","")
+BUILTIN(__builtin_HEXAGON_A2_negsat,"ii","")
+BUILTIN(__builtin_HEXAGON_A2_abs,"ii","")
+BUILTIN(__builtin_HEXAGON_A2_abssat,"ii","")
+BUILTIN(__builtin_HEXAGON_A2_vconj,"LLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_negp,"LLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_absp,"LLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_max,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_maxu,"Uiii","")
+BUILTIN(__builtin_HEXAGON_A2_min,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_minu,"Uiii","")
+BUILTIN(__builtin_HEXAGON_A2_maxp,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_maxup,"ULLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_minp,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_minup,"ULLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_tfr,"ii","")
+BUILTIN(__builtin_HEXAGON_A2_tfrsi,"ii","")
+BUILTIN(__builtin_HEXAGON_A2_tfrp,"LLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_tfrpi,"LLii","")
+BUILTIN(__builtin_HEXAGON_A2_zxtb,"ii","")
+BUILTIN(__builtin_HEXAGON_A2_sxtb,"ii","")
+BUILTIN(__builtin_HEXAGON_A2_zxth,"ii","")
+BUILTIN(__builtin_HEXAGON_A2_sxth,"ii","")
+BUILTIN(__builtin_HEXAGON_A2_combinew,"LLiii","")
+BUILTIN(__builtin_HEXAGON_A4_combineri,"LLiii","")
+BUILTIN(__builtin_HEXAGON_A4_combineir,"LLiii","")
+BUILTIN(__builtin_HEXAGON_A2_combineii,"LLiii","")
+BUILTIN(__builtin_HEXAGON_A2_combine_hh,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_combine_hl,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_combine_lh,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_combine_ll,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_tfril,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_tfrih,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_and,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_or,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_xor,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_not,"ii","")
+BUILTIN(__builtin_HEXAGON_M2_xor_xacc,"iiii","")
+BUILTIN(__builtin_HEXAGON_M4_xor_xacc,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A4_andn,"iii","")
+BUILTIN(__builtin_HEXAGON_A4_orn,"iii","")
+BUILTIN(__builtin_HEXAGON_A4_andnp,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A4_ornp,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_S4_addaddi,"iiii","")
+BUILTIN(__builtin_HEXAGON_S4_subaddi,"iiii","")
+BUILTIN(__builtin_HEXAGON_M4_and_and,"iiii","")
+BUILTIN(__builtin_HEXAGON_M4_and_andn,"iiii","")
+BUILTIN(__builtin_HEXAGON_M4_and_or,"iiii","")
+BUILTIN(__builtin_HEXAGON_M4_and_xor,"iiii","")
+BUILTIN(__builtin_HEXAGON_M4_or_and,"iiii","")
+BUILTIN(__builtin_HEXAGON_M4_or_andn,"iiii","")
+BUILTIN(__builtin_HEXAGON_M4_or_or,"iiii","")
+BUILTIN(__builtin_HEXAGON_M4_or_xor,"iiii","")
+BUILTIN(__builtin_HEXAGON_S4_or_andix,"iiii","")
+BUILTIN(__builtin_HEXAGON_S4_or_andi,"iiii","")
+BUILTIN(__builtin_HEXAGON_S4_or_ori,"iiii","")
+BUILTIN(__builtin_HEXAGON_M4_xor_and,"iiii","")
+BUILTIN(__builtin_HEXAGON_M4_xor_or,"iiii","")
+BUILTIN(__builtin_HEXAGON_M4_xor_andn,"iiii","")
+BUILTIN(__builtin_HEXAGON_A2_subri,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_andir,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_orir,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_andp,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_orp,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_xorp,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_notp,"LLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_sxtw,"LLii","")
+BUILTIN(__builtin_HEXAGON_A2_sat,"iLLi","")
+BUILTIN(__builtin_HEXAGON_A2_roundsat,"iLLi","")
+BUILTIN(__builtin_HEXAGON_A2_sath,"ii","")
+BUILTIN(__builtin_HEXAGON_A2_satuh,"ii","")
+BUILTIN(__builtin_HEXAGON_A2_satub,"ii","")
+BUILTIN(__builtin_HEXAGON_A2_satb,"ii","")
+BUILTIN(__builtin_HEXAGON_A2_vaddub,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vaddb_map,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vaddubs,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vaddh,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vaddhs,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vadduhs,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A5_vaddhubs,"iLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vaddw,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vaddws,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_S4_vxaddsubw,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_S4_vxsubaddw,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_S4_vxaddsubh,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_S4_vxsubaddh,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_S4_vxaddsubhr,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_S4_vxsubaddhr,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_svavgh,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_svavghs,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_svnavgh,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_svaddh,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_svaddhs,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_svadduhs,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_svsubh,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_svsubhs,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_svsubuhs,"iii","")
+BUILTIN(__builtin_HEXAGON_A2_vraddub,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vraddub_acc,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_vraddh,"iLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_vradduh,"iLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vsubub,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vsubb_map,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vsububs,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vsubh,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vsubhs,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vsubuhs,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vsubw,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vsubws,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vabsh,"LLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vabshsat,"LLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vabsw,"LLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vabswsat,"LLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_vabsdiffw,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_M2_vabsdiffh,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vrsadub,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vrsadub_acc,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vavgub,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vavguh,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vavgh,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vnavgh,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vavgw,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vnavgw,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vavgwr,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vnavgwr,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vavgwcr,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vnavgwcr,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vavghcr,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vnavghcr,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vavguw,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vavguwr,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vavgubr,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vavguhr,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vavghr,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vnavghr,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A4_round_ri,"iii","")
+BUILTIN(__builtin_HEXAGON_A4_round_rr,"iii","")
+BUILTIN(__builtin_HEXAGON_A4_round_ri_sat,"iii","")
+BUILTIN(__builtin_HEXAGON_A4_round_rr_sat,"iii","")
+BUILTIN(__builtin_HEXAGON_A4_cround_ri,"iii","")
+BUILTIN(__builtin_HEXAGON_A4_cround_rr,"iii","")
+BUILTIN(__builtin_HEXAGON_A4_vrminh,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_A4_vrmaxh,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_A4_vrminuh,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_A4_vrmaxuh,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_A4_vrminw,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_A4_vrmaxw,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_A4_vrminuw,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_A4_vrmaxuw,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_A2_vminb,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vmaxb,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vminub,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vmaxub,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vminh,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vmaxh,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vminuh,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vmaxuh,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vminw,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vmaxw,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vminuw,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A2_vmaxuw,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_A4_modwrapu,"iii","")
+BUILTIN(__builtin_HEXAGON_F2_sfadd,"fff","")
+BUILTIN(__builtin_HEXAGON_F2_sfsub,"fff","")
+BUILTIN(__builtin_HEXAGON_F2_sfmpy,"fff","")
+BUILTIN(__builtin_HEXAGON_F2_sffma,"ffff","")
+BUILTIN(__builtin_HEXAGON_F2_sffma_sc,"ffffi","")
+BUILTIN(__builtin_HEXAGON_F2_sffms,"ffff","")
+BUILTIN(__builtin_HEXAGON_F2_sffma_lib,"ffff","")
+BUILTIN(__builtin_HEXAGON_F2_sffms_lib,"ffff","")
+BUILTIN(__builtin_HEXAGON_F2_sfcmpeq,"bff","")
+BUILTIN(__builtin_HEXAGON_F2_sfcmpgt,"bff","")
+BUILTIN(__builtin_HEXAGON_F2_sfcmpge,"bff","")
+BUILTIN(__builtin_HEXAGON_F2_sfcmpuo,"bff","")
+BUILTIN(__builtin_HEXAGON_F2_sfmax,"fff","")
+BUILTIN(__builtin_HEXAGON_F2_sfmin,"fff","")
+BUILTIN(__builtin_HEXAGON_F2_sfclass,"bfi","")
+BUILTIN(__builtin_HEXAGON_F2_sfimm_p,"fi","")
+BUILTIN(__builtin_HEXAGON_F2_sfimm_n,"fi","")
+BUILTIN(__builtin_HEXAGON_F2_sffixupn,"fff","")
+BUILTIN(__builtin_HEXAGON_F2_sffixupd,"fff","")
+BUILTIN(__builtin_HEXAGON_F2_sffixupr,"ff","")
+BUILTIN(__builtin_HEXAGON_F2_dfadd,"ddd","")
+BUILTIN(__builtin_HEXAGON_F2_dfsub,"ddd","")
+BUILTIN(__builtin_HEXAGON_F2_dfmpy,"ddd","")
+BUILTIN(__builtin_HEXAGON_F2_dffma,"dddd","")
+BUILTIN(__builtin_HEXAGON_F2_dffms,"dddd","")
+BUILTIN(__builtin_HEXAGON_F2_dffma_lib,"dddd","")
+BUILTIN(__builtin_HEXAGON_F2_dffms_lib,"dddd","")
+BUILTIN(__builtin_HEXAGON_F2_dffma_sc,"ddddi","")
+BUILTIN(__builtin_HEXAGON_F2_dfmax,"ddd","")
+BUILTIN(__builtin_HEXAGON_F2_dfmin,"ddd","")
+BUILTIN(__builtin_HEXAGON_F2_dfcmpeq,"bdd","")
+BUILTIN(__builtin_HEXAGON_F2_dfcmpgt,"bdd","")
+BUILTIN(__builtin_HEXAGON_F2_dfcmpge,"bdd","")
+BUILTIN(__builtin_HEXAGON_F2_dfcmpuo,"bdd","")
+BUILTIN(__builtin_HEXAGON_F2_dfclass,"bdi","")
+BUILTIN(__builtin_HEXAGON_F2_dfimm_p,"di","")
+BUILTIN(__builtin_HEXAGON_F2_dfimm_n,"di","")
+BUILTIN(__builtin_HEXAGON_F2_dffixupn,"ddd","")
+BUILTIN(__builtin_HEXAGON_F2_dffixupd,"ddd","")
+BUILTIN(__builtin_HEXAGON_F2_dffixupr,"dd","")
+BUILTIN(__builtin_HEXAGON_F2_conv_sf2df,"df","")
+BUILTIN(__builtin_HEXAGON_F2_conv_df2sf,"fd","")
+BUILTIN(__builtin_HEXAGON_F2_conv_uw2sf,"fi","")
+BUILTIN(__builtin_HEXAGON_F2_conv_uw2df,"di","")
+BUILTIN(__builtin_HEXAGON_F2_conv_w2sf,"fi","")
+BUILTIN(__builtin_HEXAGON_F2_conv_w2df,"di","")
+BUILTIN(__builtin_HEXAGON_F2_conv_ud2sf,"fLLi","")
+BUILTIN(__builtin_HEXAGON_F2_conv_ud2df,"dLLi","")
+BUILTIN(__builtin_HEXAGON_F2_conv_d2sf,"fLLi","")
+BUILTIN(__builtin_HEXAGON_F2_conv_d2df,"dLLi","")
+BUILTIN(__builtin_HEXAGON_F2_conv_sf2uw,"if","")
+BUILTIN(__builtin_HEXAGON_F2_conv_sf2w,"if","")
+BUILTIN(__builtin_HEXAGON_F2_conv_sf2ud,"LLif","")
+BUILTIN(__builtin_HEXAGON_F2_conv_sf2d,"LLif","")
+BUILTIN(__builtin_HEXAGON_F2_conv_df2uw,"id","")
+BUILTIN(__builtin_HEXAGON_F2_conv_df2w,"id","")
+BUILTIN(__builtin_HEXAGON_F2_conv_df2ud,"LLid","")
+BUILTIN(__builtin_HEXAGON_F2_conv_df2d,"LLid","")
+BUILTIN(__builtin_HEXAGON_F2_conv_sf2uw_chop,"if","")
+BUILTIN(__builtin_HEXAGON_F2_conv_sf2w_chop,"if","")
+BUILTIN(__builtin_HEXAGON_F2_conv_sf2ud_chop,"LLif","")
+BUILTIN(__builtin_HEXAGON_F2_conv_sf2d_chop,"LLif","")
+BUILTIN(__builtin_HEXAGON_F2_conv_df2uw_chop,"id","")
+BUILTIN(__builtin_HEXAGON_F2_conv_df2w_chop,"id","")
+BUILTIN(__builtin_HEXAGON_F2_conv_df2ud_chop,"LLid","")
+BUILTIN(__builtin_HEXAGON_F2_conv_df2d_chop,"LLid","")
+BUILTIN(__builtin_HEXAGON_S2_asr_r_r,"iii","")
+BUILTIN(__builtin_HEXAGON_S2_asl_r_r,"iii","")
+BUILTIN(__builtin_HEXAGON_S2_lsr_r_r,"iii","")
+BUILTIN(__builtin_HEXAGON_S2_lsl_r_r,"iii","")
+BUILTIN(__builtin_HEXAGON_S2_asr_r_p,"LLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asl_r_p,"LLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_lsr_r_p,"LLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_lsl_r_p,"LLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asr_r_r_acc,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_asl_r_r_acc,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_lsr_r_r_acc,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_lsl_r_r_acc,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_asr_r_p_acc,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asl_r_p_acc,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_lsr_r_p_acc,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_lsl_r_p_acc,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asr_r_r_nac,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_asl_r_r_nac,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_lsr_r_r_nac,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_lsl_r_r_nac,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_asr_r_p_nac,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asl_r_p_nac,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_lsr_r_p_nac,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_lsl_r_p_nac,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asr_r_r_and,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_asl_r_r_and,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_lsr_r_r_and,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_lsl_r_r_and,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_asr_r_r_or,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_asl_r_r_or,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_lsr_r_r_or,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_lsl_r_r_or,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_asr_r_p_and,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asl_r_p_and,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_lsr_r_p_and,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_lsl_r_p_and,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asr_r_p_or,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asl_r_p_or,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_lsr_r_p_or,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_lsl_r_p_or,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asr_r_p_xor,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asl_r_p_xor,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_lsr_r_p_xor,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_lsl_r_p_xor,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asr_r_r_sat,"iii","")
+BUILTIN(__builtin_HEXAGON_S2_asl_r_r_sat,"iii","")
+BUILTIN(__builtin_HEXAGON_S2_asr_i_r,"iii","")
+BUILTIN(__builtin_HEXAGON_S2_lsr_i_r,"iii","")
+BUILTIN(__builtin_HEXAGON_S2_asl_i_r,"iii","")
+BUILTIN(__builtin_HEXAGON_S2_asr_i_p,"LLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_lsr_i_p,"LLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asl_i_p,"LLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asr_i_r_acc,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_lsr_i_r_acc,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_asl_i_r_acc,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_asr_i_p_acc,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_lsr_i_p_acc,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asl_i_p_acc,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asr_i_r_nac,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_lsr_i_r_nac,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_asl_i_r_nac,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_asr_i_p_nac,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_lsr_i_p_nac,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asl_i_p_nac,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_lsr_i_r_xacc,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_asl_i_r_xacc,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_lsr_i_p_xacc,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asl_i_p_xacc,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asr_i_r_and,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_lsr_i_r_and,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_asl_i_r_and,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_asr_i_r_or,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_lsr_i_r_or,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_asl_i_r_or,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_asr_i_p_and,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_lsr_i_p_and,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asl_i_p_and,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asr_i_p_or,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_lsr_i_p_or,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asl_i_p_or,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asl_i_r_sat,"iii","")
+BUILTIN(__builtin_HEXAGON_S2_asr_i_r_rnd,"iii","")
+BUILTIN(__builtin_HEXAGON_S2_asr_i_r_rnd_goodsyntax,"iii","")
+BUILTIN(__builtin_HEXAGON_S2_asr_i_p_rnd,"LLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asr_i_p_rnd_goodsyntax,"LLiLLii","")
+BUILTIN(__builtin_HEXAGON_S4_lsli,"iii","")
+BUILTIN(__builtin_HEXAGON_S2_addasl_rrri,"iiii","")
+BUILTIN(__builtin_HEXAGON_S4_andi_asl_ri,"iiii","")
+BUILTIN(__builtin_HEXAGON_S4_ori_asl_ri,"iiii","")
+BUILTIN(__builtin_HEXAGON_S4_addi_asl_ri,"iiii","")
+BUILTIN(__builtin_HEXAGON_S4_subi_asl_ri,"iiii","")
+BUILTIN(__builtin_HEXAGON_S4_andi_lsr_ri,"iiii","")
+BUILTIN(__builtin_HEXAGON_S4_ori_lsr_ri,"iiii","")
+BUILTIN(__builtin_HEXAGON_S4_addi_lsr_ri,"iiii","")
+BUILTIN(__builtin_HEXAGON_S4_subi_lsr_ri,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_valignib,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_valignrb,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_vspliceib,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_vsplicerb,"LLiLLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_vsplatrh,"LLii","")
+BUILTIN(__builtin_HEXAGON_S2_vsplatrb,"ii","")
+BUILTIN(__builtin_HEXAGON_S2_insert,"iiiii","")
+BUILTIN(__builtin_HEXAGON_S2_tableidxb_goodsyntax,"iiiii","")
+BUILTIN(__builtin_HEXAGON_S2_tableidxh_goodsyntax,"iiiii","")
+BUILTIN(__builtin_HEXAGON_S2_tableidxw_goodsyntax,"iiiii","")
+BUILTIN(__builtin_HEXAGON_S2_tableidxd_goodsyntax,"iiiii","")
+BUILTIN(__builtin_HEXAGON_A4_bitspliti,"LLiii","")
+BUILTIN(__builtin_HEXAGON_A4_bitsplit,"LLiii","")
+BUILTIN(__builtin_HEXAGON_S4_extract,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_extractu,"iiii","")
+BUILTIN(__builtin_HEXAGON_S2_insertp,"LLiLLiLLiii","")
+BUILTIN(__builtin_HEXAGON_S4_extractp,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_S2_extractup,"LLiLLiii","")
+BUILTIN(__builtin_HEXAGON_S2_insert_rp,"iiiLLi","")
+BUILTIN(__builtin_HEXAGON_S4_extract_rp,"iiLLi","")
+BUILTIN(__builtin_HEXAGON_S2_extractu_rp,"iiLLi","")
+BUILTIN(__builtin_HEXAGON_S2_insertp_rp,"LLiLLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_S4_extractp_rp,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_S2_extractup_rp,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_S2_tstbit_i,"bii","")
+BUILTIN(__builtin_HEXAGON_S4_ntstbit_i,"bii","")
+BUILTIN(__builtin_HEXAGON_S2_setbit_i,"iii","")
+BUILTIN(__builtin_HEXAGON_S2_togglebit_i,"iii","")
+BUILTIN(__builtin_HEXAGON_S2_clrbit_i,"iii","")
+BUILTIN(__builtin_HEXAGON_S2_tstbit_r,"bii","")
+BUILTIN(__builtin_HEXAGON_S4_ntstbit_r,"bii","")
+BUILTIN(__builtin_HEXAGON_S2_setbit_r,"iii","")
+BUILTIN(__builtin_HEXAGON_S2_togglebit_r,"iii","")
+BUILTIN(__builtin_HEXAGON_S2_clrbit_r,"iii","")
+BUILTIN(__builtin_HEXAGON_S2_asr_i_vh,"LLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_lsr_i_vh,"LLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asl_i_vh,"LLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asr_r_vh,"LLiLLii","")
+BUILTIN(__builtin_HEXAGON_S5_asrhub_rnd_sat_goodsyntax,"iLLii","")
+BUILTIN(__builtin_HEXAGON_S5_asrhub_sat,"iLLii","")
+BUILTIN(__builtin_HEXAGON_S5_vasrhrnd_goodsyntax,"LLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asl_r_vh,"LLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_lsr_r_vh,"LLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_lsl_r_vh,"LLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asr_i_vw,"LLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asr_i_svw_trun,"iLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asr_r_svw_trun,"iLLii","")
+BUILTIN(__builtin_HEXAGON_S2_lsr_i_vw,"LLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asl_i_vw,"LLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asr_r_vw,"LLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_asl_r_vw,"LLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_lsr_r_vw,"LLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_lsl_r_vw,"LLiLLii","")
+BUILTIN(__builtin_HEXAGON_S2_vrndpackwh,"iLLi","")
+BUILTIN(__builtin_HEXAGON_S2_vrndpackwhs,"iLLi","")
+BUILTIN(__builtin_HEXAGON_S2_vsxtbh,"LLii","")
+BUILTIN(__builtin_HEXAGON_S2_vzxtbh,"LLii","")
+BUILTIN(__builtin_HEXAGON_S2_vsathub,"iLLi","")
+BUILTIN(__builtin_HEXAGON_S2_svsathub,"ii","")
+BUILTIN(__builtin_HEXAGON_S2_svsathb,"ii","")
+BUILTIN(__builtin_HEXAGON_S2_vsathb,"iLLi","")
+BUILTIN(__builtin_HEXAGON_S2_vtrunohb,"iLLi","")
+BUILTIN(__builtin_HEXAGON_S2_vtrunewh,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_S2_vtrunowh,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_S2_vtrunehb,"iLLi","")
+BUILTIN(__builtin_HEXAGON_S2_vsxthw,"LLii","")
+BUILTIN(__builtin_HEXAGON_S2_vzxthw,"LLii","")
+BUILTIN(__builtin_HEXAGON_S2_vsatwh,"iLLi","")
+BUILTIN(__builtin_HEXAGON_S2_vsatwuh,"iLLi","")
+BUILTIN(__builtin_HEXAGON_S2_packhl,"LLiii","")
+BUILTIN(__builtin_HEXAGON_A2_swiz,"ii","")
+BUILTIN(__builtin_HEXAGON_S2_vsathub_nopack,"LLiLLi","")
+BUILTIN(__builtin_HEXAGON_S2_vsathb_nopack,"LLiLLi","")
+BUILTIN(__builtin_HEXAGON_S2_vsatwh_nopack,"LLiLLi","")
+BUILTIN(__builtin_HEXAGON_S2_vsatwuh_nopack,"LLiLLi","")
+BUILTIN(__builtin_HEXAGON_S2_shuffob,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_S2_shuffeb,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_S2_shuffoh,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_S2_shuffeh,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_S5_popcountp,"iLLi","")
+BUILTIN(__builtin_HEXAGON_S4_parity,"iii","")
+BUILTIN(__builtin_HEXAGON_S2_parityp,"iLLiLLi","")
+BUILTIN(__builtin_HEXAGON_S2_lfsp,"LLiLLiLLi","")
+BUILTIN(__builtin_HEXAGON_S2_clbnorm,"ii","")
+BUILTIN(__builtin_HEXAGON_S4_clbaddi,"iii","")
+BUILTIN(__builtin_HEXAGON_S4_clbpnorm,"iLLi","")
+BUILTIN(__builtin_HEXAGON_S4_clbpaddi,"iLLii","")
+BUILTIN(__builtin_HEXAGON_S2_clb,"ii","")
+BUILTIN(__builtin_HEXAGON_S2_cl0,"ii","")
+BUILTIN(__builtin_HEXAGON_S2_cl1,"ii","")
+BUILTIN(__builtin_HEXAGON_S2_clbp,"iLLi","")
+BUILTIN(__builtin_HEXAGON_S2_cl0p,"iLLi","")
+BUILTIN(__builtin_HEXAGON_S2_cl1p,"iLLi","")
+BUILTIN(__builtin_HEXAGON_S2_brev,"ii","")
+BUILTIN(__builtin_HEXAGON_S2_brevp,"LLiLLi","")
+BUILTIN(__builtin_HEXAGON_S2_ct0,"ii","")
+BUILTIN(__builtin_HEXAGON_S2_ct1,"ii","")
+BUILTIN(__builtin_HEXAGON_S2_ct0p,"iLLi","")
+BUILTIN(__builtin_HEXAGON_S2_ct1p,"iLLi","")
+BUILTIN(__builtin_HEXAGON_S2_interleave,"LLiLLi","")
+BUILTIN(__builtin_HEXAGON_S2_deinterleave,"LLiLLi","")
#undef BUILTIN
Modified: cfe/branches/tooling/include/clang/Basic/DiagnosticGroups.td
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Basic/DiagnosticGroups.td?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Basic/DiagnosticGroups.td (original)
+++ cfe/branches/tooling/include/clang/Basic/DiagnosticGroups.td Tue May 15 13:51:08 2012
@@ -25,6 +25,7 @@
def : DiagGroup<"attributes">;
def : DiagGroup<"bad-function-cast">;
def Availability : DiagGroup<"availability">;
+def Section : DiagGroup<"section">;
def AutoImport : DiagGroup<"auto-import">;
def ConstantConversion : DiagGroup<"constant-conversion">;
def LiteralConversion : DiagGroup<"literal-conversion">;
Modified: cfe/branches/tooling/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Basic/DiagnosticSemaKinds.td?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/branches/tooling/include/clang/Basic/DiagnosticSemaKinds.td Tue May 15 13:51:08 2012
@@ -448,7 +448,7 @@
"cannot declare class extension for %0 after class implementation">;
def note_implementation_declared : Note<
"class implementation is declared here">;
-def not_while_in_implementation : Note<
+def note_while_in_implementation : Note<
"detected while default synthesizing properties in class implementation">;
def note_class_declared : Note<
"class is declared here">;
@@ -1545,12 +1545,8 @@
def err_undeclared_nsdictionary : Error<
"NSDictionary must be available to use Objective-C dictionary "
"literals">;
-def err_undeclared_arraywithobjects : Error<
- "declaration of %0 is missing in NSArray class">;
-def err_undeclared_dictwithobjects : Error<
- "declaration of %0 is missing in NSDictionary class">;
-def err_undeclared_nsnumber_method : Error<
- "declaration of %0 is missing in NSNumber class">;
+def err_undeclared_boxing_method : Error<
+ "declaration of %0 is missing in %1 class">;
def err_objc_literal_method_sig : Error<
"literal construction method %0 has incompatible signature">;
def note_objc_literal_method_param : Note<
@@ -1571,10 +1567,14 @@
def err_only_annotate_after_access_spec : Error<
"access specifier can only have annotation attributes">;
+
def err_attribute_section_invalid_for_target : Error<
"argument to 'section' attribute is not valid for this target: %0">;
def err_attribute_section_local_variable : Error<
"'section' attribute is not valid on local variables">;
+def warn_mismatched_section : Warning<
+ "section does not match previous declaration">, InGroup<Section>;
+
def err_attribute_aligned_not_power_of_two : Error<
"requested alignment is not a power of 2">;
def warn_redeclaration_without_attribute_prev_attribute_ignored : Warning<
@@ -1781,8 +1781,7 @@
"implicit truncation from %2 to bitfield changes value from %0 to %1">,
InGroup<ConstantConversion>;
def warn_impcast_literal_float_to_integer : Warning<
- "implicit conversion turns literal floating-point number into integer: "
- "%0 to %1">,
+ "implicit conversion from %0 to %1 changes value from %2 to %3">,
InGroup<LiteralConversion>;
def warn_impcast_string_literal_to_bool : Warning<
"implicit conversion turns string literal into bool: %0 to %1">,
@@ -2024,6 +2023,8 @@
"make %2 equal %1">;
def note_ovl_candidate_substitution_failure : Note<
"candidate template ignored: substitution failure%0%1">;
+def note_ovl_candidate_disabled_by_enable_if : Note<
+ "candidate template ignored: disabled by %0%1">;
// Note that we don't treat templates differently for this diagnostic.
def note_ovl_candidate_arity : Note<"candidate "
@@ -2037,6 +2038,17 @@
"not viable: requires%select{ at least| at most|}2 %3 argument%s3, but %4 "
"%plural{1:was|:were}4 provided">;
+def note_ovl_candidate_arity_one : Note<"candidate "
+ "%select{function|function|constructor|function|function|constructor|"
+ "constructor (the implicit default constructor)|"
+ "constructor (the implicit copy constructor)|"
+ "constructor (the implicit move constructor)|"
+ "function (the implicit copy assignment operator)|"
+ "function (the implicit move assignment operator)|"
+ "constructor (inherited)}0 %select{|template }1not viable: "
+ "%select{requires at least|allows at most single|requires single}2 "
+ "argument %3, but %plural{0:no|:%4}4 arguments were provided">;
+
def note_ovl_candidate_deleted : Note<
"candidate %select{function|function|constructor|"
"function |function |constructor |"
@@ -2732,6 +2744,9 @@
// C++ typename-specifiers
def err_typename_nested_not_found : Error<"no type named %0 in %1">;
+def err_typename_nested_not_found_enable_if : Error<
+ "no type named 'type' in %0; 'enable_if' cannot be used to disable "
+ "this declaration">;
def err_typename_nested_not_type : Error<
"typename specifier refers to non-type member %0 in %1">;
def note_typename_refers_here : Note<
@@ -3008,6 +3023,9 @@
def err_duplicate_member : Error<"duplicate member %0">;
def err_misplaced_ivar : Error<
"ivars may not be placed in %select{categories|class extension}0">;
+def warn_ivars_in_interface : Warning<
+ "declaration of ivars in the interface is deprecated">,
+ InGroup<DiagGroup<"interface-ivars">>, DefaultIgnore;
def ext_enum_value_not_int : Extension<
"ISO C restricts enumerator values to range of 'int' (%0 is too "
"%select{small|large}1)">;
@@ -4553,18 +4571,34 @@
"too few %select{|||execution configuration }0arguments to "
"%select{function|block|method|kernel function}0 call, "
"expected %1, have %2">;
+def err_typecheck_call_too_few_args_one : Error<
+ "too few %select{|||execution configuration }0arguments to "
+ "%select{function|block|method|kernel function}0 call, "
+ "single argument %1 was not specified">;
def err_typecheck_call_too_few_args_at_least : Error<
"too few %select{|||execution configuration }0arguments to "
"%select{function|block|method|kernel function}0 call, "
"expected at least %1, have %2">;
+def err_typecheck_call_too_few_args_at_least_one : Error<
+ "too few %select{|||execution configuration }0arguments to "
+ "%select{function|block|method|kernel function}0 call, "
+ "at least argument %1 must be specified">;
def err_typecheck_call_too_many_args : Error<
"too many %select{|||execution configuration }0arguments to "
"%select{function|block|method|kernel function}0 call, "
"expected %1, have %2">;
+def err_typecheck_call_too_many_args_one : Error<
+ "too many %select{|||execution configuration }0arguments to "
+ "%select{function|block|method|kernel function}0 call, "
+ "expected single argument %1, have %2 arguments">;
def err_typecheck_call_too_many_args_at_most : Error<
"too many %select{|||execution configuration }0arguments to "
"%select{function|block|method|kernel function}0 call, "
"expected at most %1, have %2">;
+def err_typecheck_call_too_many_args_at_most_one : Error<
+ "too many %select{|||execution configuration }0arguments to "
+ "%select{function|block|method|kernel function}0 call, "
+ "expected at most single argument %1, have %2 arguments">;
def note_callee_decl : Note<
"%0 declared here">;
def note_defined_here : Note<"%0 defined here">;
@@ -4960,60 +4994,33 @@
InGroup<CXX98Compat>, DefaultIgnore;
// C++11 defaulted functions
-def err_defaulted_default_ctor_params : Error<
- "an explicitly-defaulted default constructor must have no parameters">;
-def err_defaulted_copy_ctor_params : Error<
- "an explicitly-defaulted copy constructor must have exactly one parameter">;
-def err_defaulted_copy_ctor_volatile_param : Error<
- "the parameter for an explicitly-defaulted copy constructor may not be "
- "volatile">;
-def err_defaulted_copy_ctor_const_param : Error<
- "the parameter for this explicitly-defaulted copy constructor is const, but "
- "a member or base requires it to be non-const">;
-def err_defaulted_copy_assign_params : Error<
- "an explicitly-defaulted copy assignment operator must have exactly one "
- "parameter">;
-def err_defaulted_copy_assign_return_type : Error<
- "an explicitly-defaulted copy assignment operator must return an unqualified "
- "lvalue reference to its class type">;
+def err_defaulted_special_member_params : Error<
+ "an explicitly-defaulted %select{|copy |move }0constructor cannot "
+ "have default arguments">;
+def err_defaulted_special_member_return_type : Error<
+ "explicitly-defaulted %select{copy|move}0 assignment operator must "
+ "return %1">;
+def err_defaulted_special_member_quals : Error<
+ "an explicitly-defaulted %select{copy|move}0 assignment operator may not "
+ "have 'const', 'constexpr' or 'volatile' qualifiers">;
+def err_defaulted_special_member_volatile_param : Error<
+ "the parameter for an explicitly-defaulted %select{<<ERROR>>|"
+ "copy constructor|move constructor|copy assignment operator|"
+ "move assignment operator|<<ERROR>>}0 may not be volatile">;
+def err_defaulted_special_member_move_const_param : Error<
+ "the parameter for an explicitly-defaulted move "
+ "%select{constructor|assignment operator}0 may not be const">;
+def err_defaulted_special_member_copy_const_param : Error<
+ "the parameter for this explicitly-defaulted copy "
+ "%select{constructor|assignment operator}0 is const, but a member or base "
+ "requires it to be non-const">;
+def err_defaulted_special_member_copy_non_const_param : Error<
+ "explicitly-defaulted copy %select{constructor|assignment operator}0 with "
+ "a non-const parameter must be defaulted outside the class, unless a base or "
+ "member requires the parameter to be non-const">;
def err_defaulted_copy_assign_not_ref : Error<
"the parameter for an explicitly-defaulted copy assignment operator must be an "
"lvalue reference type">;
-def err_defaulted_copy_assign_volatile_param : Error<
- "the parameter for an explicitly-defaulted copy assignment operator may not "
- "be volatile">;
-def err_defaulted_copy_assign_const_param : Error<
- "the parameter for this explicitly-defaulted copy assignment operator is "
- "const, but a member or base requires it to be non-const">;
-def err_defaulted_copy_assign_quals : Error<
- "an explicitly-defaulted copy assignment operator may not have 'const', "
- "'constexpr' or 'volatile' qualifiers">;
-def err_defaulted_move_ctor_params : Error<
- "an explicitly-defaulted move constructor must have exactly one parameter">;
-def err_defaulted_move_ctor_volatile_param : Error<
- "the parameter for an explicitly-defaulted move constructor may not be "
- "volatile">;
-def err_defaulted_move_ctor_const_param : Error<
- "the parameter for an explicitly-defaulted move constructor may not be "
- "const">;
-def err_defaulted_move_assign_params : Error<
- "an explicitly-defaulted move assignment operator must have exactly one "
- "parameter">;
-def err_defaulted_move_assign_return_type : Error<
- "an explicitly-defaulted move assignment operator must return an unqualified "
- "lvalue reference to its class type">;
-def err_defaulted_move_assign_not_ref : Error<
- "the parameter for an explicitly-defaulted move assignment operator must be an "
- "rvalue reference type">;
-def err_defaulted_move_assign_volatile_param : Error<
- "the parameter for an explicitly-defaulted move assignment operator may not "
- "be volatile">;
-def err_defaulted_move_assign_const_param : Error<
- "the parameter for an explicitly-defaulted move assignment operator may not "
- "be const">;
-def err_defaulted_move_assign_quals : Error<
- "an explicitly-defaulted move assignment operator may not have 'const', "
- "'constexpr' or 'volatile' qualifiers">;
def err_incorrect_defaulted_exception_spec : Error<
"exception specification of explicitly defaulted %select{default constructor|"
"copy constructor|move constructor|copy assignment operator|move assignment "
Modified: cfe/branches/tooling/include/clang/Basic/LangOptions.def
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Basic/LangOptions.def?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Basic/LangOptions.def (original)
+++ cfe/branches/tooling/include/clang/Basic/LangOptions.def Tue May 15 13:51:08 2012
@@ -157,6 +157,7 @@
"maximum constexpr call depth")
BENIGN_LANGOPT(NumLargeByValueCopy, 32, 0,
"if non-zero, warn about parameter or return Warn if parameter/return value is larger in bytes than this setting. 0 is no check.")
+BENIGN_LANGOPT(BoundsChecking , 8, 0, "if non-zero, add run-time bounds checking code")
VALUE_LANGOPT(MSCVersion, 32, 0,
"version of Microsoft Visual C/C++")
Modified: cfe/branches/tooling/include/clang/Basic/arm_neon.td
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Basic/arm_neon.td?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Basic/arm_neon.td (original)
+++ cfe/branches/tooling/include/clang/Basic/arm_neon.td Tue May 15 13:51:08 2012
@@ -15,6 +15,7 @@
class Op;
def OP_NONE : Op;
+def OP_UNAVAILABLE : Op;
def OP_ADD : Op;
def OP_ADDL : Op;
def OP_ADDW : Op;
Modified: cfe/branches/tooling/include/clang/Driver/Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Driver/Options.td?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Driver/Options.td (original)
+++ cfe/branches/tooling/include/clang/Driver/Options.td Tue May 15 13:51:08 2012
@@ -37,6 +37,7 @@
def clang_i_Group : OptionGroup<"<clang i group>">, Group<i_Group>;
def m_Group : OptionGroup<"<m group>">, Group<CompileOnly_Group>;
def m_x86_Features_Group : OptionGroup<"<m x86 features group>">, Group<m_Group>;
+def m_hexagon_Features_Group : OptionGroup<"<m hexagon features group>">, Group<m_Group>;
def u_Group : OptionGroup<"<u group>">;
def pedantic_Group : OptionGroup<"<pedantic group>">,
@@ -315,6 +316,10 @@
def fbootclasspath_EQ : Joined<"-fbootclasspath=">, Group<f_Group>;
def fborland_extensions : Flag<"-fborland-extensions">, Group<f_Group>, Flags<[CC1Option]>,
HelpText<"Accept non-standard constructs supported by the Borland compiler">;
+def fbounds_checking : Flag<"-fbounds-checking">, Group<f_Group>,
+ HelpText<"Enable run-time bounds checks.">;
+def fbounds_checking_EQ : Joined<"-fbounds-checking=">, Flags<[CC1Option]>,
+ Group<f_Group>;
def fbuiltin_strcat : Flag<"-fbuiltin-strcat">, Group<f_Group>;
def fbuiltin_strcpy : Flag<"-fbuiltin-strcpy">, Group<f_Group>;
def fbuiltin : Flag<"-fbuiltin">, Group<f_Group>;
@@ -1094,6 +1099,7 @@
def _write_dependencies : Flag<"--write-dependencies">, Alias<MD>;
def _write_user_dependencies : Flag<"--write-user-dependencies">, Alias<MMD>;
def _ : Joined<"--">, Flags<[Unsupported]>;
+def mieee_rnd_near : Flag<"-mieee-rnd-near">, Group<m_hexagon_Features_Group>;
// Special internal option to handle -Xlinker --no-demangle.
def Z_Xlinker__no_demangle : Flag<"-Z-Xlinker-no-demangle">,
Modified: cfe/branches/tooling/include/clang/Frontend/DiagnosticRenderer.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Frontend/DiagnosticRenderer.h?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Frontend/DiagnosticRenderer.h (original)
+++ cfe/branches/tooling/include/clang/Frontend/DiagnosticRenderer.h Tue May 15 13:51:08 2012
@@ -43,7 +43,6 @@
/// class.
class DiagnosticRenderer {
protected:
- const SourceManager &SM;
const LangOptions &LangOpts;
const DiagnosticOptions &DiagOpts;
@@ -66,8 +65,7 @@
/// which change the amount of information displayed.
DiagnosticsEngine::Level LastLevel;
- DiagnosticRenderer(const SourceManager &SM,
- const LangOptions &LangOpts,
+ DiagnosticRenderer(const LangOptions &LangOpts,
const DiagnosticOptions &DiagOpts);
virtual ~DiagnosticRenderer();
@@ -76,20 +74,24 @@
DiagnosticsEngine::Level Level,
StringRef Message,
ArrayRef<CharSourceRange> Ranges,
+ const SourceManager *SM,
DiagOrStoredDiag Info) = 0;
virtual void emitDiagnosticLoc(SourceLocation Loc, PresumedLoc PLoc,
DiagnosticsEngine::Level Level,
- ArrayRef<CharSourceRange> Ranges) = 0;
+ ArrayRef<CharSourceRange> Ranges,
+ const SourceManager &SM) = 0;
virtual void emitBasicNote(StringRef Message) = 0;
virtual void emitCodeContext(SourceLocation Loc,
DiagnosticsEngine::Level Level,
SmallVectorImpl<CharSourceRange>& Ranges,
- ArrayRef<FixItHint> Hints) = 0;
+ ArrayRef<FixItHint> Hints,
+ const SourceManager &SM) = 0;
- virtual void emitIncludeLocation(SourceLocation Loc, PresumedLoc PLoc) = 0;
+ virtual void emitIncludeLocation(SourceLocation Loc, PresumedLoc PLoc,
+ const SourceManager &SM) = 0;
virtual void beginDiagnostic(DiagOrStoredDiag D,
DiagnosticsEngine::Level Level) {}
@@ -98,12 +100,14 @@
private:
- void emitIncludeStack(SourceLocation Loc, DiagnosticsEngine::Level Level);
- void emitIncludeStackRecursively(SourceLocation Loc);
+ void emitIncludeStack(SourceLocation Loc, DiagnosticsEngine::Level Level,
+ const SourceManager &SM);
+ void emitIncludeStackRecursively(SourceLocation Loc, const SourceManager &SM);
void emitMacroExpansionsAndCarets(SourceLocation Loc,
DiagnosticsEngine::Level Level,
SmallVectorImpl<CharSourceRange>& Ranges,
ArrayRef<FixItHint> Hints,
+ const SourceManager &SM,
unsigned &MacroDepth,
unsigned OnMacroInst = 0);
public:
@@ -119,9 +123,12 @@
/// \param Message The diagnostic message to emit.
/// \param Ranges The underlined ranges for this code snippet.
/// \param FixItHints The FixIt hints active for this diagnostic.
+ /// \param SM The SourceManager; will be null if the diagnostic came from the
+ /// frontend, thus \param Loc will be invalid.
void emitDiagnostic(SourceLocation Loc, DiagnosticsEngine::Level Level,
StringRef Message, ArrayRef<CharSourceRange> Ranges,
ArrayRef<FixItHint> FixItHints,
+ const SourceManager *SM,
DiagOrStoredDiag D = (Diagnostic *)0);
void emitStoredDiagnostic(StoredDiagnostic &Diag);
@@ -131,19 +138,20 @@
/// notes. It is up to subclasses to further define the behavior.
class DiagnosticNoteRenderer : public DiagnosticRenderer {
public:
- DiagnosticNoteRenderer(const SourceManager &SM,
- const LangOptions &LangOpts,
+ DiagnosticNoteRenderer(const LangOptions &LangOpts,
const DiagnosticOptions &DiagOpts)
- : DiagnosticRenderer(SM, LangOpts, DiagOpts) {}
+ : DiagnosticRenderer(LangOpts, DiagOpts) {}
virtual ~DiagnosticNoteRenderer();
virtual void emitBasicNote(StringRef Message);
virtual void emitIncludeLocation(SourceLocation Loc,
- PresumedLoc PLoc);
+ PresumedLoc PLoc,
+ const SourceManager &SM);
- virtual void emitNote(SourceLocation Loc, StringRef Message) = 0;
+ virtual void emitNote(SourceLocation Loc, StringRef Message,
+ const SourceManager *SM) = 0;
};
} // end clang namespace
#endif
Modified: cfe/branches/tooling/include/clang/Frontend/TextDiagnostic.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Frontend/TextDiagnostic.h?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Frontend/TextDiagnostic.h (original)
+++ cfe/branches/tooling/include/clang/Frontend/TextDiagnostic.h Tue May 15 13:51:08 2012
@@ -39,7 +39,6 @@
public:
TextDiagnostic(raw_ostream &OS,
- const SourceManager &SM,
const LangOptions &LangOpts,
const DiagnosticOptions &DiagOpts);
@@ -83,39 +82,46 @@
DiagnosticsEngine::Level Level,
StringRef Message,
ArrayRef<CharSourceRange> Ranges,
+ const SourceManager *SM,
DiagOrStoredDiag D);
virtual void emitDiagnosticLoc(SourceLocation Loc, PresumedLoc PLoc,
DiagnosticsEngine::Level Level,
- ArrayRef<CharSourceRange> Ranges);
+ ArrayRef<CharSourceRange> Ranges,
+ const SourceManager &SM);
virtual void emitCodeContext(SourceLocation Loc,
DiagnosticsEngine::Level Level,
SmallVectorImpl<CharSourceRange>& Ranges,
- ArrayRef<FixItHint> Hints) {
- emitSnippetAndCaret(Loc, Level, Ranges, Hints);
+ ArrayRef<FixItHint> Hints,
+ const SourceManager &SM) {
+ emitSnippetAndCaret(Loc, Level, Ranges, Hints, SM);
}
virtual void emitBasicNote(StringRef Message);
- virtual void emitIncludeLocation(SourceLocation Loc, PresumedLoc PLoc);
+ virtual void emitIncludeLocation(SourceLocation Loc, PresumedLoc PLoc,
+ const SourceManager &SM);
private:
void emitSnippetAndCaret(SourceLocation Loc, DiagnosticsEngine::Level Level,
SmallVectorImpl<CharSourceRange>& Ranges,
- ArrayRef<FixItHint> Hints);
+ ArrayRef<FixItHint> Hints,
+ const SourceManager &SM);
void emitSnippet(StringRef SourceLine);
void highlightRange(const CharSourceRange &R,
unsigned LineNo, FileID FID,
const SourceColumnMap &map,
- std::string &CaretLine);
+ std::string &CaretLine,
+ const SourceManager &SM);
std::string buildFixItInsertionLine(unsigned LineNo,
const SourceColumnMap &map,
- ArrayRef<FixItHint> Hints);
- void emitParseableFixits(ArrayRef<FixItHint> Hints);
+ ArrayRef<FixItHint> Hints,
+ const SourceManager &SM);
+ void emitParseableFixits(ArrayRef<FixItHint> Hints, const SourceManager &SM);
};
} // end namespace clang
Modified: cfe/branches/tooling/include/clang/Frontend/TextDiagnosticPrinter.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Frontend/TextDiagnosticPrinter.h?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Frontend/TextDiagnosticPrinter.h (original)
+++ cfe/branches/tooling/include/clang/Frontend/TextDiagnosticPrinter.h Tue May 15 13:51:08 2012
@@ -26,9 +26,7 @@
class TextDiagnosticPrinter : public DiagnosticConsumer {
raw_ostream &OS;
- const LangOptions *LangOpts;
const DiagnosticOptions *DiagOpts;
- const SourceManager *SM;
/// \brief Handle to the currently active text diagnostic emitter.
OwningPtr<TextDiagnostic> TextDiag;
Modified: cfe/branches/tooling/include/clang/Lex/Preprocessor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Lex/Preprocessor.h?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Lex/Preprocessor.h (original)
+++ cfe/branches/tooling/include/clang/Lex/Preprocessor.h Tue May 15 13:51:08 2012
@@ -254,6 +254,15 @@
/// encountered (e.g. a file is #included, etc).
PPCallbacks *Callbacks;
+ struct MacroExpandsInfo {
+ Token Tok;
+ MacroInfo *MI;
+ SourceRange Range;
+ MacroExpandsInfo(Token Tok, MacroInfo *MI, SourceRange Range)
+ : Tok(Tok), MI(MI), Range(Range) { }
+ };
+ SmallVector<MacroExpandsInfo, 2> DelayedMacroExpandsCallbacks;
+
/// Macros - For each IdentifierInfo with 'HasMacro' set, we keep a mapping
/// to the actual definition of the macro.
llvm::DenseMap<IdentifierInfo*, MacroInfo*> Macros;
Modified: cfe/branches/tooling/include/clang/Parse/Parser.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Parse/Parser.h?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Parse/Parser.h (original)
+++ cfe/branches/tooling/include/clang/Parse/Parser.h Tue May 15 13:51:08 2012
@@ -1531,7 +1531,7 @@
enum DeclSpecContext {
DSC_normal, // normal context
DSC_class, // class context, enables 'friend'
- DSC_type_specifier, // C++ type-specifier-seq
+ DSC_type_specifier, // C++ type-specifier-seq or C specifier-qualifier-list
DSC_trailing, // C++11 trailing-type-specifier in a trailing return type
DSC_top_level // top-level/namespace declaration context
};
Modified: cfe/branches/tooling/include/clang/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Sema/Sema.h?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Sema/Sema.h (original)
+++ cfe/branches/tooling/include/clang/Sema/Sema.h Tue May 15 13:51:08 2012
@@ -1560,6 +1560,24 @@
TypedefDecl *ParseTypedefDecl(Scope *S, Declarator &D, QualType T,
TypeSourceInfo *TInfo);
bool isIncompatibleTypedef(TypeDecl *Old, TypedefNameDecl *New);
+
+ /// Attribute merging methods. Return true if a new attribute was added.
+ AvailabilityAttr *mergeAvailabilityAttr(Decl *D, SourceRange Range,
+ IdentifierInfo *Platform,
+ VersionTuple Introduced,
+ VersionTuple Deprecated,
+ VersionTuple Obsoleted,
+ bool IsUnavailable,
+ StringRef Message);
+ VisibilityAttr *mergeVisibilityAttr(Decl *D, SourceRange Range,
+ VisibilityAttr::VisibilityType Vis);
+ DLLImportAttr *mergeDLLImportAttr(Decl *D, SourceRange Range);
+ DLLExportAttr *mergeDLLExportAttr(Decl *D, SourceRange Range);
+ FormatAttr *mergeFormatAttr(Decl *D, SourceRange Range, StringRef Format,
+ int FormatIdx, int FirstArg);
+ SectionAttr *mergeSectionAttr(Decl *D, SourceRange Range, StringRef Name);
+ bool mergeDeclAttribute(Decl *New, InheritableAttr *Attr);
+
void mergeDeclAttributes(Decl *New, Decl *Old, bool MergeDeprecation = true);
void MergeTypedefNameDecl(TypedefNameDecl *New, LookupResult &OldDecls);
bool MergeFunctionDecl(FunctionDecl *New, Decl *Old, Scope *S);
@@ -3288,11 +3306,21 @@
ComputedEST = EST_Delayed;
}
- FunctionProtoType::ExtProtoInfo getEPI() const {
- FunctionProtoType::ExtProtoInfo EPI;
+ /// \brief Have we been unable to compute this exception specification?
+ bool isDelayed() {
+ return ComputedEST == EST_Delayed;
+ }
+
+ /// \brief Overwrite an EPI's exception specification with this
+ /// computed exception specification.
+ void getEPI(FunctionProtoType::ExtProtoInfo &EPI) const {
EPI.ExceptionSpecType = getExceptionSpecType();
EPI.NumExceptions = size();
EPI.Exceptions = data();
+ }
+ FunctionProtoType::ExtProtoInfo getEPI() const {
+ FunctionProtoType::ExtProtoInfo EPI;
+ getEPI(EPI);
return EPI;
}
};
@@ -4258,12 +4286,7 @@
Decl *ActOnConversionDeclarator(CXXConversionDecl *Conversion);
void CheckExplicitlyDefaultedMethods(CXXRecordDecl *Record);
- void CheckExplicitlyDefaultedDefaultConstructor(CXXConstructorDecl *Ctor);
- void CheckExplicitlyDefaultedCopyConstructor(CXXConstructorDecl *Ctor);
- void CheckExplicitlyDefaultedCopyAssignment(CXXMethodDecl *Method);
- void CheckExplicitlyDefaultedMoveConstructor(CXXConstructorDecl *Ctor);
- void CheckExplicitlyDefaultedMoveAssignment(CXXMethodDecl *Method);
- void CheckExplicitlyDefaultedDestructor(CXXDestructorDecl *Dtor);
+ void CheckExplicitlyDefaultedSpecialMember(CXXMethodDecl *MD);
//===--------------------------------------------------------------------===//
// C++ Derived Classes
@@ -6174,9 +6197,16 @@
const ObjCMethodDecl *Overridden,
bool IsImplementation);
- /// \brief Check whether the given method overrides any methods in its class,
- /// calling \c CheckObjCMethodOverride for each overridden method.
- bool CheckObjCMethodOverrides(ObjCMethodDecl *NewMethod, DeclContext *DC);
+ /// \brief Describes the compatibility of a result type with its method.
+ enum ResultTypeCompatibilityKind {
+ RTC_Compatible,
+ RTC_Incompatible,
+ RTC_Unknown
+ };
+
+ void CheckObjCMethodOverrides(ObjCMethodDecl *ObjCMethod,
+ ObjCInterfaceDecl *CurrentClass,
+ ResultTypeCompatibilityKind RTC);
enum PragmaOptionsAlignKind {
POAK_Native, // #pragma options align=native
Modified: cfe/branches/tooling/include/clang/Tooling/Tooling.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/include/clang/Tooling/Tooling.h?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/include/clang/Tooling/Tooling.h (original)
+++ cfe/branches/tooling/include/clang/Tooling/Tooling.h Tue May 15 13:51:08 2012
@@ -35,6 +35,7 @@
#include "clang/Basic/FileManager.h"
#include "clang/Basic/LLVM.h"
#include "clang/Driver/Util.h"
+#include "clang/Tooling/ArgumentsAdjusters.h"
#include "clang/Tooling/CompilationDatabase.h"
#include <string>
#include <vector>
@@ -138,6 +139,10 @@
/// \brief Utility to run a FrontendAction over a set of files.
///
/// This class is written to be usable for command line utilities.
+/// By default the class uses ClangSyntaxOnlyAdjuster to modify
+/// command line arguments before the arguments are used to run
+/// a frontend action. One could install another command line
+/// arguments adjuster by call setArgumentsAdjuster() method.
class ClangTool {
public:
/// \brief Constructs a clang tool to run over a list of files.
@@ -155,6 +160,11 @@
/// \param Content A null terminated buffer of the file's content.
void mapVirtualFile(StringRef FilePath, StringRef Content);
+ /// \brief Install command line arguments adjuster.
+ ///
+ /// \param Adjuster Command line arguments adjuster.
+ void setArgumentsAdjuster(ArgumentsAdjuster *Adjuster);
+
/// Runs a frontend action over all files specified in the command line.
///
/// \param ActionFactory Factory generating the frontend actions. The function
@@ -174,6 +184,8 @@
FileManager Files;
// Contains a list of pairs (<file name>, <file content>).
std::vector< std::pair<StringRef, StringRef> > MappedFileContents;
+
+ llvm::OwningPtr<ArgumentsAdjuster> ArgsAdjuster;
};
template <typename T>
Modified: cfe/branches/tooling/lib/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/AST/Decl.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/AST/Decl.cpp (original)
+++ cfe/branches/tooling/lib/AST/Decl.cpp Tue May 15 13:51:08 2012
@@ -158,14 +158,12 @@
return getLVForTemplateArgumentList(TArgs.data(), TArgs.size(), OnlyTemplate);
}
-static bool shouldConsiderTemplateLV(const FunctionDecl *fn,
- const FunctionTemplateSpecializationInfo *spec) {
- return !(spec->isExplicitSpecialization() &&
- fn->hasAttr<VisibilityAttr>());
+static bool shouldConsiderTemplateLV(const FunctionDecl *fn) {
+ return !fn->hasAttr<VisibilityAttr>();
}
static bool shouldConsiderTemplateLV(const ClassTemplateSpecializationDecl *d) {
- return !(d->isExplicitSpecialization() && d->hasAttr<VisibilityAttr>());
+ return !d->hasAttr<VisibilityAttr>();
}
static LinkageInfo getLVForNamespaceScopeDecl(const NamedDecl *D,
@@ -376,7 +374,7 @@
// this is an explicit specialization with a visibility attribute.
if (FunctionTemplateSpecializationInfo *specInfo
= Function->getTemplateSpecializationInfo()) {
- if (shouldConsiderTemplateLV(Function, specInfo)) {
+ if (shouldConsiderTemplateLV(Function)) {
LV.merge(getLVForDecl(specInfo->getTemplate(),
true));
const TemplateArgumentList &templateArgs = *specInfo->TemplateArguments;
@@ -407,8 +405,8 @@
// The arguments at which the template was instantiated.
const TemplateArgumentList &TemplateArgs = spec->getTemplateArgs();
- LV.merge(getLVForTemplateArgumentList(TemplateArgs,
- OnlyTemplate));
+ LV.mergeWithMin(getLVForTemplateArgumentList(TemplateArgs,
+ OnlyTemplate));
}
}
@@ -527,7 +525,7 @@
// the template parameters and arguments.
if (FunctionTemplateSpecializationInfo *spec
= MD->getTemplateSpecializationInfo()) {
- if (shouldConsiderTemplateLV(MD, spec)) {
+ if (shouldConsiderTemplateLV(MD)) {
LV.mergeWithMin(getLVForTemplateArgumentList(*spec->TemplateArguments,
OnlyTemplate));
if (!OnlyTemplate)
Modified: cfe/branches/tooling/lib/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/AST/Expr.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/AST/Expr.cpp (original)
+++ cfe/branches/tooling/lib/AST/Expr.cpp Tue May 15 13:51:08 2012
@@ -708,8 +708,8 @@
LangOpts.Trigraphs = true;
// Create a lexer starting at the beginning of this token.
- Lexer TheLexer(StrTokSpellingLoc, Features, Buffer.begin(), StrData,
- Buffer.end());
+ Lexer TheLexer(SM.getLocForStartOfFile(LocInfo.first), Features,
+ Buffer.begin(), StrData, Buffer.end());
Token TheTok;
TheLexer.LexFromRawLexer(TheTok);
Modified: cfe/branches/tooling/lib/AST/ItaniumMangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/AST/ItaniumMangle.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/AST/ItaniumMangle.cpp (original)
+++ cfe/branches/tooling/lib/AST/ItaniumMangle.cpp Tue May 15 13:51:08 2012
@@ -1892,12 +1892,23 @@
}
// <type> ::= <function-type>
-// <function-type> ::= F [Y] <bare-function-type> E
+// <function-type> ::= [<CV-qualifiers>] F [Y]
+// <bare-function-type> [<ref-qualifier>] E
+// (Proposal to cxx-abi-dev, 2012-05-11)
void CXXNameMangler::mangleType(const FunctionProtoType *T) {
+ // Mangle CV-qualifiers, if present. These are 'this' qualifiers,
+ // e.g. "const" in "int (A::*)() const".
+ mangleQualifiers(Qualifiers::fromCVRMask(T->getTypeQuals()));
+
Out << 'F';
+
// FIXME: We don't have enough information in the AST to produce the 'Y'
// encoding for extern "C" function types.
mangleBareFunctionType(T, /*MangleReturnType=*/true);
+
+ // Mangle the ref-qualifier, if present.
+ mangleRefQualifier(T->getRefQualifier());
+
Out << 'E';
}
void CXXNameMangler::mangleType(const FunctionNoProtoType *T) {
@@ -1990,8 +2001,6 @@
mangleType(QualType(T->getClass(), 0));
QualType PointeeType = T->getPointeeType();
if (const FunctionProtoType *FPT = dyn_cast<FunctionProtoType>(PointeeType)) {
- mangleQualifiers(Qualifiers::fromCVRMask(FPT->getTypeQuals()));
- mangleRefQualifier(FPT->getRefQualifier());
mangleType(FPT);
// Itanium C++ ABI 5.1.8:
@@ -2005,9 +2014,11 @@
// which the function is a member is considered part of the type of
// function.
+ // Given that we already substitute member function pointers as a
+ // whole, the net effect of this rule is just to unconditionally
+ // suppress substitution on the function type in a member pointer.
// We increment the SeqID here to emulate adding an entry to the
- // substitution table. We can't actually add it because we don't want this
- // particular function type to be substituted.
+ // substitution table.
++SeqID;
} else
mangleType(PointeeType);
Modified: cfe/branches/tooling/lib/AST/NSAPI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/AST/NSAPI.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/AST/NSAPI.cpp (original)
+++ cfe/branches/tooling/lib/AST/NSAPI.cpp Tue May 15 13:51:08 2012
@@ -13,7 +13,7 @@
using namespace clang;
NSAPI::NSAPI(ASTContext &ctx)
- : Ctx(ctx), ClassIds() {
+ : Ctx(ctx), ClassIds(), BOOLId(0), NSIntegerId(0), NSUIntegerId(0) {
}
IdentifierInfo *NSAPI::getNSClassId(NSClassIdKindKind K) const {
@@ -251,11 +251,22 @@
}
llvm::Optional<NSAPI::NSNumberLiteralMethodKind>
-NSAPI::getNSNumberFactoryMethodKind(QualType T) {
+NSAPI::getNSNumberFactoryMethodKind(QualType T) const {
const BuiltinType *BT = T->getAs<BuiltinType>();
if (!BT)
return llvm::Optional<NSAPI::NSNumberLiteralMethodKind>();
-
+
+ const TypedefType *TDT = T->getAs<TypedefType>();
+ if (TDT) {
+ QualType TDTTy = QualType(TDT, 0);
+ if (isObjCBOOLType(TDTTy))
+ return NSAPI::NSNumberWithBool;
+ if (isObjCNSIntegerType(TDTTy))
+ return NSAPI::NSNumberWithInteger;
+ if (isObjCNSUIntegerType(TDTTy))
+ return NSAPI::NSNumberWithUnsignedInteger;
+ }
+
switch (BT->getKind()) {
case BuiltinType::Char_S:
case BuiltinType::SChar:
@@ -310,3 +321,35 @@
return llvm::Optional<NSAPI::NSNumberLiteralMethodKind>();
}
+
+/// \brief Returns true if \param T is a typedef of "BOOL" in objective-c.
+bool NSAPI::isObjCBOOLType(QualType T) const {
+ return isObjCTypedef(T, "BOOL", BOOLId);
+}
+/// \brief Returns true if \param T is a typedef of "NSInteger" in objective-c.
+bool NSAPI::isObjCNSIntegerType(QualType T) const {
+ return isObjCTypedef(T, "NSInteger", NSIntegerId);
+}
+/// \brief Returns true if \param T is a typedef of "NSUInteger" in objective-c.
+bool NSAPI::isObjCNSUIntegerType(QualType T) const {
+ return isObjCTypedef(T, "NSUInteger", NSUIntegerId);
+}
+
+bool NSAPI::isObjCTypedef(QualType T,
+ StringRef name, IdentifierInfo *&II) const {
+ if (!Ctx.getLangOpts().ObjC1)
+ return false;
+ if (T.isNull())
+ return false;
+
+ if (!II)
+ II = &Ctx.Idents.get(name);
+
+ while (const TypedefType *TDT = T->getAs<TypedefType>()) {
+ if (TDT->getDecl()->getDeclName().getAsIdentifierInfo() == II)
+ return true;
+ T = TDT->desugar();
+ }
+
+ return false;
+}
Modified: cfe/branches/tooling/lib/AST/StmtDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/AST/StmtDumper.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/AST/StmtDumper.cpp (original)
+++ cfe/branches/tooling/lib/AST/StmtDumper.cpp Tue May 15 13:51:08 2012
@@ -166,6 +166,7 @@
void VisitObjCAtCatchStmt(ObjCAtCatchStmt *Node);
void VisitObjCEncodeExpr(ObjCEncodeExpr *Node);
void VisitObjCMessageExpr(ObjCMessageExpr* Node);
+ void VisitObjCBoxedExpr(ObjCBoxedExpr* Node);
void VisitObjCSelectorExpr(ObjCSelectorExpr *Node);
void VisitObjCProtocolExpr(ObjCProtocolExpr *Node);
void VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *Node);
@@ -637,6 +638,11 @@
}
}
+void StmtDumper::VisitObjCBoxedExpr(ObjCBoxedExpr* Node) {
+ DumpExpr(Node);
+ OS << " selector=" << Node->getBoxingMethod()->getSelector().getAsString();
+}
+
void StmtDumper::VisitObjCAtCatchStmt(ObjCAtCatchStmt *Node) {
DumpStmt(Node);
if (VarDecl *CatchParam = Node->getCatchParamDecl()) {
Modified: cfe/branches/tooling/lib/AST/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/AST/Type.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/AST/Type.cpp (original)
+++ cfe/branches/tooling/lib/AST/Type.cpp Tue May 15 13:51:08 2012
@@ -288,6 +288,28 @@
return T;
}
+/// \brief This will check for a TypedefType by removing any existing sugar
+/// until it reaches a TypedefType or a non-sugared type.
+template <> const TypedefType *Type::getAs() const {
+ const Type *Cur = this;
+
+ while (true) {
+ if (const TypedefType *TDT = dyn_cast<TypedefType>(Cur))
+ return TDT;
+ switch (Cur->getTypeClass()) {
+#define ABSTRACT_TYPE(Class, Parent)
+#define TYPE(Class, Parent) \
+ case Class: { \
+ const Class##Type *Ty = cast<Class##Type>(Cur); \
+ if (!Ty->isSugared()) return 0; \
+ Cur = Ty->desugar().getTypePtr(); \
+ break; \
+ }
+#include "clang/AST/TypeNodes.def"
+ }
+ }
+}
+
/// getUnqualifiedDesugaredType - Pull any qualifiers and syntactic
/// sugar off the given type. This should produce an object of the
/// same dynamic type as the canonical type.
Modified: cfe/branches/tooling/lib/Analysis/FormatString.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Analysis/FormatString.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Analysis/FormatString.cpp (original)
+++ cfe/branches/tooling/lib/Analysis/FormatString.cpp Tue May 15 13:51:08 2012
@@ -265,10 +265,9 @@
break;
case BuiltinType::Char_S:
case BuiltinType::SChar:
- return T == C.UnsignedCharTy;
case BuiltinType::Char_U:
case BuiltinType::UChar:
- return T == C.SignedCharTy;
+ return T == C.UnsignedCharTy || T == C.SignedCharTy;
case BuiltinType::Short:
return T == C.UnsignedShortTy;
case BuiltinType::UShort:
Modified: cfe/branches/tooling/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Basic/Targets.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Basic/Targets.cpp (original)
+++ cfe/branches/tooling/lib/Basic/Targets.cpp Tue May 15 13:51:08 2012
@@ -3015,8 +3015,8 @@
HexagonTargetInfo(const std::string& triple) : TargetInfo(triple) {
BigEndian = false;
DescriptionString = ("e-p:32:32:32-"
- "i64:64:64-i32:32:32-"
- "i16:16:16-i1:32:32-a:0:0");
+ "i64:64:64-i32:32:32-i16:16:16-i1:32:32"
+ "f64:64:64-f32:32:32-a0:0-n32");
// {} in inline assembly are packet specifiers, not assembly variant
// specifiers.
@@ -3057,6 +3057,7 @@
.Case("hexagonv2", "2")
.Case("hexagonv3", "3")
.Case("hexagonv4", "4")
+ .Case("hexagonv5", "5")
.Default(0);
}
@@ -3111,6 +3112,14 @@
Builder.defineMacro("__QDSP6_ARCH__", "4");
}
}
+ else if(CPU == "hexagonv5") {
+ Builder.defineMacro("__HEXAGON_V5__");
+ Builder.defineMacro("__HEXAGON_ARCH__", "5");
+ if(Opts.HexagonQdsp6Compat) {
+ Builder.defineMacro("__QDSP6_V5__");
+ Builder.defineMacro("__QDSP6_ARCH__", "5");
+ }
+ }
}
const char * const HexagonTargetInfo::GCCRegNames[] = {
Modified: cfe/branches/tooling/lib/CodeGen/CGBuiltin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/CGBuiltin.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/branches/tooling/lib/CodeGen/CGBuiltin.cpp Tue May 15 13:51:08 2012
@@ -346,11 +346,12 @@
assert(CI);
uint64_t val = CI->getZExtValue();
CI = ConstantInt::get(Builder.getInt1Ty(), (val & 0x2) >> 1);
+ Value *Runtime = Builder.getInt32(0); // FIXME: use BoundsChecking here?
Value *F = CGM.getIntrinsic(Intrinsic::objectsize, ResType);
- return RValue::get(Builder.CreateCall2(F,
+ return RValue::get(Builder.CreateCall3(F,
EmitScalarExpr(E->getArg(0)),
- CI));
+ CI, Runtime));
}
case Builtin::BI__builtin_prefetch: {
Value *Locality, *RW, *Address = EmitScalarExpr(E->getArg(0));
@@ -2463,6 +2464,18 @@
switch (BuiltinID) {
default: return 0;
+// The builtins below are not autogenerated from iset.py.
+// Make sure you do not overwrite these.
+
+ case Hexagon::BI__builtin_SI_to_SXTHI_asrh:
+ ID = Intrinsic::hexagon_SI_to_SXTHI_asrh; break;
+
+ case Hexagon::BI__builtin_circ_ldd:
+ ID = Intrinsic::hexagon_circ_ldd; break;
+
+// The builtins above are not autogenerated from iset.py.
+// Make sure you do not overwrite these.
+
case Hexagon::BI__builtin_HEXAGON_C2_cmpeq:
ID = Intrinsic::hexagon_C2_cmpeq; break;
@@ -2481,12 +2494,30 @@
case Hexagon::BI__builtin_HEXAGON_C2_cmpgtup:
ID = Intrinsic::hexagon_C2_cmpgtup; break;
+ case Hexagon::BI__builtin_HEXAGON_A4_rcmpeqi:
+ ID = Intrinsic::hexagon_A4_rcmpeqi; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_rcmpneqi:
+ ID = Intrinsic::hexagon_A4_rcmpneqi; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_rcmpeq:
+ ID = Intrinsic::hexagon_A4_rcmpeq; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_rcmpneq:
+ ID = Intrinsic::hexagon_A4_rcmpneq; break;
+
case Hexagon::BI__builtin_HEXAGON_C2_bitsset:
ID = Intrinsic::hexagon_C2_bitsset; break;
case Hexagon::BI__builtin_HEXAGON_C2_bitsclr:
ID = Intrinsic::hexagon_C2_bitsclr; break;
+ case Hexagon::BI__builtin_HEXAGON_C4_nbitsset:
+ ID = Intrinsic::hexagon_C4_nbitsset; break;
+
+ case Hexagon::BI__builtin_HEXAGON_C4_nbitsclr:
+ ID = Intrinsic::hexagon_C4_nbitsclr; break;
+
case Hexagon::BI__builtin_HEXAGON_C2_cmpeqi:
ID = Intrinsic::hexagon_C2_cmpeqi; break;
@@ -2511,6 +2542,27 @@
case Hexagon::BI__builtin_HEXAGON_C2_bitsclri:
ID = Intrinsic::hexagon_C2_bitsclri; break;
+ case Hexagon::BI__builtin_HEXAGON_C4_nbitsclri:
+ ID = Intrinsic::hexagon_C4_nbitsclri; break;
+
+ case Hexagon::BI__builtin_HEXAGON_C4_cmpneqi:
+ ID = Intrinsic::hexagon_C4_cmpneqi; break;
+
+ case Hexagon::BI__builtin_HEXAGON_C4_cmpltei:
+ ID = Intrinsic::hexagon_C4_cmpltei; break;
+
+ case Hexagon::BI__builtin_HEXAGON_C4_cmplteui:
+ ID = Intrinsic::hexagon_C4_cmplteui; break;
+
+ case Hexagon::BI__builtin_HEXAGON_C4_cmpneq:
+ ID = Intrinsic::hexagon_C4_cmpneq; break;
+
+ case Hexagon::BI__builtin_HEXAGON_C4_cmplte:
+ ID = Intrinsic::hexagon_C4_cmplte; break;
+
+ case Hexagon::BI__builtin_HEXAGON_C4_cmplteu:
+ ID = Intrinsic::hexagon_C4_cmplteu; break;
+
case Hexagon::BI__builtin_HEXAGON_C2_and:
ID = Intrinsic::hexagon_C2_and; break;
@@ -2529,6 +2581,30 @@
case Hexagon::BI__builtin_HEXAGON_C2_orn:
ID = Intrinsic::hexagon_C2_orn; break;
+ case Hexagon::BI__builtin_HEXAGON_C4_and_and:
+ ID = Intrinsic::hexagon_C4_and_and; break;
+
+ case Hexagon::BI__builtin_HEXAGON_C4_and_or:
+ ID = Intrinsic::hexagon_C4_and_or; break;
+
+ case Hexagon::BI__builtin_HEXAGON_C4_or_and:
+ ID = Intrinsic::hexagon_C4_or_and; break;
+
+ case Hexagon::BI__builtin_HEXAGON_C4_or_or:
+ ID = Intrinsic::hexagon_C4_or_or; break;
+
+ case Hexagon::BI__builtin_HEXAGON_C4_and_andn:
+ ID = Intrinsic::hexagon_C4_and_andn; break;
+
+ case Hexagon::BI__builtin_HEXAGON_C4_and_orn:
+ ID = Intrinsic::hexagon_C4_and_orn; break;
+
+ case Hexagon::BI__builtin_HEXAGON_C4_or_andn:
+ ID = Intrinsic::hexagon_C4_or_andn; break;
+
+ case Hexagon::BI__builtin_HEXAGON_C4_or_orn:
+ ID = Intrinsic::hexagon_C4_or_orn; break;
+
case Hexagon::BI__builtin_HEXAGON_C2_pxfer_map:
ID = Intrinsic::hexagon_C2_pxfer_map; break;
@@ -2562,9 +2638,42 @@
case Hexagon::BI__builtin_HEXAGON_A2_vcmpbeq:
ID = Intrinsic::hexagon_A2_vcmpbeq; break;
+ case Hexagon::BI__builtin_HEXAGON_A4_vcmpbeqi:
+ ID = Intrinsic::hexagon_A4_vcmpbeqi; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_vcmpbeq_any:
+ ID = Intrinsic::hexagon_A4_vcmpbeq_any; break;
+
case Hexagon::BI__builtin_HEXAGON_A2_vcmpbgtu:
ID = Intrinsic::hexagon_A2_vcmpbgtu; break;
+ case Hexagon::BI__builtin_HEXAGON_A4_vcmpbgtui:
+ ID = Intrinsic::hexagon_A4_vcmpbgtui; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_vcmpbgt:
+ ID = Intrinsic::hexagon_A4_vcmpbgt; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_vcmpbgti:
+ ID = Intrinsic::hexagon_A4_vcmpbgti; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_cmpbeq:
+ ID = Intrinsic::hexagon_A4_cmpbeq; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_cmpbeqi:
+ ID = Intrinsic::hexagon_A4_cmpbeqi; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_cmpbgtu:
+ ID = Intrinsic::hexagon_A4_cmpbgtu; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_cmpbgtui:
+ ID = Intrinsic::hexagon_A4_cmpbgtui; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_cmpbgt:
+ ID = Intrinsic::hexagon_A4_cmpbgt; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_cmpbgti:
+ ID = Intrinsic::hexagon_A4_cmpbgti; break;
+
case Hexagon::BI__builtin_HEXAGON_A2_vcmpheq:
ID = Intrinsic::hexagon_A2_vcmpheq; break;
@@ -2574,6 +2683,33 @@
case Hexagon::BI__builtin_HEXAGON_A2_vcmphgtu:
ID = Intrinsic::hexagon_A2_vcmphgtu; break;
+ case Hexagon::BI__builtin_HEXAGON_A4_vcmpheqi:
+ ID = Intrinsic::hexagon_A4_vcmpheqi; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_vcmphgti:
+ ID = Intrinsic::hexagon_A4_vcmphgti; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_vcmphgtui:
+ ID = Intrinsic::hexagon_A4_vcmphgtui; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_cmpheq:
+ ID = Intrinsic::hexagon_A4_cmpheq; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_cmphgt:
+ ID = Intrinsic::hexagon_A4_cmphgt; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_cmphgtu:
+ ID = Intrinsic::hexagon_A4_cmphgtu; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_cmpheqi:
+ ID = Intrinsic::hexagon_A4_cmpheqi; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_cmphgti:
+ ID = Intrinsic::hexagon_A4_cmphgti; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_cmphgtui:
+ ID = Intrinsic::hexagon_A4_cmphgtui; break;
+
case Hexagon::BI__builtin_HEXAGON_A2_vcmpweq:
ID = Intrinsic::hexagon_A2_vcmpweq; break;
@@ -2583,12 +2719,33 @@
case Hexagon::BI__builtin_HEXAGON_A2_vcmpwgtu:
ID = Intrinsic::hexagon_A2_vcmpwgtu; break;
+ case Hexagon::BI__builtin_HEXAGON_A4_vcmpweqi:
+ ID = Intrinsic::hexagon_A4_vcmpweqi; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_vcmpwgti:
+ ID = Intrinsic::hexagon_A4_vcmpwgti; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_vcmpwgtui:
+ ID = Intrinsic::hexagon_A4_vcmpwgtui; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_boundscheck:
+ ID = Intrinsic::hexagon_A4_boundscheck; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_tlbmatch:
+ ID = Intrinsic::hexagon_A4_tlbmatch; break;
+
case Hexagon::BI__builtin_HEXAGON_C2_tfrpr:
ID = Intrinsic::hexagon_C2_tfrpr; break;
case Hexagon::BI__builtin_HEXAGON_C2_tfrrp:
ID = Intrinsic::hexagon_C2_tfrrp; break;
+ case Hexagon::BI__builtin_HEXAGON_C4_fastcorner9:
+ ID = Intrinsic::hexagon_C4_fastcorner9; break;
+
+ case Hexagon::BI__builtin_HEXAGON_C4_fastcorner9_not:
+ ID = Intrinsic::hexagon_C4_fastcorner9_not; break;
+
case Hexagon::BI__builtin_HEXAGON_M2_mpy_acc_hh_s0:
ID = Intrinsic::hexagon_M2_mpy_acc_hh_s0; break;
@@ -3051,12 +3208,27 @@
case Hexagon::BI__builtin_HEXAGON_M2_mpy_up:
ID = Intrinsic::hexagon_M2_mpy_up; break;
+ case Hexagon::BI__builtin_HEXAGON_M2_mpy_up_s1:
+ ID = Intrinsic::hexagon_M2_mpy_up_s1; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M2_mpy_up_s1_sat:
+ ID = Intrinsic::hexagon_M2_mpy_up_s1_sat; break;
+
case Hexagon::BI__builtin_HEXAGON_M2_mpyu_up:
ID = Intrinsic::hexagon_M2_mpyu_up; break;
+ case Hexagon::BI__builtin_HEXAGON_M2_mpysu_up:
+ ID = Intrinsic::hexagon_M2_mpysu_up; break;
+
case Hexagon::BI__builtin_HEXAGON_M2_dpmpyss_rnd_s0:
ID = Intrinsic::hexagon_M2_dpmpyss_rnd_s0; break;
+ case Hexagon::BI__builtin_HEXAGON_M4_mac_up_s1_sat:
+ ID = Intrinsic::hexagon_M4_mac_up_s1_sat; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M4_nac_up_s1_sat:
+ ID = Intrinsic::hexagon_M4_nac_up_s1_sat; break;
+
case Hexagon::BI__builtin_HEXAGON_M2_mpyi:
ID = Intrinsic::hexagon_M2_mpyi; break;
@@ -3081,6 +3253,21 @@
case Hexagon::BI__builtin_HEXAGON_M2_subacc:
ID = Intrinsic::hexagon_M2_subacc; break;
+ case Hexagon::BI__builtin_HEXAGON_M4_mpyrr_addr:
+ ID = Intrinsic::hexagon_M4_mpyrr_addr; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M4_mpyri_addr_u2:
+ ID = Intrinsic::hexagon_M4_mpyri_addr_u2; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M4_mpyri_addr:
+ ID = Intrinsic::hexagon_M4_mpyri_addr; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M4_mpyri_addi:
+ ID = Intrinsic::hexagon_M4_mpyri_addi; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M4_mpyrr_addi:
+ ID = Intrinsic::hexagon_M4_mpyrr_addi; break;
+
case Hexagon::BI__builtin_HEXAGON_M2_vmpy2s_s0:
ID = Intrinsic::hexagon_M2_vmpy2s_s0; break;
@@ -3093,6 +3280,18 @@
case Hexagon::BI__builtin_HEXAGON_M2_vmac2s_s1:
ID = Intrinsic::hexagon_M2_vmac2s_s1; break;
+ case Hexagon::BI__builtin_HEXAGON_M2_vmpy2su_s0:
+ ID = Intrinsic::hexagon_M2_vmpy2su_s0; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M2_vmpy2su_s1:
+ ID = Intrinsic::hexagon_M2_vmpy2su_s1; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M2_vmac2su_s0:
+ ID = Intrinsic::hexagon_M2_vmac2su_s0; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M2_vmac2su_s1:
+ ID = Intrinsic::hexagon_M2_vmac2su_s1; break;
+
case Hexagon::BI__builtin_HEXAGON_M2_vmpy2s_s0pack:
ID = Intrinsic::hexagon_M2_vmpy2s_s0pack; break;
@@ -3129,6 +3328,36 @@
case Hexagon::BI__builtin_HEXAGON_M2_vdmpyrs_s1:
ID = Intrinsic::hexagon_M2_vdmpyrs_s1; break;
+ case Hexagon::BI__builtin_HEXAGON_M5_vrmpybuu:
+ ID = Intrinsic::hexagon_M5_vrmpybuu; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M5_vrmacbuu:
+ ID = Intrinsic::hexagon_M5_vrmacbuu; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M5_vrmpybsu:
+ ID = Intrinsic::hexagon_M5_vrmpybsu; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M5_vrmacbsu:
+ ID = Intrinsic::hexagon_M5_vrmacbsu; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M5_vmpybuu:
+ ID = Intrinsic::hexagon_M5_vmpybuu; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M5_vmpybsu:
+ ID = Intrinsic::hexagon_M5_vmpybsu; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M5_vmacbuu:
+ ID = Intrinsic::hexagon_M5_vmacbuu; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M5_vmacbsu:
+ ID = Intrinsic::hexagon_M5_vmacbsu; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M5_vdmpybsu:
+ ID = Intrinsic::hexagon_M5_vdmpybsu; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M5_vdmacbsu:
+ ID = Intrinsic::hexagon_M5_vdmacbsu; break;
+
case Hexagon::BI__builtin_HEXAGON_M2_vdmacs_s0:
ID = Intrinsic::hexagon_M2_vdmacs_s0; break;
@@ -3246,12 +3475,42 @@
case Hexagon::BI__builtin_HEXAGON_M2_mmpyh_rs1:
ID = Intrinsic::hexagon_M2_mmpyh_rs1; break;
+ case Hexagon::BI__builtin_HEXAGON_M4_vrmpyeh_s0:
+ ID = Intrinsic::hexagon_M4_vrmpyeh_s0; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M4_vrmpyeh_s1:
+ ID = Intrinsic::hexagon_M4_vrmpyeh_s1; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M4_vrmpyeh_acc_s0:
+ ID = Intrinsic::hexagon_M4_vrmpyeh_acc_s0; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M4_vrmpyeh_acc_s1:
+ ID = Intrinsic::hexagon_M4_vrmpyeh_acc_s1; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M4_vrmpyoh_s0:
+ ID = Intrinsic::hexagon_M4_vrmpyoh_s0; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M4_vrmpyoh_s1:
+ ID = Intrinsic::hexagon_M4_vrmpyoh_s1; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M4_vrmpyoh_acc_s0:
+ ID = Intrinsic::hexagon_M4_vrmpyoh_acc_s0; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M4_vrmpyoh_acc_s1:
+ ID = Intrinsic::hexagon_M4_vrmpyoh_acc_s1; break;
+
case Hexagon::BI__builtin_HEXAGON_M2_hmmpyl_rs1:
ID = Intrinsic::hexagon_M2_hmmpyl_rs1; break;
case Hexagon::BI__builtin_HEXAGON_M2_hmmpyh_rs1:
ID = Intrinsic::hexagon_M2_hmmpyh_rs1; break;
+ case Hexagon::BI__builtin_HEXAGON_M2_hmmpyl_s1:
+ ID = Intrinsic::hexagon_M2_hmmpyl_s1; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M2_hmmpyh_s1:
+ ID = Intrinsic::hexagon_M2_hmmpyh_s1; break;
+
case Hexagon::BI__builtin_HEXAGON_M2_mmaculs_s0:
ID = Intrinsic::hexagon_M2_mmaculs_s0; break;
@@ -3336,6 +3595,18 @@
case Hexagon::BI__builtin_HEXAGON_M2_cmpyr_s0:
ID = Intrinsic::hexagon_M2_cmpyr_s0; break;
+ case Hexagon::BI__builtin_HEXAGON_M4_cmpyi_wh:
+ ID = Intrinsic::hexagon_M4_cmpyi_wh; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M4_cmpyr_wh:
+ ID = Intrinsic::hexagon_M4_cmpyr_wh; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M4_cmpyi_whc:
+ ID = Intrinsic::hexagon_M4_cmpyi_whc; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M4_cmpyr_whc:
+ ID = Intrinsic::hexagon_M4_cmpyr_whc; break;
+
case Hexagon::BI__builtin_HEXAGON_M2_vcmpy_s0_sat_i:
ID = Intrinsic::hexagon_M2_vcmpy_s0_sat_i; break;
@@ -3357,6 +3628,30 @@
case Hexagon::BI__builtin_HEXAGON_S2_vcrotate:
ID = Intrinsic::hexagon_S2_vcrotate; break;
+ case Hexagon::BI__builtin_HEXAGON_S4_vrcrotate_acc:
+ ID = Intrinsic::hexagon_S4_vrcrotate_acc; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S4_vrcrotate:
+ ID = Intrinsic::hexagon_S4_vrcrotate; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S2_vcnegh:
+ ID = Intrinsic::hexagon_S2_vcnegh; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S2_vrcnegh:
+ ID = Intrinsic::hexagon_S2_vrcnegh; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M4_pmpyw:
+ ID = Intrinsic::hexagon_M4_pmpyw; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M4_vpmpyh:
+ ID = Intrinsic::hexagon_M4_vpmpyh; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M4_pmpyw_acc:
+ ID = Intrinsic::hexagon_M4_pmpyw_acc; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M4_vpmpyh_acc:
+ ID = Intrinsic::hexagon_M4_vpmpyh_acc; break;
+
case Hexagon::BI__builtin_HEXAGON_A2_add:
ID = Intrinsic::hexagon_A2_add; break;
@@ -3534,6 +3829,12 @@
case Hexagon::BI__builtin_HEXAGON_A2_combinew:
ID = Intrinsic::hexagon_A2_combinew; break;
+ case Hexagon::BI__builtin_HEXAGON_A4_combineri:
+ ID = Intrinsic::hexagon_A4_combineri; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_combineir:
+ ID = Intrinsic::hexagon_A4_combineir; break;
+
case Hexagon::BI__builtin_HEXAGON_A2_combineii:
ID = Intrinsic::hexagon_A2_combineii; break;
@@ -3570,6 +3871,69 @@
case Hexagon::BI__builtin_HEXAGON_M2_xor_xacc:
ID = Intrinsic::hexagon_M2_xor_xacc; break;
+ case Hexagon::BI__builtin_HEXAGON_M4_xor_xacc:
+ ID = Intrinsic::hexagon_M4_xor_xacc; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_andn:
+ ID = Intrinsic::hexagon_A4_andn; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_orn:
+ ID = Intrinsic::hexagon_A4_orn; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_andnp:
+ ID = Intrinsic::hexagon_A4_andnp; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_ornp:
+ ID = Intrinsic::hexagon_A4_ornp; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S4_addaddi:
+ ID = Intrinsic::hexagon_S4_addaddi; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S4_subaddi:
+ ID = Intrinsic::hexagon_S4_subaddi; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M4_and_and:
+ ID = Intrinsic::hexagon_M4_and_and; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M4_and_andn:
+ ID = Intrinsic::hexagon_M4_and_andn; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M4_and_or:
+ ID = Intrinsic::hexagon_M4_and_or; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M4_and_xor:
+ ID = Intrinsic::hexagon_M4_and_xor; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M4_or_and:
+ ID = Intrinsic::hexagon_M4_or_and; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M4_or_andn:
+ ID = Intrinsic::hexagon_M4_or_andn; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M4_or_or:
+ ID = Intrinsic::hexagon_M4_or_or; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M4_or_xor:
+ ID = Intrinsic::hexagon_M4_or_xor; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S4_or_andix:
+ ID = Intrinsic::hexagon_S4_or_andix; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S4_or_andi:
+ ID = Intrinsic::hexagon_S4_or_andi; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S4_or_ori:
+ ID = Intrinsic::hexagon_S4_or_ori; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M4_xor_and:
+ ID = Intrinsic::hexagon_M4_xor_and; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M4_xor_or:
+ ID = Intrinsic::hexagon_M4_xor_or; break;
+
+ case Hexagon::BI__builtin_HEXAGON_M4_xor_andn:
+ ID = Intrinsic::hexagon_M4_xor_andn; break;
+
case Hexagon::BI__builtin_HEXAGON_A2_subri:
ID = Intrinsic::hexagon_A2_subri; break;
@@ -3597,6 +3961,9 @@
case Hexagon::BI__builtin_HEXAGON_A2_sat:
ID = Intrinsic::hexagon_A2_sat; break;
+ case Hexagon::BI__builtin_HEXAGON_A2_roundsat:
+ ID = Intrinsic::hexagon_A2_roundsat; break;
+
case Hexagon::BI__builtin_HEXAGON_A2_sath:
ID = Intrinsic::hexagon_A2_sath; break;
@@ -3612,6 +3979,9 @@
case Hexagon::BI__builtin_HEXAGON_A2_vaddub:
ID = Intrinsic::hexagon_A2_vaddub; break;
+ case Hexagon::BI__builtin_HEXAGON_A2_vaddb_map:
+ ID = Intrinsic::hexagon_A2_vaddb_map; break;
+
case Hexagon::BI__builtin_HEXAGON_A2_vaddubs:
ID = Intrinsic::hexagon_A2_vaddubs; break;
@@ -3624,12 +3994,33 @@
case Hexagon::BI__builtin_HEXAGON_A2_vadduhs:
ID = Intrinsic::hexagon_A2_vadduhs; break;
+ case Hexagon::BI__builtin_HEXAGON_A5_vaddhubs:
+ ID = Intrinsic::hexagon_A5_vaddhubs; break;
+
case Hexagon::BI__builtin_HEXAGON_A2_vaddw:
ID = Intrinsic::hexagon_A2_vaddw; break;
case Hexagon::BI__builtin_HEXAGON_A2_vaddws:
ID = Intrinsic::hexagon_A2_vaddws; break;
+ case Hexagon::BI__builtin_HEXAGON_S4_vxaddsubw:
+ ID = Intrinsic::hexagon_S4_vxaddsubw; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S4_vxsubaddw:
+ ID = Intrinsic::hexagon_S4_vxsubaddw; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S4_vxaddsubh:
+ ID = Intrinsic::hexagon_S4_vxaddsubh; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S4_vxsubaddh:
+ ID = Intrinsic::hexagon_S4_vxsubaddh; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S4_vxaddsubhr:
+ ID = Intrinsic::hexagon_S4_vxaddsubhr; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S4_vxsubaddhr:
+ ID = Intrinsic::hexagon_S4_vxsubaddhr; break;
+
case Hexagon::BI__builtin_HEXAGON_A2_svavgh:
ID = Intrinsic::hexagon_A2_svavgh; break;
@@ -3663,12 +4054,18 @@
case Hexagon::BI__builtin_HEXAGON_A2_vraddub_acc:
ID = Intrinsic::hexagon_A2_vraddub_acc; break;
+ case Hexagon::BI__builtin_HEXAGON_M2_vraddh:
+ ID = Intrinsic::hexagon_M2_vraddh; break;
+
case Hexagon::BI__builtin_HEXAGON_M2_vradduh:
ID = Intrinsic::hexagon_M2_vradduh; break;
case Hexagon::BI__builtin_HEXAGON_A2_vsubub:
ID = Intrinsic::hexagon_A2_vsubub; break;
+ case Hexagon::BI__builtin_HEXAGON_A2_vsubb_map:
+ ID = Intrinsic::hexagon_A2_vsubb_map; break;
+
case Hexagon::BI__builtin_HEXAGON_A2_vsububs:
ID = Intrinsic::hexagon_A2_vsububs; break;
@@ -3765,11 +4162,53 @@
case Hexagon::BI__builtin_HEXAGON_A2_vnavghr:
ID = Intrinsic::hexagon_A2_vnavghr; break;
- case Hexagon::BI__builtin_HEXAGON_A2_vminh:
- ID = Intrinsic::hexagon_A2_vminh; break;
+ case Hexagon::BI__builtin_HEXAGON_A4_round_ri:
+ ID = Intrinsic::hexagon_A4_round_ri; break;
- case Hexagon::BI__builtin_HEXAGON_A2_vmaxh:
- ID = Intrinsic::hexagon_A2_vmaxh; break;
+ case Hexagon::BI__builtin_HEXAGON_A4_round_rr:
+ ID = Intrinsic::hexagon_A4_round_rr; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_round_ri_sat:
+ ID = Intrinsic::hexagon_A4_round_ri_sat; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_round_rr_sat:
+ ID = Intrinsic::hexagon_A4_round_rr_sat; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_cround_ri:
+ ID = Intrinsic::hexagon_A4_cround_ri; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_cround_rr:
+ ID = Intrinsic::hexagon_A4_cround_rr; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_vrminh:
+ ID = Intrinsic::hexagon_A4_vrminh; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_vrmaxh:
+ ID = Intrinsic::hexagon_A4_vrmaxh; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_vrminuh:
+ ID = Intrinsic::hexagon_A4_vrminuh; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_vrmaxuh:
+ ID = Intrinsic::hexagon_A4_vrmaxuh; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_vrminw:
+ ID = Intrinsic::hexagon_A4_vrminw; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_vrmaxw:
+ ID = Intrinsic::hexagon_A4_vrmaxw; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_vrminuw:
+ ID = Intrinsic::hexagon_A4_vrminuw; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_vrmaxuw:
+ ID = Intrinsic::hexagon_A4_vrmaxuw; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A2_vminb:
+ ID = Intrinsic::hexagon_A2_vminb; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A2_vmaxb:
+ ID = Intrinsic::hexagon_A2_vmaxb; break;
case Hexagon::BI__builtin_HEXAGON_A2_vminub:
ID = Intrinsic::hexagon_A2_vminub; break;
@@ -3777,6 +4216,12 @@
case Hexagon::BI__builtin_HEXAGON_A2_vmaxub:
ID = Intrinsic::hexagon_A2_vmaxub; break;
+ case Hexagon::BI__builtin_HEXAGON_A2_vminh:
+ ID = Intrinsic::hexagon_A2_vminh; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A2_vmaxh:
+ ID = Intrinsic::hexagon_A2_vmaxh; break;
+
case Hexagon::BI__builtin_HEXAGON_A2_vminuh:
ID = Intrinsic::hexagon_A2_vminuh; break;
@@ -3795,6 +4240,207 @@
case Hexagon::BI__builtin_HEXAGON_A2_vmaxuw:
ID = Intrinsic::hexagon_A2_vmaxuw; break;
+ case Hexagon::BI__builtin_HEXAGON_A4_modwrapu:
+ ID = Intrinsic::hexagon_A4_modwrapu; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_sfadd:
+ ID = Intrinsic::hexagon_F2_sfadd; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_sfsub:
+ ID = Intrinsic::hexagon_F2_sfsub; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_sfmpy:
+ ID = Intrinsic::hexagon_F2_sfmpy; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_sffma:
+ ID = Intrinsic::hexagon_F2_sffma; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_sffma_sc:
+ ID = Intrinsic::hexagon_F2_sffma_sc; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_sffms:
+ ID = Intrinsic::hexagon_F2_sffms; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_sffma_lib:
+ ID = Intrinsic::hexagon_F2_sffma_lib; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_sffms_lib:
+ ID = Intrinsic::hexagon_F2_sffms_lib; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_sfcmpeq:
+ ID = Intrinsic::hexagon_F2_sfcmpeq; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_sfcmpgt:
+ ID = Intrinsic::hexagon_F2_sfcmpgt; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_sfcmpge:
+ ID = Intrinsic::hexagon_F2_sfcmpge; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_sfcmpuo:
+ ID = Intrinsic::hexagon_F2_sfcmpuo; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_sfmax:
+ ID = Intrinsic::hexagon_F2_sfmax; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_sfmin:
+ ID = Intrinsic::hexagon_F2_sfmin; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_sfclass:
+ ID = Intrinsic::hexagon_F2_sfclass; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_sfimm_p:
+ ID = Intrinsic::hexagon_F2_sfimm_p; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_sfimm_n:
+ ID = Intrinsic::hexagon_F2_sfimm_n; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_sffixupn:
+ ID = Intrinsic::hexagon_F2_sffixupn; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_sffixupd:
+ ID = Intrinsic::hexagon_F2_sffixupd; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_sffixupr:
+ ID = Intrinsic::hexagon_F2_sffixupr; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_dfadd:
+ ID = Intrinsic::hexagon_F2_dfadd; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_dfsub:
+ ID = Intrinsic::hexagon_F2_dfsub; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_dfmpy:
+ ID = Intrinsic::hexagon_F2_dfmpy; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_dffma:
+ ID = Intrinsic::hexagon_F2_dffma; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_dffms:
+ ID = Intrinsic::hexagon_F2_dffms; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_dffma_lib:
+ ID = Intrinsic::hexagon_F2_dffma_lib; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_dffms_lib:
+ ID = Intrinsic::hexagon_F2_dffms_lib; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_dffma_sc:
+ ID = Intrinsic::hexagon_F2_dffma_sc; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_dfmax:
+ ID = Intrinsic::hexagon_F2_dfmax; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_dfmin:
+ ID = Intrinsic::hexagon_F2_dfmin; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_dfcmpeq:
+ ID = Intrinsic::hexagon_F2_dfcmpeq; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_dfcmpgt:
+ ID = Intrinsic::hexagon_F2_dfcmpgt; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_dfcmpge:
+ ID = Intrinsic::hexagon_F2_dfcmpge; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_dfcmpuo:
+ ID = Intrinsic::hexagon_F2_dfcmpuo; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_dfclass:
+ ID = Intrinsic::hexagon_F2_dfclass; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_dfimm_p:
+ ID = Intrinsic::hexagon_F2_dfimm_p; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_dfimm_n:
+ ID = Intrinsic::hexagon_F2_dfimm_n; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_dffixupn:
+ ID = Intrinsic::hexagon_F2_dffixupn; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_dffixupd:
+ ID = Intrinsic::hexagon_F2_dffixupd; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_dffixupr:
+ ID = Intrinsic::hexagon_F2_dffixupr; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_conv_sf2df:
+ ID = Intrinsic::hexagon_F2_conv_sf2df; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_conv_df2sf:
+ ID = Intrinsic::hexagon_F2_conv_df2sf; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_conv_uw2sf:
+ ID = Intrinsic::hexagon_F2_conv_uw2sf; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_conv_uw2df:
+ ID = Intrinsic::hexagon_F2_conv_uw2df; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_conv_w2sf:
+ ID = Intrinsic::hexagon_F2_conv_w2sf; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_conv_w2df:
+ ID = Intrinsic::hexagon_F2_conv_w2df; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_conv_ud2sf:
+ ID = Intrinsic::hexagon_F2_conv_ud2sf; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_conv_ud2df:
+ ID = Intrinsic::hexagon_F2_conv_ud2df; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_conv_d2sf:
+ ID = Intrinsic::hexagon_F2_conv_d2sf; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_conv_d2df:
+ ID = Intrinsic::hexagon_F2_conv_d2df; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_conv_sf2uw:
+ ID = Intrinsic::hexagon_F2_conv_sf2uw; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_conv_sf2w:
+ ID = Intrinsic::hexagon_F2_conv_sf2w; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_conv_sf2ud:
+ ID = Intrinsic::hexagon_F2_conv_sf2ud; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_conv_sf2d:
+ ID = Intrinsic::hexagon_F2_conv_sf2d; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_conv_df2uw:
+ ID = Intrinsic::hexagon_F2_conv_df2uw; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_conv_df2w:
+ ID = Intrinsic::hexagon_F2_conv_df2w; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_conv_df2ud:
+ ID = Intrinsic::hexagon_F2_conv_df2ud; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_conv_df2d:
+ ID = Intrinsic::hexagon_F2_conv_df2d; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_conv_sf2uw_chop:
+ ID = Intrinsic::hexagon_F2_conv_sf2uw_chop; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_conv_sf2w_chop:
+ ID = Intrinsic::hexagon_F2_conv_sf2w_chop; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_conv_sf2ud_chop:
+ ID = Intrinsic::hexagon_F2_conv_sf2ud_chop; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_conv_sf2d_chop:
+ ID = Intrinsic::hexagon_F2_conv_sf2d_chop; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_conv_df2uw_chop:
+ ID = Intrinsic::hexagon_F2_conv_df2uw_chop; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_conv_df2w_chop:
+ ID = Intrinsic::hexagon_F2_conv_df2w_chop; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_conv_df2ud_chop:
+ ID = Intrinsic::hexagon_F2_conv_df2ud_chop; break;
+
+ case Hexagon::BI__builtin_HEXAGON_F2_conv_df2d_chop:
+ ID = Intrinsic::hexagon_F2_conv_df2d_chop; break;
+
case Hexagon::BI__builtin_HEXAGON_S2_asr_r_r:
ID = Intrinsic::hexagon_S2_asr_r_r; break;
@@ -3915,6 +4561,18 @@
case Hexagon::BI__builtin_HEXAGON_S2_lsl_r_p_or:
ID = Intrinsic::hexagon_S2_lsl_r_p_or; break;
+ case Hexagon::BI__builtin_HEXAGON_S2_asr_r_p_xor:
+ ID = Intrinsic::hexagon_S2_asr_r_p_xor; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S2_asl_r_p_xor:
+ ID = Intrinsic::hexagon_S2_asl_r_p_xor; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S2_lsr_r_p_xor:
+ ID = Intrinsic::hexagon_S2_lsr_r_p_xor; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S2_lsl_r_p_xor:
+ ID = Intrinsic::hexagon_S2_lsl_r_p_xor; break;
+
case Hexagon::BI__builtin_HEXAGON_S2_asr_r_r_sat:
ID = Intrinsic::hexagon_S2_asr_r_r_sat; break;
@@ -4032,9 +4690,42 @@
case Hexagon::BI__builtin_HEXAGON_S2_asr_i_r_rnd_goodsyntax:
ID = Intrinsic::hexagon_S2_asr_i_r_rnd_goodsyntax; break;
+ case Hexagon::BI__builtin_HEXAGON_S2_asr_i_p_rnd:
+ ID = Intrinsic::hexagon_S2_asr_i_p_rnd; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S2_asr_i_p_rnd_goodsyntax:
+ ID = Intrinsic::hexagon_S2_asr_i_p_rnd_goodsyntax; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S4_lsli:
+ ID = Intrinsic::hexagon_S4_lsli; break;
+
case Hexagon::BI__builtin_HEXAGON_S2_addasl_rrri:
ID = Intrinsic::hexagon_S2_addasl_rrri; break;
+ case Hexagon::BI__builtin_HEXAGON_S4_andi_asl_ri:
+ ID = Intrinsic::hexagon_S4_andi_asl_ri; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S4_ori_asl_ri:
+ ID = Intrinsic::hexagon_S4_ori_asl_ri; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S4_addi_asl_ri:
+ ID = Intrinsic::hexagon_S4_addi_asl_ri; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S4_subi_asl_ri:
+ ID = Intrinsic::hexagon_S4_subi_asl_ri; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S4_andi_lsr_ri:
+ ID = Intrinsic::hexagon_S4_andi_lsr_ri; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S4_ori_lsr_ri:
+ ID = Intrinsic::hexagon_S4_ori_lsr_ri; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S4_addi_lsr_ri:
+ ID = Intrinsic::hexagon_S4_addi_lsr_ri; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S4_subi_lsr_ri:
+ ID = Intrinsic::hexagon_S4_subi_lsr_ri; break;
+
case Hexagon::BI__builtin_HEXAGON_S2_valignib:
ID = Intrinsic::hexagon_S2_valignib; break;
@@ -4068,30 +4759,51 @@
case Hexagon::BI__builtin_HEXAGON_S2_tableidxd_goodsyntax:
ID = Intrinsic::hexagon_S2_tableidxd_goodsyntax; break;
+ case Hexagon::BI__builtin_HEXAGON_A4_bitspliti:
+ ID = Intrinsic::hexagon_A4_bitspliti; break;
+
+ case Hexagon::BI__builtin_HEXAGON_A4_bitsplit:
+ ID = Intrinsic::hexagon_A4_bitsplit; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S4_extract:
+ ID = Intrinsic::hexagon_S4_extract; break;
+
case Hexagon::BI__builtin_HEXAGON_S2_extractu:
ID = Intrinsic::hexagon_S2_extractu; break;
case Hexagon::BI__builtin_HEXAGON_S2_insertp:
ID = Intrinsic::hexagon_S2_insertp; break;
+ case Hexagon::BI__builtin_HEXAGON_S4_extractp:
+ ID = Intrinsic::hexagon_S4_extractp; break;
+
case Hexagon::BI__builtin_HEXAGON_S2_extractup:
ID = Intrinsic::hexagon_S2_extractup; break;
case Hexagon::BI__builtin_HEXAGON_S2_insert_rp:
ID = Intrinsic::hexagon_S2_insert_rp; break;
+ case Hexagon::BI__builtin_HEXAGON_S4_extract_rp:
+ ID = Intrinsic::hexagon_S4_extract_rp; break;
+
case Hexagon::BI__builtin_HEXAGON_S2_extractu_rp:
ID = Intrinsic::hexagon_S2_extractu_rp; break;
case Hexagon::BI__builtin_HEXAGON_S2_insertp_rp:
ID = Intrinsic::hexagon_S2_insertp_rp; break;
+ case Hexagon::BI__builtin_HEXAGON_S4_extractp_rp:
+ ID = Intrinsic::hexagon_S4_extractp_rp; break;
+
case Hexagon::BI__builtin_HEXAGON_S2_extractup_rp:
ID = Intrinsic::hexagon_S2_extractup_rp; break;
case Hexagon::BI__builtin_HEXAGON_S2_tstbit_i:
ID = Intrinsic::hexagon_S2_tstbit_i; break;
+ case Hexagon::BI__builtin_HEXAGON_S4_ntstbit_i:
+ ID = Intrinsic::hexagon_S4_ntstbit_i; break;
+
case Hexagon::BI__builtin_HEXAGON_S2_setbit_i:
ID = Intrinsic::hexagon_S2_setbit_i; break;
@@ -4104,6 +4816,9 @@
case Hexagon::BI__builtin_HEXAGON_S2_tstbit_r:
ID = Intrinsic::hexagon_S2_tstbit_r; break;
+ case Hexagon::BI__builtin_HEXAGON_S4_ntstbit_r:
+ ID = Intrinsic::hexagon_S4_ntstbit_r; break;
+
case Hexagon::BI__builtin_HEXAGON_S2_setbit_r:
ID = Intrinsic::hexagon_S2_setbit_r; break;
@@ -4125,6 +4840,15 @@
case Hexagon::BI__builtin_HEXAGON_S2_asr_r_vh:
ID = Intrinsic::hexagon_S2_asr_r_vh; break;
+ case Hexagon::BI__builtin_HEXAGON_S5_asrhub_rnd_sat_goodsyntax:
+ ID = Intrinsic::hexagon_S5_asrhub_rnd_sat_goodsyntax; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S5_asrhub_sat:
+ ID = Intrinsic::hexagon_S5_asrhub_sat; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S5_vasrhrnd_goodsyntax:
+ ID = Intrinsic::hexagon_S5_vasrhrnd_goodsyntax; break;
+
case Hexagon::BI__builtin_HEXAGON_S2_asl_r_vh:
ID = Intrinsic::hexagon_S2_asl_r_vh; break;
@@ -4239,6 +4963,12 @@
case Hexagon::BI__builtin_HEXAGON_S2_shuffeh:
ID = Intrinsic::hexagon_S2_shuffeh; break;
+ case Hexagon::BI__builtin_HEXAGON_S5_popcountp:
+ ID = Intrinsic::hexagon_S5_popcountp; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S4_parity:
+ ID = Intrinsic::hexagon_S4_parity; break;
+
case Hexagon::BI__builtin_HEXAGON_S2_parityp:
ID = Intrinsic::hexagon_S2_parityp; break;
@@ -4248,6 +4978,15 @@
case Hexagon::BI__builtin_HEXAGON_S2_clbnorm:
ID = Intrinsic::hexagon_S2_clbnorm; break;
+ case Hexagon::BI__builtin_HEXAGON_S4_clbaddi:
+ ID = Intrinsic::hexagon_S4_clbaddi; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S4_clbpnorm:
+ ID = Intrinsic::hexagon_S4_clbpnorm; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S4_clbpaddi:
+ ID = Intrinsic::hexagon_S4_clbpaddi; break;
+
case Hexagon::BI__builtin_HEXAGON_S2_clb:
ID = Intrinsic::hexagon_S2_clb; break;
@@ -4269,168 +5008,26 @@
case Hexagon::BI__builtin_HEXAGON_S2_brev:
ID = Intrinsic::hexagon_S2_brev; break;
+ case Hexagon::BI__builtin_HEXAGON_S2_brevp:
+ ID = Intrinsic::hexagon_S2_brevp; break;
+
case Hexagon::BI__builtin_HEXAGON_S2_ct0:
ID = Intrinsic::hexagon_S2_ct0; break;
case Hexagon::BI__builtin_HEXAGON_S2_ct1:
ID = Intrinsic::hexagon_S2_ct1; break;
+ case Hexagon::BI__builtin_HEXAGON_S2_ct0p:
+ ID = Intrinsic::hexagon_S2_ct0p; break;
+
+ case Hexagon::BI__builtin_HEXAGON_S2_ct1p:
+ ID = Intrinsic::hexagon_S2_ct1p; break;
+
case Hexagon::BI__builtin_HEXAGON_S2_interleave:
ID = Intrinsic::hexagon_S2_interleave; break;
case Hexagon::BI__builtin_HEXAGON_S2_deinterleave:
ID = Intrinsic::hexagon_S2_deinterleave; break;
-
- case Hexagon::BI__builtin_SI_to_SXTHI_asrh:
- ID = Intrinsic::hexagon_SI_to_SXTHI_asrh; break;
-
- case Hexagon::BI__builtin_HEXAGON_A4_orn:
- ID = Intrinsic::hexagon_A4_orn; break;
-
- case Hexagon::BI__builtin_HEXAGON_A4_andn:
- ID = Intrinsic::hexagon_A4_andn; break;
-
- case Hexagon::BI__builtin_HEXAGON_A4_ornp:
- ID = Intrinsic::hexagon_A4_ornp; break;
-
- case Hexagon::BI__builtin_HEXAGON_A4_andnp:
- ID = Intrinsic::hexagon_A4_andnp; break;
-
- case Hexagon::BI__builtin_HEXAGON_A4_combineir:
- ID = Intrinsic::hexagon_A4_combineir; break;
-
- case Hexagon::BI__builtin_HEXAGON_A4_combineri:
- ID = Intrinsic::hexagon_A4_combineri; break;
-
- case Hexagon::BI__builtin_HEXAGON_C4_cmpneqi:
- ID = Intrinsic::hexagon_C4_cmpneqi; break;
-
- case Hexagon::BI__builtin_HEXAGON_C4_cmpneq:
- ID = Intrinsic::hexagon_C4_cmpneq; break;
-
- case Hexagon::BI__builtin_HEXAGON_C4_cmpltei:
- ID = Intrinsic::hexagon_C4_cmpltei; break;
-
- case Hexagon::BI__builtin_HEXAGON_C4_cmplte:
- ID = Intrinsic::hexagon_C4_cmplte; break;
-
- case Hexagon::BI__builtin_HEXAGON_C4_cmplteui:
- ID = Intrinsic::hexagon_C4_cmplteui; break;
-
- case Hexagon::BI__builtin_HEXAGON_C4_cmplteu:
- ID = Intrinsic::hexagon_C4_cmplteu; break;
-
- case Hexagon::BI__builtin_HEXAGON_A4_rcmpneq:
- ID = Intrinsic::hexagon_A4_rcmpneq; break;
-
- case Hexagon::BI__builtin_HEXAGON_A4_rcmpneqi:
- ID = Intrinsic::hexagon_A4_rcmpneqi; break;
-
- case Hexagon::BI__builtin_HEXAGON_A4_rcmpeq:
- ID = Intrinsic::hexagon_A4_rcmpeq; break;
-
- case Hexagon::BI__builtin_HEXAGON_A4_rcmpeqi:
- ID = Intrinsic::hexagon_A4_rcmpeqi; break;
-
- case Hexagon::BI__builtin_HEXAGON_C4_fastcorner9:
- ID = Intrinsic::hexagon_C4_fastcorner9; break;
-
- case Hexagon::BI__builtin_HEXAGON_C4_fastcorner9_not:
- ID = Intrinsic::hexagon_C4_fastcorner9_not; break;
-
- case Hexagon::BI__builtin_HEXAGON_C4_and_andn:
- ID = Intrinsic::hexagon_C4_and_andn; break;
-
- case Hexagon::BI__builtin_HEXAGON_C4_and_and:
- ID = Intrinsic::hexagon_C4_and_and; break;
-
- case Hexagon::BI__builtin_HEXAGON_C4_and_orn:
- ID = Intrinsic::hexagon_C4_and_orn; break;
-
- case Hexagon::BI__builtin_HEXAGON_C4_and_or:
- ID = Intrinsic::hexagon_C4_and_or; break;
-
- case Hexagon::BI__builtin_HEXAGON_C4_or_andn:
- ID = Intrinsic::hexagon_C4_or_andn; break;
-
- case Hexagon::BI__builtin_HEXAGON_C4_or_and:
- ID = Intrinsic::hexagon_C4_or_and; break;
-
- case Hexagon::BI__builtin_HEXAGON_C4_or_orn:
- ID = Intrinsic::hexagon_C4_or_orn; break;
-
- case Hexagon::BI__builtin_HEXAGON_C4_or_or:
- ID = Intrinsic::hexagon_C4_or_or; break;
-
- case Hexagon::BI__builtin_HEXAGON_S4_addaddi:
- ID = Intrinsic::hexagon_S4_addaddi; break;
-
- case Hexagon::BI__builtin_HEXAGON_S4_subaddi:
- ID = Intrinsic::hexagon_S4_subaddi; break;
-
- case Hexagon::BI__builtin_HEXAGON_M4_xor_xacc:
- ID = Intrinsic::hexagon_M4_xor_xacc; break;
-
- case Hexagon::BI__builtin_HEXAGON_M4_and_and:
- ID = Intrinsic::hexagon_M4_and_and; break;
-
- case Hexagon::BI__builtin_HEXAGON_M4_and_or:
- ID = Intrinsic::hexagon_M4_and_or; break;
-
- case Hexagon::BI__builtin_HEXAGON_M4_and_xor:
- ID = Intrinsic::hexagon_M4_and_xor; break;
-
- case Hexagon::BI__builtin_HEXAGON_M4_and_andn:
- ID = Intrinsic::hexagon_M4_and_andn; break;
-
- case Hexagon::BI__builtin_HEXAGON_M4_xor_and:
- ID = Intrinsic::hexagon_M4_xor_and; break;
-
- case Hexagon::BI__builtin_HEXAGON_M4_xor_or:
- ID = Intrinsic::hexagon_M4_xor_or; break;
-
- case Hexagon::BI__builtin_HEXAGON_M4_xor_andn:
- ID = Intrinsic::hexagon_M4_xor_andn; break;
-
- case Hexagon::BI__builtin_HEXAGON_M4_or_and:
- ID = Intrinsic::hexagon_M4_or_and; break;
-
- case Hexagon::BI__builtin_HEXAGON_M4_or_or:
- ID = Intrinsic::hexagon_M4_or_or; break;
-
- case Hexagon::BI__builtin_HEXAGON_M4_or_xor:
- ID = Intrinsic::hexagon_M4_or_xor; break;
-
- case Hexagon::BI__builtin_HEXAGON_M4_or_andn:
- ID = Intrinsic::hexagon_M4_or_andn; break;
-
- case Hexagon::BI__builtin_HEXAGON_S4_or_andix:
- ID = Intrinsic::hexagon_S4_or_andix; break;
-
- case Hexagon::BI__builtin_HEXAGON_S4_or_andi:
- ID = Intrinsic::hexagon_S4_or_andi; break;
-
- case Hexagon::BI__builtin_HEXAGON_S4_or_ori:
- ID = Intrinsic::hexagon_S4_or_ori; break;
-
- case Hexagon::BI__builtin_HEXAGON_A4_modwrapu:
- ID = Intrinsic::hexagon_A4_modwrapu; break;
-
- case Hexagon::BI__builtin_HEXAGON_A4_cround_rr:
- ID = Intrinsic::hexagon_A4_cround_rr; break;
-
- case Hexagon::BI__builtin_HEXAGON_A4_round_ri:
- ID = Intrinsic::hexagon_A4_round_ri; break;
-
- case Hexagon::BI__builtin_HEXAGON_A4_round_rr:
- ID = Intrinsic::hexagon_A4_round_rr; break;
-
- case Hexagon::BI__builtin_HEXAGON_A4_round_ri_sat:
- ID = Intrinsic::hexagon_A4_round_ri_sat; break;
-
- case Hexagon::BI__builtin_HEXAGON_A4_round_rr_sat:
- ID = Intrinsic::hexagon_A4_round_rr_sat; break;
-
}
llvm::Function *F = CGM.getIntrinsic(ID);
Modified: cfe/branches/tooling/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/CGDebugInfo.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/branches/tooling/lib/CodeGen/CGDebugInfo.cpp Tue May 15 13:51:08 2012
@@ -1457,7 +1457,6 @@
uint64_t Size;
uint64_t Align;
-
// FIXME: make getTypeAlign() aware of VLAs and incomplete array types
if (const VariableArrayType *VAT = dyn_cast<VariableArrayType>(Ty)) {
Size = 0;
@@ -2290,8 +2289,25 @@
DBuilder.insertDeclare(Storage, D, Builder.GetInsertBlock());
Call->setDebugLoc(llvm::DebugLoc::get(Line, Column, Scope));
return;
- }
+ } else if (isa<VariableArrayType>(VD->getType())) {
+ // These are "complex" variables in that they need an op_deref.
// Create the descriptor for the variable.
+ llvm::Value *Addr = llvm::ConstantInt::get(CGM.Int64Ty,
+ llvm::DIBuilder::OpDeref);
+ llvm::DIVariable D =
+ DBuilder.createComplexVariable(Tag,
+ llvm::DIDescriptor(Scope),
+ Name, Unit, Line, Ty,
+ Addr, ArgNo);
+
+ // Insert an llvm.dbg.declare into the current block.
+ llvm::Instruction *Call =
+ DBuilder.insertDeclare(Storage, D, Builder.GetInsertBlock());
+ Call->setDebugLoc(llvm::DebugLoc::get(Line, Column, Scope));
+ return;
+ }
+
+ // Create the descriptor for the variable.
llvm::DIVariable D =
DBuilder.createLocalVariable(Tag, llvm::DIDescriptor(Scope),
Name, Unit, Line, Ty,
Modified: cfe/branches/tooling/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/CGExpr.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/branches/tooling/lib/CodeGen/CGExpr.cpp Tue May 15 13:51:08 2012
@@ -517,7 +517,7 @@
}
void CodeGenFunction::EmitCheck(llvm::Value *Address, unsigned Size) {
- if (!CatchUndefined)
+ if (BoundsChecking <= 0)
return;
// This needs to be to the standard address space.
@@ -525,8 +525,9 @@
llvm::Value *F = CGM.getIntrinsic(llvm::Intrinsic::objectsize, IntPtrTy);
- llvm::Value *Arg = Builder.getFalse();
- llvm::Value *C = Builder.CreateCall2(F, Address, Arg);
+ llvm::Value *Min = Builder.getFalse();
+ llvm::Value *Runtime = Builder.getInt32(BoundsChecking);
+ llvm::Value *C = Builder.CreateCall3(F, Address, Min, Runtime);
llvm::BasicBlock *Cont = createBasicBlock();
Builder.CreateCondBr(Builder.CreateICmpUGE(C,
llvm::ConstantInt::get(IntPtrTy, Size)),
@@ -670,10 +671,7 @@
case Expr::PseudoObjectExprClass:
return EmitPseudoObjectLValue(cast<PseudoObjectExpr>(E));
case Expr::InitListExprClass:
- assert(cast<InitListExpr>(E)->getNumInits() == 1 &&
- "Only single-element init list can be lvalue.");
- return EmitLValue(cast<InitListExpr>(E)->getInit(0));
-
+ return EmitInitListLValue(cast<InitListExpr>(E));
case Expr::CXXTemporaryObjectExprClass:
case Expr::CXXConstructExprClass:
return EmitCXXConstructLValue(cast<CXXConstructExpr>(E));
@@ -2128,6 +2126,16 @@
return Result;
}
+LValue CodeGenFunction::EmitInitListLValue(const InitListExpr *E) {
+ if (!E->isGLValue())
+ // Initializing an aggregate temporary in C++11: T{...}.
+ return EmitAggExprToLValue(E);
+
+ // An lvalue initializer list must be initializing a reference.
+ assert(E->getNumInits() == 1 && "reference init with multiple values");
+ return EmitLValue(E->getInit(0));
+}
+
LValue CodeGenFunction::
EmitConditionalOperatorLValue(const AbstractConditionalOperator *expr) {
if (!expr->isGLValue()) {
@@ -2187,11 +2195,11 @@
return MakeAddrLValue(phi, expr->getType());
}
-/// EmitCastLValue - Casts are never lvalues unless that cast is a dynamic_cast.
-/// If the cast is a dynamic_cast, we can have the usual lvalue result,
+/// EmitCastLValue - Casts are never lvalues unless that cast is to a reference
+/// type. If the cast is to a reference, we can have the usual lvalue result,
/// otherwise if a cast is needed by the code generator in an lvalue context,
/// then it must mean that we need the address of an aggregate in order to
-/// access one of its fields. This can happen for all the reasons that casts
+/// access one of its members. This can happen for all the reasons that casts
/// are permitted with aggregate result, including noop aggregate casts, and
/// cast from scalar to union.
LValue CodeGenFunction::EmitCastLValue(const CastExpr *E) {
Modified: cfe/branches/tooling/lib/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/CodeGenFunction.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/branches/tooling/lib/CodeGen/CodeGenFunction.cpp Tue May 15 13:51:08 2012
@@ -41,6 +41,7 @@
CXXVTTValue(0), OutermostConditional(0), TerminateLandingPad(0),
TerminateHandler(0), TrapBB(0) {
+ BoundsChecking = getContext().getLangOpts().BoundsChecking;
CatchUndefined = getContext().getLangOpts().CatchUndefined;
CGM.getCXXABI().getMangleContext().startNewFunction();
}
Modified: cfe/branches/tooling/lib/CodeGen/CodeGenFunction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/CodeGenFunction.h?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/CodeGenFunction.h (original)
+++ cfe/branches/tooling/lib/CodeGen/CodeGenFunction.h Tue May 15 13:51:08 2012
@@ -591,6 +591,11 @@
/// we prefer to insert allocas.
llvm::AssertingVH<llvm::Instruction> AllocaInsertPt;
+ /// BoundsChecking - Emit run-time bounds checks. Higher values mean
+ /// potentially higher performance penalties.
+ unsigned char BoundsChecking;
+
+ /// CatchUndefined - Emit run-time checks to catch undefined behaviors.
bool CatchUndefined;
/// In ARC, whether we should autorelease the return value.
@@ -2099,6 +2104,7 @@
LValue EmitMemberExpr(const MemberExpr *E);
LValue EmitObjCIsaExpr(const ObjCIsaExpr *E);
LValue EmitCompoundLiteralLValue(const CompoundLiteralExpr *E);
+ LValue EmitInitListLValue(const InitListExpr *E);
LValue EmitConditionalOperatorLValue(const AbstractConditionalOperator *E);
LValue EmitCastLValue(const CastExpr *E);
LValue EmitNullInitializationLValue(const CXXScalarValueInitExpr *E);
Modified: cfe/branches/tooling/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/CodeGenModule.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/branches/tooling/lib/CodeGen/CodeGenModule.cpp Tue May 15 13:51:08 2012
@@ -523,6 +523,10 @@
!F->hasFnAttr(llvm::Attribute::NoInline))
F->addFnAttr(llvm::Attribute::AlwaysInline);
+ // FIXME: Communicate hot and cold attributes to LLVM more directly.
+ if (D->hasAttr<ColdAttr>())
+ F->addFnAttr(llvm::Attribute::OptimizeForSize);
+
if (isa<CXXConstructorDecl>(D) || isa<CXXDestructorDecl>(D))
F->setUnnamedAddr(true);
Modified: cfe/branches/tooling/lib/CodeGen/TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/CodeGen/TargetInfo.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/CodeGen/TargetInfo.cpp (original)
+++ cfe/branches/tooling/lib/CodeGen/TargetInfo.cpp Tue May 15 13:51:08 2012
@@ -2411,6 +2411,64 @@
return false;
}
+// PowerPC-64
+
+namespace {
+class PPC64TargetCodeGenInfo : public DefaultTargetCodeGenInfo {
+public:
+ PPC64TargetCodeGenInfo(CodeGenTypes &CGT) : DefaultTargetCodeGenInfo(CGT) {}
+
+ int getDwarfEHStackPointer(CodeGen::CodeGenModule &M) const {
+ // This is recovered from gcc output.
+ return 1; // r1 is the dedicated stack pointer
+ }
+
+ bool initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF,
+ llvm::Value *Address) const;
+};
+
+}
+
+bool
+PPC64TargetCodeGenInfo::initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF,
+ llvm::Value *Address) const {
+ // This is calculated from the LLVM and GCC tables and verified
+ // against gcc output. AFAIK all ABIs use the same encoding.
+
+ CodeGen::CGBuilderTy &Builder = CGF.Builder;
+
+ llvm::IntegerType *i8 = CGF.Int8Ty;
+ llvm::Value *Four8 = llvm::ConstantInt::get(i8, 4);
+ llvm::Value *Eight8 = llvm::ConstantInt::get(i8, 8);
+ llvm::Value *Sixteen8 = llvm::ConstantInt::get(i8, 16);
+
+ // 0-31: r0-31, the 8-byte general-purpose registers
+ AssignToArrayRange(Builder, Address, Eight8, 0, 31);
+
+ // 32-63: fp0-31, the 8-byte floating-point registers
+ AssignToArrayRange(Builder, Address, Eight8, 32, 63);
+
+ // 64-76 are various 4-byte special-purpose registers:
+ // 64: mq
+ // 65: lr
+ // 66: ctr
+ // 67: ap
+ // 68-75 cr0-7
+ // 76: xer
+ AssignToArrayRange(Builder, Address, Four8, 64, 76);
+
+ // 77-108: v0-31, the 16-byte vector registers
+ AssignToArrayRange(Builder, Address, Sixteen8, 77, 108);
+
+ // 109: vrsave
+ // 110: vscr
+ // 111: spe_acc
+ // 112: spefscr
+ // 113: sfp
+ AssignToArrayRange(Builder, Address, Four8, 109, 113);
+
+ return false;
+}
//===----------------------------------------------------------------------===//
// ARM ABI Implementation
@@ -3098,7 +3156,8 @@
class MipsABIInfo : public ABIInfo {
bool IsO32;
unsigned MinABIStackAlignInBytes;
- llvm::Type* HandleAggregates(QualType Ty) const;
+ llvm::Type* CoerceToIntArgs(uint64_t TySize) const;
+ llvm::Type* HandleAggregates(QualType Ty, uint64_t TySize) const;
llvm::Type* returnAggregateInRegs(QualType RetTy, uint64_t Size) const;
llvm::Type* getPaddingType(uint64_t Align, uint64_t Offset) const;
public:
@@ -3132,11 +3191,29 @@
};
}
+llvm::Type* MipsABIInfo::CoerceToIntArgs(uint64_t TySize) const {
+ SmallVector<llvm::Type*, 8> ArgList;
+ llvm::IntegerType *IntTy = llvm::IntegerType::get(getVMContext(),
+ MinABIStackAlignInBytes * 8);
+
+ // Add (TySize / MinABIStackAlignInBytes) args of IntTy.
+ for (unsigned N = TySize / (MinABIStackAlignInBytes * 8); N; --N)
+ ArgList.push_back(IntTy);
+
+ // If necessary, add one more integer type to ArgList.
+ unsigned R = TySize % (MinABIStackAlignInBytes * 8);
+
+ if (R)
+ ArgList.push_back(llvm::IntegerType::get(getVMContext(), R));
+
+ return llvm::StructType::get(getVMContext(), ArgList);
+}
+
// In N32/64, an aligned double precision floating point field is passed in
// a register.
-llvm::Type* MipsABIInfo::HandleAggregates(QualType Ty) const {
+llvm::Type* MipsABIInfo::HandleAggregates(QualType Ty, uint64_t TySize) const {
if (IsO32)
- return 0;
+ return CoerceToIntArgs(TySize);
if (Ty->isComplexType())
return CGT.ConvertType(Ty);
@@ -3145,12 +3222,11 @@
// Unions are passed in integer registers.
if (!RT || !RT->isStructureOrClassType())
- return 0;
+ return CoerceToIntArgs(TySize);
const RecordDecl *RD = RT->getDecl();
const ASTRecordLayout &Layout = getContext().getASTRecordLayout(RD);
- uint64_t StructSize = getContext().getTypeSize(Ty);
- assert(!(StructSize % 8) && "Size of structure must be multiple of 8.");
+ assert(!(TySize % 8) && "Size of structure must be multiple of 8.");
uint64_t LastOffset = 0;
unsigned idx = 0;
@@ -3180,17 +3256,13 @@
LastOffset = Offset + 64;
}
- // This struct/class doesn't have an aligned double field.
- if (!LastOffset)
- return 0;
-
- // Add ((StructSize - LastOffset) / 64) args of type i64.
- for (unsigned N = (StructSize - LastOffset) / 64; N; --N)
+ // Add ((TySize - LastOffset) / 64) args of type i64.
+ for (unsigned N = (TySize - LastOffset) / 64; N; --N)
ArgList.push_back(I64);
// If the size of the remainder is not zero, add one more integer type to
// ArgList.
- unsigned R = (StructSize - LastOffset) % 64;
+ unsigned R = (TySize - LastOffset) % 64;
if (R)
ArgList.push_back(llvm::IntegerType::get(getVMContext(), R));
@@ -3198,23 +3270,23 @@
}
llvm::Type *MipsABIInfo::getPaddingType(uint64_t Align, uint64_t Offset) const {
- // Padding is inserted only for N32/64.
- if (IsO32)
- return 0;
+ assert((Offset % MinABIStackAlignInBytes) == 0);
+
+ if ((Align - 1) & Offset)
+ return llvm::IntegerType::get(getVMContext(), MinABIStackAlignInBytes * 8);
- assert(Align <= 16 && "Alignment larger than 16 not handled.");
- return (Align == 16 && Offset & 0xf) ?
- llvm::IntegerType::get(getVMContext(), 64) : 0;
+ return 0;
}
ABIArgInfo
MipsABIInfo::classifyArgumentType(QualType Ty, uint64_t &Offset) const {
uint64_t OrigOffset = Offset;
- uint64_t TySize =
- llvm::RoundUpToAlignment(getContext().getTypeSize(Ty), 64) / 8;
+ uint64_t TySize = getContext().getTypeSize(Ty);
uint64_t Align = getContext().getTypeAlign(Ty) / 8;
- Offset = llvm::RoundUpToAlignment(Offset, std::max(Align, (uint64_t)8));
- Offset += TySize;
+
+ Align = std::max(Align, (uint64_t)MinABIStackAlignInBytes);
+ Offset = llvm::RoundUpToAlignment(Offset, Align);
+ Offset += llvm::RoundUpToAlignment(TySize, Align * 8) / 8;
if (isAggregateTypeForABI(Ty)) {
// Ignore empty aggregates.
@@ -3224,20 +3296,15 @@
// Records with non trivial destructors/constructors should not be passed
// by value.
if (isRecordWithNonTrivialDestructorOrCopyConstructor(Ty)) {
- Offset = OrigOffset + 8;
+ Offset = OrigOffset + MinABIStackAlignInBytes;
return ABIArgInfo::getIndirect(0, /*ByVal=*/false);
}
- // If we have reached here, aggregates are passed either indirectly via a
- // byval pointer or directly by coercing to another structure type. In the
- // latter case, padding is inserted if the offset of the aggregate is
- // unaligned.
- llvm::Type *ResType = HandleAggregates(Ty);
-
- if (!ResType)
- return ABIArgInfo::getIndirect(0);
-
- return ABIArgInfo::getDirect(ResType, 0, getPaddingType(Align, OrigOffset));
+ // If we have reached here, aggregates are passed directly by coercing to
+ // another structure type. Padding is inserted if the offset of the
+ // aggregate is unaligned.
+ return ABIArgInfo::getDirect(HandleAggregates(Ty, TySize), 0,
+ getPaddingType(Align, OrigOffset));
}
// Treat an enum type as its underlying type.
@@ -3302,7 +3369,7 @@
if (RetTy->isVoidType() || Size == 0)
return ABIArgInfo::getIgnore();
- if (isAggregateTypeForABI(RetTy)) {
+ if (isAggregateTypeForABI(RetTy) || RetTy->isVectorType()) {
if (Size <= 128) {
if (RetTy->isAnyComplexType())
return ABIArgInfo::getDirect();
@@ -3327,7 +3394,7 @@
RetInfo = classifyReturnType(FI.getReturnType());
// Check if a pointer to an aggregate is passed as a hidden argument.
- uint64_t Offset = RetInfo.isIndirect() ? 8 : 0;
+ uint64_t Offset = RetInfo.isIndirect() ? MinABIStackAlignInBytes : 0;
for (CGFunctionInfo::arg_iterator it = FI.arg_begin(), ie = FI.arg_end();
it != ie; ++it)
@@ -3634,6 +3701,8 @@
case llvm::Triple::ppc:
return *(TheTargetCodeGenInfo = new PPC32TargetCodeGenInfo(Types));
+ case llvm::Triple::ppc64:
+ return *(TheTargetCodeGenInfo = new PPC64TargetCodeGenInfo(Types));
case llvm::Triple::ptx32:
case llvm::Triple::ptx64:
Modified: cfe/branches/tooling/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Driver/ToolChains.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Driver/ToolChains.cpp (original)
+++ cfe/branches/tooling/lib/Driver/ToolChains.cpp Tue May 15 13:51:08 2012
@@ -59,6 +59,11 @@
DarwinVersion[0] = Minor + 4;
DarwinVersion[1] = Micro;
DarwinVersion[2] = 0;
+
+ // Compute the initial iOS version from the triple
+ Triple.getiOSVersion(Major, Minor, Micro);
+ llvm::raw_string_ostream(iOSVersionMin)
+ << Major << '.' << Minor << '.' << Micro;
}
types::ID Darwin::LookupTypeForExtension(const char *Ext) const {
@@ -523,9 +528,9 @@
// If no OSX or iOS target has been specified and we're compiling for armv7,
// go ahead as assume we're targeting iOS.
- if (OSXTarget.empty() && iOSTarget.empty())
- if (getDarwinArchName(Args) == "armv7")
- iOSTarget = "0.0";
+ if (OSXTarget.empty() && iOSTarget.empty() &&
+ getDarwinArchName(Args) == "armv7")
+ iOSTarget = iOSVersionMin;
// Handle conflicting deployment targets
//
@@ -1141,7 +1146,8 @@
"i586-redhat-linux",
"i386-redhat-linux",
"i586-suse-linux",
- "i486-slackware-linux"
+ "i486-slackware-linux",
+ "i686-montavista-linux"
};
static const char *const MIPSLibDirs[] = { "/lib" };
@@ -1158,7 +1164,8 @@
static const char *const PPCTriples[] = {
"powerpc-linux-gnu",
"powerpc-unknown-linux-gnu",
- "powerpc-suse-linux"
+ "powerpc-suse-linux",
+ "powerpc-montavista-linuxspe"
};
static const char *const PPC64LibDirs[] = { "/lib64", "/lib" };
static const char *const PPC64Triples[] = {
Modified: cfe/branches/tooling/lib/Driver/ToolChains.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Driver/ToolChains.h?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Driver/ToolChains.h (original)
+++ cfe/branches/tooling/lib/Driver/ToolChains.h Tue May 15 13:51:08 2012
@@ -205,6 +205,10 @@
/// initialized.
std::string MacosxVersionMin;
+ /// The default ios-version-min of this tool chain; empty until
+ /// initialized.
+ std::string iOSVersionMin;
+
bool hasARCRuntime() const;
bool hasSubscriptingRuntime() const;
Modified: cfe/branches/tooling/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Driver/Tools.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Driver/Tools.cpp (original)
+++ cfe/branches/tooling/lib/Driver/Tools.cpp Tue May 15 13:51:08 2012
@@ -958,7 +958,7 @@
// FIXME: We should also incorporate the detected target features for use
// with -native.
std::string CPU = llvm::sys::getHostCPUName();
- if (!CPU.empty())
+ if (!CPU.empty() && CPU != "generic")
CPUName = Args.MakeArgString(CPU);
} else
CPUName = A->getValue(Args);
@@ -1088,7 +1088,7 @@
CmdArgs.push_back("-fno-signed-char");
CmdArgs.push_back("-nobuiltininc");
- if (Args.hasArg(options::OPT_mqdsp6_compat))
+ if (Args.hasArg(options::OPT_mqdsp6_compat))
CmdArgs.push_back("-mqdsp6-compat");
if (Arg *A = Args.getLastArg(options::OPT_G,
@@ -1100,6 +1100,12 @@
A->claim();
}
+ if (!Args.hasArg(options::OPT_fno_short_enums))
+ CmdArgs.push_back("-fshort-enums");
+ if (Args.getLastArg(options::OPT_mieee_rnd_near)) {
+ CmdArgs.push_back ("-mllvm");
+ CmdArgs.push_back ("-enable-hexagon-ieee-rnd-near");
+ }
CmdArgs.push_back ("-mllvm");
CmdArgs.push_back ("-machine-sink-split=0");
}
@@ -2025,6 +2031,15 @@
CmdArgs.push_back("-Wlarge-by-value-copy=64"); // default value
}
+ if (Arg *A = Args.getLastArg(options::OPT_fbounds_checking,
+ options::OPT_fbounds_checking_EQ)) {
+ if (A->getNumValues()) {
+ StringRef val = A->getValue(Args);
+ CmdArgs.push_back(Args.MakeArgString("-fbounds-checking=" + val));
+ } else
+ CmdArgs.push_back("-fbounds-checking=1");
+ }
+
if (Args.hasArg(options::OPT__relocatable_pch))
CmdArgs.push_back("-relocatable-pch");
@@ -5298,7 +5313,9 @@
AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs);
- if (D.CCCIsCXX && !Args.hasArg(options::OPT_nostdlib)) {
+ if (D.CCCIsCXX &&
+ !Args.hasArg(options::OPT_nostdlib) &&
+ !Args.hasArg(options::OPT_nodefaultlibs)) {
bool OnlyLibstdcxxStatic = Args.hasArg(options::OPT_static_libstdcxx) &&
!Args.hasArg(options::OPT_static);
if (OnlyLibstdcxxStatic)
@@ -5313,22 +5330,23 @@
addAsanRTLinux(getToolChain(), Args, CmdArgs);
if (!Args.hasArg(options::OPT_nostdlib)) {
- if (Args.hasArg(options::OPT_static))
- CmdArgs.push_back("--start-group");
-
- AddLibgcc(ToolChain.getTriple(), D, CmdArgs, Args);
+ if (!Args.hasArg(options::OPT_nodefaultlibs)) {
+ if (Args.hasArg(options::OPT_static))
+ CmdArgs.push_back("--start-group");
- if (Args.hasArg(options::OPT_pthread) ||
- Args.hasArg(options::OPT_pthreads))
- CmdArgs.push_back("-lpthread");
+ AddLibgcc(ToolChain.getTriple(), D, CmdArgs, Args);
- CmdArgs.push_back("-lc");
+ if (Args.hasArg(options::OPT_pthread) ||
+ Args.hasArg(options::OPT_pthreads))
+ CmdArgs.push_back("-lpthread");
- if (Args.hasArg(options::OPT_static))
- CmdArgs.push_back("--end-group");
- else
- AddLibgcc(ToolChain.getTriple(), D, CmdArgs, Args);
+ CmdArgs.push_back("-lc");
+ if (Args.hasArg(options::OPT_static))
+ CmdArgs.push_back("--end-group");
+ else
+ AddLibgcc(ToolChain.getTriple(), D, CmdArgs, Args);
+ }
if (!Args.hasArg(options::OPT_nostartfiles)) {
const char *crtend;
Modified: cfe/branches/tooling/lib/Edit/EditedSource.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Edit/EditedSource.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Edit/EditedSource.cpp (original)
+++ cfe/branches/tooling/lib/Edit/EditedSource.cpp Tue May 15 13:51:08 2012
@@ -100,8 +100,11 @@
FileOffset B = I->first;
FileOffset E = B.getWithOffset(FA.RemoveLen);
+ if (BeginOffs == B)
+ break;
+
if (BeginOffs < E) {
- if (BeginOffs >= B) {
+ if (BeginOffs > B) {
BeginOffs = E;
++I;
}
Modified: cfe/branches/tooling/lib/Edit/RewriteObjCFoundationAPI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Edit/RewriteObjCFoundationAPI.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Edit/RewriteObjCFoundationAPI.cpp (original)
+++ cfe/branches/tooling/lib/Edit/RewriteObjCFoundationAPI.cpp Tue May 15 13:51:08 2012
@@ -77,9 +77,10 @@
// rewriteToObjCSubscriptSyntax.
//===----------------------------------------------------------------------===//
+static bool subscriptOperatorNeedsParens(const Expr *FullExpr);
+
static void maybePutParensOnReceiver(const Expr *Receiver, Commit &commit) {
- Receiver = Receiver->IgnoreImpCasts();
- if (isa<BinaryOperator>(Receiver) || isa<UnaryOperator>(Receiver)) {
+ if (subscriptOperatorNeedsParens(Receiver)) {
SourceRange RecRange = Receiver->getSourceRange();
commit.insertWrap("(", RecRange, ")");
}
@@ -229,6 +230,9 @@
// rewriteToArrayLiteral.
//===----------------------------------------------------------------------===//
+/// \brief Adds an explicit cast to 'id' if the type is not objc object.
+static void objectifyExpr(const Expr *E, Commit &commit);
+
static bool rewriteToArrayLiteral(const ObjCMessageExpr *Msg,
const NSAPI &NS, Commit &commit) {
Selector Sel = Msg->getSelector();
@@ -244,6 +248,7 @@
if (Sel == NS.getNSArraySelector(NSAPI::NSArr_arrayWithObject)) {
if (Msg->getNumArgs() != 1)
return false;
+ objectifyExpr(Msg->getArg(0), commit);
SourceRange ArgRange = Msg->getArg(0)->getSourceRange();
commit.replaceWithInner(MsgRange, ArgRange);
commit.insertWrap("@[", ArgRange, "]");
@@ -257,6 +262,9 @@
if (!NS.getASTContext().isSentinelNullExpr(SentinelExpr))
return false;
+ for (unsigned i = 0, e = Msg->getNumArgs() - 1; i != e; ++i)
+ objectifyExpr(Msg->getArg(i), commit);
+
if (Msg->getNumArgs() == 1) {
commit.replace(MsgRange, "@[]");
return true;
@@ -291,6 +299,10 @@
NSAPI::NSDict_dictionaryWithObjectForKey)) {
if (Msg->getNumArgs() != 2)
return false;
+
+ objectifyExpr(Msg->getArg(0), commit);
+ objectifyExpr(Msg->getArg(1), commit);
+
SourceRange ValRange = Msg->getArg(0)->getSourceRange();
SourceRange KeyRange = Msg->getArg(1)->getSourceRange();
// Insert key before the value.
@@ -319,6 +331,9 @@
}
for (unsigned i = 0; i < SentinelIdx; i += 2) {
+ objectifyExpr(Msg->getArg(i), commit);
+ objectifyExpr(Msg->getArg(i+1), commit);
+
SourceRange ValRange = Msg->getArg(i)->getSourceRange();
SourceRange KeyRange = Msg->getArg(i+1)->getSourceRange();
// Insert value after key.
@@ -585,3 +600,75 @@
}
return true;
}
+
+// FIXME: Make determination of operator precedence more general and
+// make it broadly available.
+static bool subscriptOperatorNeedsParens(const Expr *FullExpr) {
+ const Expr* Expr = FullExpr->IgnoreImpCasts();
+ if (isa<ArraySubscriptExpr>(Expr) ||
+ isa<CallExpr>(Expr) ||
+ isa<DeclRefExpr>(Expr) ||
+ isa<CXXNamedCastExpr>(Expr) ||
+ isa<CXXConstructExpr>(Expr) ||
+ isa<CXXThisExpr>(Expr) ||
+ isa<CXXTypeidExpr>(Expr) ||
+ isa<CXXUnresolvedConstructExpr>(Expr) ||
+ isa<ObjCMessageExpr>(Expr) ||
+ isa<ObjCPropertyRefExpr>(Expr) ||
+ isa<ObjCProtocolExpr>(Expr) ||
+ isa<MemberExpr>(Expr) ||
+ isa<ParenExpr>(FullExpr) ||
+ isa<ParenListExpr>(Expr) ||
+ isa<SizeOfPackExpr>(Expr))
+ return false;
+
+ return true;
+}
+static bool castOperatorNeedsParens(const Expr *FullExpr) {
+ const Expr* Expr = FullExpr->IgnoreImpCasts();
+ if (isa<ArraySubscriptExpr>(Expr) ||
+ isa<CallExpr>(Expr) ||
+ isa<DeclRefExpr>(Expr) ||
+ isa<CastExpr>(Expr) ||
+ isa<CXXNewExpr>(Expr) ||
+ isa<CXXConstructExpr>(Expr) ||
+ isa<CXXDeleteExpr>(Expr) ||
+ isa<CXXNoexceptExpr>(Expr) ||
+ isa<CXXPseudoDestructorExpr>(Expr) ||
+ isa<CXXScalarValueInitExpr>(Expr) ||
+ isa<CXXThisExpr>(Expr) ||
+ isa<CXXTypeidExpr>(Expr) ||
+ isa<CXXUnresolvedConstructExpr>(Expr) ||
+ isa<ObjCMessageExpr>(Expr) ||
+ isa<ObjCPropertyRefExpr>(Expr) ||
+ isa<ObjCProtocolExpr>(Expr) ||
+ isa<MemberExpr>(Expr) ||
+ isa<ParenExpr>(FullExpr) ||
+ isa<ParenListExpr>(Expr) ||
+ isa<SizeOfPackExpr>(Expr) ||
+ isa<UnaryOperator>(Expr))
+ return false;
+
+ return true;
+}
+
+static void objectifyExpr(const Expr *E, Commit &commit) {
+ if (!E) return;
+
+ QualType T = E->getType();
+ if (T->isObjCObjectPointerType()) {
+ if (const ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(E)) {
+ if (ICE->getCastKind() != CK_CPointerToObjCPointerCast)
+ return;
+ } else {
+ return;
+ }
+ } else if (!T->isPointerType()) {
+ return;
+ }
+
+ SourceRange Range = E->getSourceRange();
+ if (castOperatorNeedsParens(E))
+ commit.insertWrap("(", Range, ")");
+ commit.insertBefore(Range.getBegin(), "(id)");
+}
Modified: cfe/branches/tooling/lib/Frontend/CompilerInstance.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Frontend/CompilerInstance.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Frontend/CompilerInstance.cpp (original)
+++ cfe/branches/tooling/lib/Frontend/CompilerInstance.cpp Tue May 15 13:51:08 2012
@@ -560,7 +560,8 @@
TempPath += "-%%%%%%%%";
int fd;
if (llvm::sys::fs::unique_file(TempPath.str(), fd, TempPath,
- /*makeAbsolute=*/false) == llvm::errc::success) {
+ /*makeAbsolute=*/false, 0664)
+ == llvm::errc::success) {
OS.reset(new llvm::raw_fd_ostream(fd, /*shouldClose=*/true));
OSFile = TempFile = TempPath.str();
}
Modified: cfe/branches/tooling/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Frontend/CompilerInvocation.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/branches/tooling/lib/Frontend/CompilerInvocation.cpp Tue May 15 13:51:08 2012
@@ -675,6 +675,8 @@
Res.push_back("-fno-operator-names");
if (Opts.PascalStrings)
Res.push_back("-fpascal-strings");
+ if (Opts.BoundsChecking > 0)
+ Res.push_back("-fbounds-checking=" + llvm::utostr(Opts.BoundsChecking));
if (Opts.CatchUndefined)
Res.push_back("-fcatch-undefined-behavior");
if (Opts.AddressSanitizer)
@@ -1953,7 +1955,11 @@
Opts.ObjCNonFragileABI2 = true;
Opts.ObjCDefaultSynthProperties =
Args.hasArg(OPT_fobjc_default_synthesize_properties);
- Opts.CatchUndefined = Args.hasArg(OPT_fcatch_undefined_behavior);
+ Opts.BoundsChecking = 0;
+ if ((Opts.CatchUndefined = Args.hasArg(OPT_fcatch_undefined_behavior)))
+ Opts.BoundsChecking = 5;
+ Opts.BoundsChecking = Args.getLastArgIntValue(OPT_fbounds_checking_EQ,
+ Opts.BoundsChecking, Diags);
Opts.EmitAllDecls = Args.hasArg(OPT_femit_all_decls);
Opts.PackStruct = Args.getLastArgIntValue(OPT_fpack_struct_EQ, 0, Diags);
Opts.PICLevel = Args.getLastArgIntValue(OPT_pic_level, 0, Diags);
Modified: cfe/branches/tooling/lib/Frontend/DiagnosticRenderer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Frontend/DiagnosticRenderer.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Frontend/DiagnosticRenderer.cpp (original)
+++ cfe/branches/tooling/lib/Frontend/DiagnosticRenderer.cpp Tue May 15 13:51:08 2012
@@ -123,10 +123,9 @@
return SM.getPresumedLoc(Loc);
}
-DiagnosticRenderer::DiagnosticRenderer(const SourceManager &SM,
- const LangOptions &LangOpts,
+DiagnosticRenderer::DiagnosticRenderer(const LangOptions &LangOpts,
const DiagnosticOptions &DiagOpts)
-: SM(SM), LangOpts(LangOpts), DiagOpts(DiagOpts), LastLevel() {}
+: LangOpts(LangOpts), DiagOpts(DiagOpts), LastLevel() {}
DiagnosticRenderer::~DiagnosticRenderer() {}
@@ -184,18 +183,23 @@
StringRef Message,
ArrayRef<CharSourceRange> Ranges,
ArrayRef<FixItHint> FixItHints,
+ const SourceManager *SM,
DiagOrStoredDiag D) {
+ assert(SM || Loc.isInvalid());
beginDiagnostic(D, Level);
- PresumedLoc PLoc = getDiagnosticPresumedLoc(SM, Loc);
+ PresumedLoc PLoc;
+ if (Loc.isValid()) {
+ PLoc = getDiagnosticPresumedLoc(*SM, Loc);
- // First, if this diagnostic is not in the main file, print out the
- // "included from" lines.
- emitIncludeStack(PLoc.getIncludeLoc(), Level);
+ // First, if this diagnostic is not in the main file, print out the
+ // "included from" lines.
+ emitIncludeStack(PLoc.getIncludeLoc(), Level, *SM);
+ }
// Next, emit the actual diagnostic message.
- emitDiagnosticMessage(Loc, PLoc, Level, Message, Ranges, D);
+ emitDiagnosticMessage(Loc, PLoc, Level, Message, Ranges, SM, D);
// Only recurse if we have a valid location.
if (Loc.isValid()) {
@@ -205,7 +209,7 @@
llvm::SmallVector<FixItHint, 8> MergedFixits;
if (!FixItHints.empty()) {
- mergeFixits(FixItHints, SM, LangOpts, MergedFixits);
+ mergeFixits(FixItHints, *SM, LangOpts, MergedFixits);
FixItHints = MergedFixits;
}
@@ -216,7 +220,7 @@
MutableRanges.push_back(I->RemoveRange);
unsigned MacroDepth = 0;
- emitMacroExpansionsAndCarets(Loc, Level, MutableRanges, FixItHints,
+ emitMacroExpansionsAndCarets(Loc, Level, MutableRanges, FixItHints, *SM,
MacroDepth);
}
@@ -230,6 +234,8 @@
void DiagnosticRenderer::emitStoredDiagnostic(StoredDiagnostic &Diag) {
emitDiagnostic(Diag.getLocation(), Diag.getLevel(), Diag.getMessage(),
Diag.getRanges(), Diag.getFixIts(),
+ Diag.getLocation().isValid() ? &Diag.getLocation().getManager()
+ : 0,
&Diag);
}
@@ -245,7 +251,8 @@
/// \param Loc The include location of the current file (not the diagnostic
/// location).
void DiagnosticRenderer::emitIncludeStack(SourceLocation Loc,
- DiagnosticsEngine::Level Level) {
+ DiagnosticsEngine::Level Level,
+ const SourceManager &SM) {
// Skip redundant include stacks altogether.
if (LastIncludeLoc == Loc)
return;
@@ -254,12 +261,13 @@
if (!DiagOpts.ShowNoteIncludeStack && Level == DiagnosticsEngine::Note)
return;
- emitIncludeStackRecursively(Loc);
+ emitIncludeStackRecursively(Loc, SM);
}
/// \brief Helper to recursivly walk up the include stack and print each layer
/// on the way back down.
-void DiagnosticRenderer::emitIncludeStackRecursively(SourceLocation Loc) {
+void DiagnosticRenderer::emitIncludeStackRecursively(SourceLocation Loc,
+ const SourceManager &SM) {
if (Loc.isInvalid())
return;
@@ -268,10 +276,10 @@
return;
// Emit the other include frames first.
- emitIncludeStackRecursively(PLoc.getIncludeLoc());
+ emitIncludeStackRecursively(PLoc.getIncludeLoc(), SM);
// Emit the inclusion text/note.
- emitIncludeLocation(Loc, PLoc);
+ emitIncludeLocation(Loc, PLoc, SM);
}
/// \brief Recursively emit notes for each macro expansion and caret
@@ -292,6 +300,7 @@
DiagnosticsEngine::Level Level,
SmallVectorImpl<CharSourceRange>& Ranges,
ArrayRef<FixItHint> Hints,
+ const SourceManager &SM,
unsigned &MacroDepth,
unsigned OnMacroInst)
{
@@ -302,7 +311,7 @@
if (Loc.isFileID()) {
assert(MacroDepth == 0 && "We shouldn't hit a leaf node twice!");
MacroDepth = OnMacroInst;
- emitCodeContext(Loc, Level, Ranges, Hints);
+ emitCodeContext(Loc, Level, Ranges, Hints, SM);
return;
}
// Otherwise recurse through each macro expansion layer.
@@ -314,7 +323,7 @@
SourceLocation OneLevelUp = getImmediateMacroCallerLoc(SM, Loc);
// FIXME: Map ranges?
- emitMacroExpansionsAndCarets(OneLevelUp, Level, Ranges, Hints, MacroDepth,
+ emitMacroExpansionsAndCarets(OneLevelUp, Level, Ranges, Hints, SM, MacroDepth,
OnMacroInst + 1);
// Save the original location so we can find the spelling of the macro call.
@@ -365,22 +374,23 @@
<< getImmediateMacroName(MacroLoc, SM, LangOpts) << "'";
emitDiagnostic(SM.getSpellingLoc(Loc), DiagnosticsEngine::Note,
Message.str(),
- Ranges, ArrayRef<FixItHint>());
+ Ranges, ArrayRef<FixItHint>(), &SM);
}
DiagnosticNoteRenderer::~DiagnosticNoteRenderer() {}
void DiagnosticNoteRenderer::emitIncludeLocation(SourceLocation Loc,
- PresumedLoc PLoc) {
+ PresumedLoc PLoc,
+ const SourceManager &SM) {
// Generate a note indicating the include location.
SmallString<200> MessageStorage;
llvm::raw_svector_ostream Message(MessageStorage);
Message << "in file included from " << PLoc.getFilename() << ':'
<< PLoc.getLine() << ":";
- emitNote(Loc, Message.str());
+ emitNote(Loc, Message.str(), &SM);
}
void DiagnosticNoteRenderer::emitBasicNote(StringRef Message) {
- emitNote(SourceLocation(), Message);
+ emitNote(SourceLocation(), Message, 0);
}
Modified: cfe/branches/tooling/lib/Frontend/SerializedDiagnosticPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Frontend/SerializedDiagnosticPrinter.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Frontend/SerializedDiagnosticPrinter.cpp (original)
+++ cfe/branches/tooling/lib/Frontend/SerializedDiagnosticPrinter.cpp Tue May 15 13:51:08 2012
@@ -53,10 +53,9 @@
RecordData &Record;
public:
SDiagsRenderer(SDiagsWriter &Writer, RecordData &Record,
- const SourceManager &SM,
const LangOptions &LangOpts,
const DiagnosticOptions &DiagOpts)
- : DiagnosticNoteRenderer(SM, LangOpts, DiagOpts),
+ : DiagnosticNoteRenderer(LangOpts, DiagOpts),
Writer(Writer), Record(Record){}
virtual ~SDiagsRenderer() {}
@@ -67,18 +66,21 @@
DiagnosticsEngine::Level Level,
StringRef Message,
ArrayRef<CharSourceRange> Ranges,
+ const SourceManager *SM,
DiagOrStoredDiag D);
virtual void emitDiagnosticLoc(SourceLocation Loc, PresumedLoc PLoc,
DiagnosticsEngine::Level Level,
- ArrayRef<CharSourceRange> Ranges) {}
+ ArrayRef<CharSourceRange> Ranges,
+ const SourceManager &SM) {}
- void emitNote(SourceLocation Loc, StringRef Message);
+ void emitNote(SourceLocation Loc, StringRef Message, const SourceManager *SM);
virtual void emitCodeContext(SourceLocation Loc,
DiagnosticsEngine::Level Level,
SmallVectorImpl<CharSourceRange>& Ranges,
- ArrayRef<FixItHint> Hints);
+ ArrayRef<FixItHint> Hints,
+ const SourceManager &SM);
virtual void beginDiagnostic(DiagOrStoredDiag D,
DiagnosticsEngine::Level Level);
@@ -137,15 +139,16 @@
unsigned getEmitFile(const char *Filename);
/// \brief Add SourceLocation information the specified record.
- void AddLocToRecord(SourceLocation Loc, const SourceManager &SM,
+ void AddLocToRecord(SourceLocation Loc, const SourceManager *SM,
PresumedLoc PLoc, RecordDataImpl &Record,
unsigned TokSize = 0);
/// \brief Add SourceLocation information the specified record.
void AddLocToRecord(SourceLocation Loc, RecordDataImpl &Record,
- const SourceManager &SM,
+ const SourceManager *SM,
unsigned TokSize = 0) {
- AddLocToRecord(Loc, SM, SM.getPresumedLoc(Loc), Record, TokSize);
+ AddLocToRecord(Loc, SM, SM ? SM->getPresumedLoc(Loc) : PresumedLoc(),
+ Record, TokSize);
}
/// \brief Add CharSourceRange information the specified record.
@@ -241,7 +244,7 @@
}
void SDiagsWriter::AddLocToRecord(SourceLocation Loc,
- const SourceManager &SM,
+ const SourceManager *SM,
PresumedLoc PLoc,
RecordDataImpl &Record,
unsigned TokSize) {
@@ -257,19 +260,19 @@
Record.push_back(getEmitFile(PLoc.getFilename()));
Record.push_back(PLoc.getLine());
Record.push_back(PLoc.getColumn()+TokSize);
- Record.push_back(SM.getFileOffset(Loc));
+ Record.push_back(SM->getFileOffset(Loc));
}
void SDiagsWriter::AddCharSourceRangeToRecord(CharSourceRange Range,
RecordDataImpl &Record,
const SourceManager &SM) {
- AddLocToRecord(Range.getBegin(), Record, SM);
+ AddLocToRecord(Range.getBegin(), Record, &SM);
unsigned TokSize = 0;
if (Range.isTokenRange())
TokSize = Lexer::MeasureTokenLength(Range.getEnd(),
SM, *LangOpts);
- AddLocToRecord(Range.getEnd(), Record, SM, TokSize);
+ AddLocToRecord(Range.getEnd(), Record, &SM, TokSize);
}
unsigned SDiagsWriter::getEmitFile(const char *FileName){
@@ -484,13 +487,15 @@
diagBuf.clear();
Info.FormatDiagnostic(diagBuf);
- SourceManager &SM = Info.getSourceManager();
- SDiagsRenderer Renderer(*this, Record, SM, *LangOpts, DiagOpts);
+ const SourceManager *
+ SM = Info.hasSourceManager() ? &Info.getSourceManager() : 0;
+ SDiagsRenderer Renderer(*this, Record, *LangOpts, DiagOpts);
Renderer.emitDiagnostic(Info.getLocation(), DiagLevel,
diagBuf.str(),
Info.getRanges(),
llvm::makeArrayRef(Info.getFixItHints(),
Info.getNumFixItHints()),
+ SM,
&Info);
}
@@ -500,6 +505,7 @@
DiagnosticsEngine::Level Level,
StringRef Message,
ArrayRef<clang::CharSourceRange> Ranges,
+ const SourceManager *SM,
DiagOrStoredDiag D) {
// Emit the RECORD_DIAG record.
Writer.Record.clear();
@@ -539,7 +545,8 @@
void SDiagsRenderer::emitCodeContext(SourceLocation Loc,
DiagnosticsEngine::Level Level,
SmallVectorImpl<CharSourceRange> &Ranges,
- ArrayRef<FixItHint> Hints) {
+ ArrayRef<FixItHint> Hints,
+ const SourceManager &SM) {
// Emit Source Ranges.
for (ArrayRef<CharSourceRange>::iterator it=Ranges.begin(), ei=Ranges.end();
it != ei; ++it) {
@@ -562,7 +569,8 @@
}
}
-void SDiagsRenderer::emitNote(SourceLocation Loc, StringRef Message) {
+void SDiagsRenderer::emitNote(SourceLocation Loc, StringRef Message,
+ const SourceManager *SM) {
Writer.Stream.EnterSubblock(BLOCK_DIAG, 4);
RecordData Record;
Record.push_back(RECORD_DIAG);
Modified: cfe/branches/tooling/lib/Frontend/TextDiagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Frontend/TextDiagnostic.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Frontend/TextDiagnostic.cpp (original)
+++ cfe/branches/tooling/lib/Frontend/TextDiagnostic.cpp Tue May 15 13:51:08 2012
@@ -602,10 +602,9 @@
}
TextDiagnostic::TextDiagnostic(raw_ostream &OS,
- const SourceManager &SM,
const LangOptions &LangOpts,
const DiagnosticOptions &DiagOpts)
- : DiagnosticRenderer(SM, LangOpts, DiagOpts), OS(OS) {}
+ : DiagnosticRenderer(LangOpts, DiagOpts), OS(OS) {}
TextDiagnostic::~TextDiagnostic() {}
@@ -615,11 +614,13 @@
DiagnosticsEngine::Level Level,
StringRef Message,
ArrayRef<clang::CharSourceRange> Ranges,
+ const SourceManager *SM,
DiagOrStoredDiag D) {
uint64_t StartOfLocationInfo = OS.tell();
// Emit the location of this particular diagnostic.
- emitDiagnosticLoc(Loc, PLoc, Level, Ranges);
+ if (Loc.isValid())
+ emitDiagnosticLoc(Loc, PLoc, Level, Ranges, *SM);
if (DiagOpts.ShowColors)
OS.resetColor();
@@ -693,7 +694,8 @@
/// ranges necessary.
void TextDiagnostic::emitDiagnosticLoc(SourceLocation Loc, PresumedLoc PLoc,
DiagnosticsEngine::Level Level,
- ArrayRef<CharSourceRange> Ranges) {
+ ArrayRef<CharSourceRange> Ranges,
+ const SourceManager &SM) {
if (PLoc.isInvalid()) {
// At least print the file name if available:
FileID FID = SM.getFileID(Loc);
@@ -799,7 +801,8 @@
}
void TextDiagnostic::emitIncludeLocation(SourceLocation Loc,
- PresumedLoc PLoc) {
+ PresumedLoc PLoc,
+ const SourceManager &SM) {
if (DiagOpts.ShowLocation)
OS << "In file included from " << PLoc.getFilename() << ':'
<< PLoc.getLine() << ":\n";
@@ -817,7 +820,8 @@
void TextDiagnostic::emitSnippetAndCaret(
SourceLocation Loc, DiagnosticsEngine::Level Level,
SmallVectorImpl<CharSourceRange>& Ranges,
- ArrayRef<FixItHint> Hints) {
+ ArrayRef<FixItHint> Hints,
+ const SourceManager &SM) {
assert(!Loc.isInvalid() && "must have a valid source location here");
assert(Loc.isFileID() && "must have a file location here");
@@ -878,7 +882,7 @@
for (SmallVectorImpl<CharSourceRange>::iterator I = Ranges.begin(),
E = Ranges.end();
I != E; ++I)
- highlightRange(*I, LineNo, FID, sourceColMap, CaretLine);
+ highlightRange(*I, LineNo, FID, sourceColMap, CaretLine, SM);
// Next, insert the caret itself.
ColNo = sourceColMap.byteToColumn(ColNo-1);
@@ -888,7 +892,7 @@
std::string FixItInsertionLine = buildFixItInsertionLine(LineNo,
sourceColMap,
- Hints);
+ Hints, SM);
// If the source line is too long for our terminal, select only the
// "interesting" source region within that line.
@@ -931,7 +935,7 @@
}
// Print out any parseable fixit information requested by the options.
- emitParseableFixits(Hints);
+ emitParseableFixits(Hints, SM);
}
void TextDiagnostic::emitSnippet(StringRef line) {
@@ -974,7 +978,8 @@
void TextDiagnostic::highlightRange(const CharSourceRange &R,
unsigned LineNo, FileID FID,
const SourceColumnMap &map,
- std::string &CaretLine) {
+ std::string &CaretLine,
+ const SourceManager &SM) {
if (!R.isValid()) return;
SourceLocation Begin = SM.getExpansionLoc(R.getBegin());
@@ -1059,7 +1064,8 @@
std::string TextDiagnostic::buildFixItInsertionLine(
unsigned LineNo,
const SourceColumnMap &map,
- ArrayRef<FixItHint> Hints) {
+ ArrayRef<FixItHint> Hints,
+ const SourceManager &SM) {
std::string FixItInsertionLine;
if (Hints.empty() || !DiagOpts.ShowFixits)
@@ -1114,7 +1120,8 @@
return FixItInsertionLine;
}
-void TextDiagnostic::emitParseableFixits(ArrayRef<FixItHint> Hints) {
+void TextDiagnostic::emitParseableFixits(ArrayRef<FixItHint> Hints,
+ const SourceManager &SM) {
if (!DiagOpts.ShowParseableFixits)
return;
Modified: cfe/branches/tooling/lib/Frontend/TextDiagnosticPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Frontend/TextDiagnosticPrinter.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Frontend/TextDiagnosticPrinter.cpp (original)
+++ cfe/branches/tooling/lib/Frontend/TextDiagnosticPrinter.cpp Tue May 15 13:51:08 2012
@@ -27,7 +27,7 @@
TextDiagnosticPrinter::TextDiagnosticPrinter(raw_ostream &os,
const DiagnosticOptions &diags,
bool _OwnsOutputStream)
- : OS(os), LangOpts(0), DiagOpts(&diags), SM(0),
+ : OS(os), DiagOpts(&diags),
OwnsOutputStream(_OwnsOutputStream) {
}
@@ -38,11 +38,11 @@
void TextDiagnosticPrinter::BeginSourceFile(const LangOptions &LO,
const Preprocessor *PP) {
- LangOpts = &LO;
+ // Build the TextDiagnostic utility.
+ TextDiag.reset(new TextDiagnostic(OS, LO, *DiagOpts));
}
void TextDiagnosticPrinter::EndSourceFile() {
- LangOpts = 0;
TextDiag.reset(0);
}
@@ -152,22 +152,16 @@
}
// Assert that the rest of our infrastructure is setup properly.
- assert(LangOpts && "Unexpected diagnostic outside source file processing");
assert(DiagOpts && "Unexpected diagnostic without options set");
assert(Info.hasSourceManager() &&
"Unexpected diagnostic with no source manager");
-
- // Rebuild the TextDiagnostic utility if missing or the source manager has
- // changed.
- if (!TextDiag || SM != &Info.getSourceManager()) {
- SM = &Info.getSourceManager();
- TextDiag.reset(new TextDiagnostic(OS, *SM, *LangOpts, *DiagOpts));
- }
+ assert(TextDiag && "Unexpected diagnostic outside source file processing");
TextDiag->emitDiagnostic(Info.getLocation(), Level, DiagMessageStream.str(),
Info.getRanges(),
llvm::makeArrayRef(Info.getFixItHints(),
- Info.getNumFixItHints()));
+ Info.getNumFixItHints()),
+ &Info.getSourceManager());
OS.flush();
}
Modified: cfe/branches/tooling/lib/Lex/PPMacroExpansion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Lex/PPMacroExpansion.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Lex/PPMacroExpansion.cpp (original)
+++ cfe/branches/tooling/lib/Lex/PPMacroExpansion.cpp Tue May 15 13:51:08 2012
@@ -242,9 +242,27 @@
// Remember where the token is expanded.
SourceLocation ExpandLoc = Identifier.getLocation();
+ SourceRange ExpansionRange(ExpandLoc, ExpansionEnd);
- if (Callbacks) Callbacks->MacroExpands(Identifier, MI,
- SourceRange(ExpandLoc, ExpansionEnd));
+ if (Callbacks) {
+ if (InMacroArgs) {
+ // We can have macro expansion inside a conditional directive while
+ // reading the function macro arguments. To ensure, in that case, that
+ // MacroExpands callbacks still happen in source order, queue this
+ // callback to have it happen after the function macro callback.
+ DelayedMacroExpandsCallbacks.push_back(
+ MacroExpandsInfo(Identifier, MI, ExpansionRange));
+ } else {
+ Callbacks->MacroExpands(Identifier, MI, ExpansionRange);
+ if (!DelayedMacroExpandsCallbacks.empty()) {
+ for (unsigned i=0, e = DelayedMacroExpandsCallbacks.size(); i!=e; ++i) {
+ MacroExpandsInfo &Info = DelayedMacroExpandsCallbacks[i];
+ Callbacks->MacroExpands(Info.Tok, Info.MI, Info.Range);
+ }
+ DelayedMacroExpandsCallbacks.clear();
+ }
+ }
+ }
// If we started lexing a macro, enter the macro expansion body.
Modified: cfe/branches/tooling/lib/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Parse/ParseDecl.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Parse/ParseDecl.cpp (original)
+++ cfe/branches/tooling/lib/Parse/ParseDecl.cpp Tue May 15 13:51:08 2012
@@ -38,6 +38,8 @@
AccessSpecifier AS,
Decl **OwnedType) {
DeclSpecContext DSC = getDeclSpecContextFromDeclaratorContext(Context);
+ if (DSC == DSC_normal)
+ DSC = DSC_type_specifier;
// Parse the common declaration-specifiers piece.
DeclSpec DS(AttrFactory);
@@ -1543,7 +1545,8 @@
// Validate declspec for type-name.
unsigned Specs = DS.getParsedSpecifiers();
- if (DSC == DSC_type_specifier && !DS.hasTypeSpecifier()) {
+ if ((DSC == DSC_type_specifier || DSC == DSC_trailing) &&
+ !DS.hasTypeSpecifier()) {
Diag(Tok, diag::err_expected_type);
DS.SetTypeSpecError();
} else if (Specs == DeclSpec::PQ_None && !DS.getNumProtocolQualifiers() &&
@@ -1640,7 +1643,7 @@
// FIXME: Don't bail out here in languages with no implicit int (like
// C++ with no -fms-extensions). This is much more likely to be an undeclared
// type or typo than a use of implicit int.
- if (DSC != DSC_type_specifier &&
+ if (DSC != DSC_type_specifier && DSC != DSC_trailing &&
isValidAfterIdentifierInDeclarator(NextToken())) {
// If this token is valid for implicit int, e.g. "static x = 4", then
// we just avoid eating the identifier, so it will be parsed as the
@@ -1921,7 +1924,7 @@
continue;
case tok::annot_cxxscope: {
- if (DS.hasTypeSpecifier())
+ if (DS.hasTypeSpecifier() || DS.isTypeAltiVecVector())
goto DoneWithDeclSpec;
CXXScopeSpec SS;
@@ -2119,6 +2122,11 @@
if (TryAltiVecToken(DS, Loc, PrevSpec, DiagID, isInvalid))
break;
+ // [AltiVec] 2.2: [If the 'vector' specifier is used] The syntax does not
+ // allow the use of a typedef name as a type specifier.
+ if (DS.isTypeAltiVecVector())
+ goto DoneWithDeclSpec;
+
ParsedType TypeRep =
Actions.getTypeName(*Tok.getIdentifierInfo(),
Tok.getLocation(), getCurScope());
Modified: cfe/branches/tooling/lib/Parse/ParseDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Parse/ParseDeclCXX.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Parse/ParseDeclCXX.cpp (original)
+++ cfe/branches/tooling/lib/Parse/ParseDeclCXX.cpp Tue May 15 13:51:08 2012
@@ -1704,12 +1704,16 @@
}
// Access declarations.
+ bool MalformedTypeSpec = false;
if (!TemplateInfo.Kind &&
- (Tok.is(tok::identifier) || Tok.is(tok::coloncolon)) &&
- !TryAnnotateCXXScopeToken() &&
- Tok.is(tok::annot_cxxscope)) {
- bool isAccessDecl = false;
- if (NextToken().is(tok::identifier))
+ (Tok.is(tok::identifier) || Tok.is(tok::coloncolon))) {
+ if (TryAnnotateCXXScopeToken())
+ MalformedTypeSpec = true;
+
+ bool isAccessDecl;
+ if (Tok.isNot(tok::annot_cxxscope))
+ isAccessDecl = false;
+ else if (NextToken().is(tok::identifier))
isAccessDecl = GetLookAheadToken(2).is(tok::semi);
else
isAccessDecl = NextToken().is(tok::kw_operator);
@@ -1806,6 +1810,8 @@
// Parse the common declaration-specifiers piece.
ParsingDeclSpec DS(*this, TemplateDiags);
DS.takeAttributesFrom(attrs);
+ if (MalformedTypeSpec)
+ DS.SetTypeSpecError();
ParseDeclarationSpecifiers(DS, TemplateInfo, AS, DSC_class,
&CommonLateParsedAttrs);
Modified: cfe/branches/tooling/lib/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Parse/ParseObjc.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Parse/ParseObjc.cpp (original)
+++ cfe/branches/tooling/lib/Parse/ParseObjc.cpp Tue May 15 13:51:08 2012
@@ -894,6 +894,7 @@
DeclSpec declSpec(AttrFactory);
declSpec.setObjCQualifiers(&DS);
ParseSpecifierQualifierList(declSpec);
+ declSpec.SetRangeEnd(Tok.getLocation().getLocWithOffset(-1));
Declarator declarator(declSpec, context);
ParseDeclarator(declarator);
@@ -2597,7 +2598,10 @@
ExprResult ValueExpr(ParseAssignmentExpression());
if (T.consumeClose())
return ExprError();
-
+
+ if (ValueExpr.isInvalid())
+ return ExprError();
+
// Wrap the sub-expression in a parenthesized expression, to distinguish
// a boxed expression from a literal.
SourceLocation LPLoc = T.getOpenLocation(), RPLoc = T.getCloseLocation();
Modified: cfe/branches/tooling/lib/Parse/Parser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Parse/Parser.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Parse/Parser.cpp (original)
+++ cfe/branches/tooling/lib/Parse/Parser.cpp Tue May 15 13:51:08 2012
@@ -1248,7 +1248,8 @@
bool Parser::TryAnnotateTypeOrScopeToken(bool EnteringContext, bool NeedType) {
assert((Tok.is(tok::identifier) || Tok.is(tok::coloncolon)
|| Tok.is(tok::kw_typename) || Tok.is(tok::annot_cxxscope)
- || Tok.is(tok::kw_decltype)) && "Cannot be a type or scope token!");
+ || Tok.is(tok::kw_decltype) || Tok.is(tok::annot_template_id))
+ && "Cannot be a type or scope token!");
if (Tok.is(tok::kw_typename)) {
// Parse a C++ typename-specifier, e.g., "typename T::type".
@@ -1264,10 +1265,21 @@
0, /*IsTypename*/true))
return true;
if (!SS.isSet()) {
- if (getLangOpts().MicrosoftExt)
- Diag(Tok.getLocation(), diag::warn_expected_qualified_after_typename);
- else
- Diag(Tok.getLocation(), diag::err_expected_qualified_after_typename);
+ if (Tok.is(tok::identifier) || Tok.is(tok::annot_template_id)) {
+ // Attempt to recover by skipping the invalid 'typename'
+ if (!TryAnnotateTypeOrScopeToken(EnteringContext, NeedType) &&
+ Tok.isAnnotation()) {
+ unsigned DiagID = diag::err_expected_qualified_after_typename;
+ // MS compatibility: MSVC permits using known types with typename.
+ // e.g. "typedef typename T* pointer_type"
+ if (getLangOpts().MicrosoftExt)
+ DiagID = diag::warn_expected_qualified_after_typename;
+ Diag(Tok.getLocation(), DiagID);
+ return false;
+ }
+ }
+
+ Diag(Tok.getLocation(), diag::err_expected_qualified_after_typename);
return true;
}
@@ -1420,8 +1432,7 @@
/// TryAnnotateScopeToken - Like TryAnnotateTypeOrScopeToken but only
/// annotates C++ scope specifiers and template-ids. This returns
-/// true if the token was annotated or there was an error that could not be
-/// recovered from.
+/// true if there was an error that could not be recovered from.
///
/// Note that this routine emits an error if you call it with ::new or ::delete
/// as the current tokens, so only call it in contexts where these are invalid.
Modified: cfe/branches/tooling/lib/Rewrite/RewriteModernObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Rewrite/RewriteModernObjC.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Rewrite/RewriteModernObjC.cpp (original)
+++ cfe/branches/tooling/lib/Rewrite/RewriteModernObjC.cpp Tue May 15 13:51:08 2012
@@ -307,6 +307,8 @@
void RewriteObjCQualifiedInterfaceTypes(Decl *Dcl);
void RewriteTypeOfDecl(VarDecl *VD);
void RewriteObjCQualifiedInterfaceTypes(Expr *E);
+
+ std::string getIvarAccessString(ObjCIvarDecl *D);
// Expression Rewriting.
Stmt *RewriteFunctionBodyOrGlobalInitializer(Stmt *S);
@@ -771,13 +773,73 @@
}
}
-static std::string getIvarAccessString(ObjCIvarDecl *OID) {
- const ObjCInterfaceDecl *ClassDecl = OID->getContainingInterface();
- std::string S;
- S = "((struct ";
- S += ClassDecl->getIdentifier()->getName();
- S += "_IMPL *)self)->";
- S += OID->getName();
+static void WriteInternalIvarName(const ObjCInterfaceDecl *IDecl,
+ ObjCIvarDecl *IvarDecl, std::string &Result) {
+ Result += "OBJC_IVAR_$_";
+ Result += IDecl->getName();
+ Result += "$";
+ Result += IvarDecl->getName();
+}
+
+std::string
+RewriteModernObjC::getIvarAccessString(ObjCIvarDecl *D) {
+ const ObjCInterfaceDecl *ClassDecl = D->getContainingInterface();
+
+ // Build name of symbol holding ivar offset.
+ std::string IvarOffsetName;
+ WriteInternalIvarName(ClassDecl, D, IvarOffsetName);
+
+
+ std::string S = "(*(";
+ QualType IvarT = D->getType();
+
+ if (!isa<TypedefType>(IvarT) && IvarT->isRecordType()) {
+ RecordDecl *RD = IvarT->getAs<RecordType>()->getDecl();
+ RD = RD->getDefinition();
+ if (RD && !RD->getDeclName().getAsIdentifierInfo()) {
+ // decltype(((Foo_IMPL*)0)->bar) *
+ ObjCContainerDecl *CDecl =
+ dyn_cast<ObjCContainerDecl>(D->getDeclContext());
+ // ivar in class extensions requires special treatment.
+ if (ObjCCategoryDecl *CatDecl = dyn_cast<ObjCCategoryDecl>(CDecl))
+ CDecl = CatDecl->getClassInterface();
+ std::string RecName = CDecl->getName();
+ RecName += "_IMPL";
+ RecordDecl *RD = RecordDecl::Create(*Context, TTK_Struct, TUDecl,
+ SourceLocation(), SourceLocation(),
+ &Context->Idents.get(RecName.c_str()));
+ QualType PtrStructIMPL = Context->getPointerType(Context->getTagDeclType(RD));
+ unsigned UnsignedIntSize =
+ static_cast<unsigned>(Context->getTypeSize(Context->UnsignedIntTy));
+ Expr *Zero = IntegerLiteral::Create(*Context,
+ llvm::APInt(UnsignedIntSize, 0),
+ Context->UnsignedIntTy, SourceLocation());
+ Zero = NoTypeInfoCStyleCastExpr(Context, PtrStructIMPL, CK_BitCast, Zero);
+ ParenExpr *PE = new (Context) ParenExpr(SourceLocation(), SourceLocation(),
+ Zero);
+ FieldDecl *FD = FieldDecl::Create(*Context, 0, SourceLocation(),
+ SourceLocation(),
+ &Context->Idents.get(D->getNameAsString()),
+ IvarT, 0,
+ /*BitWidth=*/0, /*Mutable=*/true,
+ /*HasInit=*/false);
+ MemberExpr *ME = new (Context) MemberExpr(PE, true, FD, SourceLocation(),
+ FD->getType(), VK_LValue,
+ OK_Ordinary);
+ IvarT = Context->getDecltypeType(ME, ME->getType());
+ }
+ }
+ convertObjCTypeToCStyleType(IvarT);
+ QualType castT = Context->getPointerType(IvarT);
+ std::string TypeString(castT.getAsString(Context->getPrintingPolicy()));
+ S += TypeString;
+ S += ")";
+
+ // ((char *)self + IVAR_OFFSET_SYMBOL_NAME)
+ S += "((char *)self + ";
+ S += IvarOffsetName;
+ S += "))";
+ ReferencedIvars[const_cast<ObjCInterfaceDecl *>(ClassDecl)].insert(D);
return S;
}
@@ -2399,12 +2461,12 @@
SC_None, false);
}
-// SynthGetClassFunctionDecl - id objc_getClass(const char *name);
+// SynthGetClassFunctionDecl - Class objc_getClass(const char *name);
void RewriteModernObjC::SynthGetClassFunctionDecl() {
IdentifierInfo *getClassIdent = &Context->Idents.get("objc_getClass");
SmallVector<QualType, 16> ArgTys;
ArgTys.push_back(Context->getPointerType(Context->CharTy.withConst()));
- QualType getClassType = getSimpleFunctionType(Context->getObjCIdType(),
+ QualType getClassType = getSimpleFunctionType(Context->getObjCClassType(),
&ArgTys[0], ArgTys.size());
GetClassFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
SourceLocation(),
@@ -2432,12 +2494,12 @@
false);
}
-// SynthGetMetaClassFunctionDecl - id objc_getMetaClass(const char *name);
+// SynthGetMetaClassFunctionDecl - Class objc_getMetaClass(const char *name);
void RewriteModernObjC::SynthGetMetaClassFunctionDecl() {
IdentifierInfo *getClassIdent = &Context->Idents.get("objc_getMetaClass");
SmallVector<QualType, 16> ArgTys;
ArgTys.push_back(Context->getPointerType(Context->CharTy.withConst()));
- QualType getClassType = getSimpleFunctionType(Context->getObjCIdType(),
+ QualType getClassType = getSimpleFunctionType(Context->getObjCClassType(),
&ArgTys[0], ArgTys.size());
GetMetaClassFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
SourceLocation(),
@@ -3048,17 +3110,14 @@
ClassDecl->getIdentifier()->getName(),
StringLiteral::Ascii, false,
argType, SourceLocation()));
+ // (Class)objc_getClass("CurrentClass")
CallExpr *Cls = SynthesizeCallToFunctionDecl(GetMetaClassFunctionDecl,
&ClsExprs[0],
ClsExprs.size(),
StartLoc,
EndLoc);
- // (Class)objc_getClass("CurrentClass")
- CastExpr *ArgExpr = NoTypeInfoCStyleCastExpr(Context,
- Context->getObjCClassType(),
- CK_BitCast, Cls);
ClsExprs.clear();
- ClsExprs.push_back(ArgExpr);
+ ClsExprs.push_back(Cls);
Cls = SynthesizeCallToFunctionDecl(GetSuperClassFunctionDecl,
&ClsExprs[0], ClsExprs.size(),
StartLoc, EndLoc);
@@ -3131,7 +3190,10 @@
&ClsExprs[0],
ClsExprs.size(),
StartLoc, EndLoc);
- MsgExprs.push_back(Cls);
+ CastExpr *ArgExpr = NoTypeInfoCStyleCastExpr(Context,
+ Context->getObjCIdType(),
+ CK_BitCast, Cls);
+ MsgExprs.push_back(ArgExpr);
break;
}
@@ -3159,16 +3221,13 @@
ClassDecl->getIdentifier()->getName(),
StringLiteral::Ascii, false, argType,
SourceLocation()));
+ // (Class)objc_getClass("CurrentClass")
CallExpr *Cls = SynthesizeCallToFunctionDecl(GetClassFunctionDecl,
&ClsExprs[0],
ClsExprs.size(),
StartLoc, EndLoc);
- // (Class)objc_getClass("CurrentClass")
- CastExpr *ArgExpr = NoTypeInfoCStyleCastExpr(Context,
- Context->getObjCClassType(),
- CK_BitCast, Cls);
ClsExprs.clear();
- ClsExprs.push_back(ArgExpr);
+ ClsExprs.push_back(Cls);
Cls = SynthesizeCallToFunctionDecl(GetSuperClassFunctionDecl,
&ClsExprs[0], ClsExprs.size(),
StartLoc, EndLoc);
@@ -3724,14 +3783,6 @@
llvm_unreachable("struct already synthesize- RewriteObjCInternalStruct");
}
-static void WriteInternalIvarName(ObjCInterfaceDecl *IDecl,
- ObjCIvarDecl *IvarDecl, std::string &Result) {
- Result += "OBJC_IVAR_$_";
- Result += IDecl->getName();
- Result += "$";
- Result += IvarDecl->getName();
-}
-
/// RewriteIvarOffsetSymbols - Rewrite ivar offset symbols of those ivars which
/// have been referenced in an ivar access expression.
void RewriteModernObjC::RewriteIvarOffsetSymbols(ObjCInterfaceDecl *CDecl,
@@ -5647,6 +5698,10 @@
}
InsertText(SM->getLocForStartOfFile(MainFileID), Preamble, false);
+
+ if (ClassImplementation.size() || CategoryImplementation.size())
+ RewriteImplementations();
+
for (unsigned i = 0, e = ObjCInterfacesSeen.size(); i < e; i++) {
ObjCInterfaceDecl *CDecl = ObjCInterfacesSeen[i];
// Write struct declaration for the class matching its ivar declarations.
@@ -5655,9 +5710,6 @@
// private ivars.
RewriteInterfaceDecl(CDecl);
}
-
- if (ClassImplementation.size() || CategoryImplementation.size())
- RewriteImplementations();
// Get the buffer corresponding to MainFileID. If we haven't changed it, then
// we are done.
@@ -5743,11 +5795,11 @@
Preamble += "__OBJC_RW_DLLIMPORT void objc_msgSendSuper_stret(void);\n";
Preamble += "__OBJC_RW_DLLIMPORT void objc_msgSend_fpret(void);\n";
- Preamble += "__OBJC_RW_DLLIMPORT struct objc_object *objc_getClass";
+ Preamble += "__OBJC_RW_DLLIMPORT struct objc_class *objc_getClass";
Preamble += "(const char *);\n";
Preamble += "__OBJC_RW_DLLIMPORT struct objc_class *class_getSuperclass";
Preamble += "(struct objc_class *);\n";
- Preamble += "__OBJC_RW_DLLIMPORT struct objc_object *objc_getMetaClass";
+ Preamble += "__OBJC_RW_DLLIMPORT struct objc_class *objc_getMetaClass";
Preamble += "(const char *);\n";
Preamble += "__OBJC_RW_DLLIMPORT void objc_exception_throw( struct objc_object *);\n";
// @synchronized hooks.
@@ -7296,7 +7348,7 @@
if (BaseExpr->getType()->isObjCObjectPointerType()) {
const ObjCInterfaceType *iFaceDecl =
- dyn_cast<ObjCInterfaceType>(BaseExpr->getType()->getPointeeType());
+ dyn_cast<ObjCInterfaceType>(BaseExpr->getType()->getPointeeType());
assert(iFaceDecl && "RewriteObjCIvarRefExpr - iFaceDecl is null");
// lookup which class implements the instance variable.
ObjCInterfaceDecl *clsDeclared = 0;
Modified: cfe/branches/tooling/lib/Sema/AnalysisBasedWarnings.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/AnalysisBasedWarnings.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/AnalysisBasedWarnings.cpp (original)
+++ cfe/branches/tooling/lib/Sema/AnalysisBasedWarnings.cpp Tue May 15 13:51:08 2012
@@ -464,44 +464,36 @@
static bool DiagnoseUninitializedUse(Sema &S, const VarDecl *VD,
const Expr *E, bool isAlwaysUninit,
bool alwaysReportSelfInit = false) {
- bool isSelfInit = false;
if (const DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(E)) {
- if (isAlwaysUninit) {
- // Inspect the initializer of the variable declaration which is
- // being referenced prior to its initialization. We emit
- // specialized diagnostics for self-initialization, and we
- // specifically avoid warning about self references which take the
- // form of:
- //
- // int x = x;
- //
- // This is used to indicate to GCC that 'x' is intentionally left
- // uninitialized. Proven code paths which access 'x' in
- // an uninitialized state after this will still warn.
- //
- // TODO: Should we suppress maybe-uninitialized warnings for
- // variables initialized in this way?
- if (const Expr *Initializer = VD->getInit()) {
- if (!alwaysReportSelfInit && DRE == Initializer->IgnoreParenImpCasts())
- return false;
-
- ContainsReference CR(S.Context, DRE);
- CR.Visit(const_cast<Expr*>(Initializer));
- isSelfInit = CR.doesContainReference();
- }
- if (isSelfInit) {
+ // Inspect the initializer of the variable declaration which is
+ // being referenced prior to its initialization. We emit
+ // specialized diagnostics for self-initialization, and we
+ // specifically avoid warning about self references which take the
+ // form of:
+ //
+ // int x = x;
+ //
+ // This is used to indicate to GCC that 'x' is intentionally left
+ // uninitialized. Proven code paths which access 'x' in
+ // an uninitialized state after this will still warn.
+ if (const Expr *Initializer = VD->getInit()) {
+ if (!alwaysReportSelfInit && DRE == Initializer->IgnoreParenImpCasts())
+ return false;
+
+ ContainsReference CR(S.Context, DRE);
+ CR.Visit(const_cast<Expr*>(Initializer));
+ if (CR.doesContainReference()) {
S.Diag(DRE->getLocStart(),
diag::warn_uninit_self_reference_in_init)
- << VD->getDeclName() << VD->getLocation() << DRE->getSourceRange();
- } else {
- S.Diag(DRE->getLocStart(), diag::warn_uninit_var)
- << VD->getDeclName() << DRE->getSourceRange();
+ << VD->getDeclName() << VD->getLocation() << DRE->getSourceRange();
+ return true;
}
- } else {
- S.Diag(DRE->getLocStart(), diag::warn_maybe_uninit_var)
- << VD->getDeclName() << DRE->getSourceRange();
}
+
+ S.Diag(DRE->getLocStart(), isAlwaysUninit ? diag::warn_uninit_var
+ : diag::warn_maybe_uninit_var)
+ << VD->getDeclName() << DRE->getSourceRange();
} else {
const BlockExpr *BE = cast<BlockExpr>(E);
if (VD->getType()->isBlockPointerType() &&
@@ -518,7 +510,7 @@
// Report where the variable was declared when the use wasn't within
// the initializer of that declaration & we didn't already suggest
// an initialization fixit.
- if (!isSelfInit && !SuggestInitializationFixit(S, VD))
+ if (!SuggestInitializationFixit(S, VD))
S.Diag(VD->getLocStart(), diag::note_uninit_var_def)
<< VD->getDeclName();
Modified: cfe/branches/tooling/lib/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaChecking.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaChecking.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaChecking.cpp Tue May 15 13:51:08 2012
@@ -22,6 +22,7 @@
#include "clang/AST/CharUnits.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
+#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/ExprObjC.h"
#include "clang/AST/EvaluatedExprVisitor.h"
@@ -1569,10 +1570,16 @@
}
if (isConstant) {
- if (const Expr *Init = VD->getAnyInitializer())
+ if (const Expr *Init = VD->getAnyInitializer()) {
+ // Look through initializers like const char c[] = { "foo" }
+ if (const InitListExpr *InitList = dyn_cast<InitListExpr>(Init)) {
+ if (InitList->isStringLiteralInit())
+ Init = InitList->getInit(0)->IgnoreParenImpCasts();
+ }
return SemaCheckStringLiteral(Init, Args, NumArgs,
HasVAListArg, format_idx, firstDataArg,
Type, /*inFunctionCall*/false);
+ }
}
// For vprintf* functions (i.e., HasVAListArg==true), we add a
@@ -4075,8 +4082,17 @@
== llvm::APFloat::opOK && isExact)
return;
+ SmallString<16> PrettySourceValue;
+ Value.toString(PrettySourceValue);
+ SmallString<16> PrettyTargetValue;
+ if (T->isSpecificBuiltinType(BuiltinType::Bool))
+ PrettyTargetValue = IntegerValue == 0 ? "false" : "true";
+ else
+ IntegerValue.toString(PrettyTargetValue);
+
S.Diag(FL->getExprLoc(), diag::warn_impcast_literal_float_to_integer)
- << FL->getType() << T << FL->getSourceRange() << SourceRange(CContext);
+ << FL->getType() << T.getUnqualifiedType() << PrettySourceValue
+ << PrettyTargetValue << FL->getSourceRange() << SourceRange(CContext);
}
std::string PrettyPrintInRange(const llvm::APSInt &Value, IntRange Range) {
@@ -4143,7 +4159,6 @@
}
}
}
- return; // Other casts to bool are not checked.
}
// Strip vector types.
@@ -4207,7 +4222,7 @@
}
// If the target is integral, always warn.
- if ((TargetBT && TargetBT->isInteger())) {
+ if (TargetBT && TargetBT->isInteger()) {
if (S.SourceMgr.isInSystemMacro(CC))
return;
@@ -4241,6 +4256,11 @@
return;
}
+ // TODO: remove this early return once the false positives for constant->bool
+ // in templates, macros, etc, are reduced or removed.
+ if (Target->isSpecificBuiltinType(BuiltinType::Bool))
+ return;
+
IntRange SourceRange = GetExprRange(S.Context, E);
IntRange TargetRange = IntRange::forTargetOfCanonicalType(S.Context, Target);
@@ -4590,12 +4610,20 @@
// substitution to form C89 tail-padded arrays.
TypeSourceInfo *TInfo = FD->getTypeSourceInfo();
- if (TInfo) {
- ConstantArrayTypeLoc TL =
- cast<ConstantArrayTypeLoc>(TInfo->getTypeLoc());
- const Expr *SizeExpr = dyn_cast<IntegerLiteral>(TL.getSizeExpr());
+ while (TInfo) {
+ TypeLoc TL = TInfo->getTypeLoc();
+ // Look through typedefs.
+ const TypedefTypeLoc *TTL = dyn_cast<TypedefTypeLoc>(&TL);
+ if (TTL) {
+ const TypedefNameDecl *TDL = TTL->getTypedefNameDecl();
+ TInfo = TDL->getTypeSourceInfo();
+ continue;
+ }
+ ConstantArrayTypeLoc CTL = cast<ConstantArrayTypeLoc>(TL);
+ const Expr *SizeExpr = dyn_cast<IntegerLiteral>(CTL.getSizeExpr());
if (!SizeExpr || SizeExpr->getExprLoc().isMacroID())
return false;
+ break;
}
const RecordDecl *RD = dyn_cast<RecordDecl>(FD->getDeclContext());
Modified: cfe/branches/tooling/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaDecl.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaDecl.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaDecl.cpp Tue May 15 13:51:08 2012
@@ -1518,12 +1518,22 @@
switch (TypeID->getLength()) {
default: break;
case 2:
- if (!TypeID->isStr("id"))
- break;
- Context.setObjCIdRedefinitionType(New->getUnderlyingType());
- // Install the built-in type for 'id', ignoring the current definition.
- New->setTypeForDecl(Context.getObjCIdType().getTypePtr());
- return;
+ {
+ if (!TypeID->isStr("id"))
+ break;
+ QualType T = New->getUnderlyingType();
+ if (!T->isPointerType())
+ break;
+ if (!T->isVoidPointerType()) {
+ QualType PT = T->getAs<PointerType>()->getPointeeType();
+ if (!PT->isStructureType())
+ break;
+ }
+ Context.setObjCIdRedefinitionType(T);
+ // Install the built-in type for 'id', ignoring the current definition.
+ New->setTypeForDecl(Context.getObjCIdType().getTypePtr());
+ return;
+ }
case 5:
if (!TypeID->isStr("Class"))
break;
@@ -1658,6 +1668,36 @@
return false;
}
+bool Sema::mergeDeclAttribute(Decl *D, InheritableAttr *Attr) {
+ InheritableAttr *NewAttr = NULL;
+ if (AvailabilityAttr *AA = dyn_cast<AvailabilityAttr>(Attr))
+ NewAttr = mergeAvailabilityAttr(D, AA->getRange(), AA->getPlatform(),
+ AA->getIntroduced(), AA->getDeprecated(),
+ AA->getObsoleted(), AA->getUnavailable(),
+ AA->getMessage());
+ else if (VisibilityAttr *VA = dyn_cast<VisibilityAttr>(Attr))
+ NewAttr = mergeVisibilityAttr(D, VA->getRange(), VA->getVisibility());
+ else if (DLLImportAttr *ImportA = dyn_cast<DLLImportAttr>(Attr))
+ NewAttr = mergeDLLImportAttr(D, ImportA->getRange());
+ else if (DLLExportAttr *ExportA = dyn_cast<DLLExportAttr>(Attr))
+ NewAttr = mergeDLLExportAttr(D, ExportA->getRange());
+ else if (FormatAttr *FA = dyn_cast<FormatAttr>(Attr))
+ NewAttr = mergeFormatAttr(D, FA->getRange(), FA->getType(),
+ FA->getFormatIdx(), FA->getFirstArg());
+ else if (SectionAttr *SA = dyn_cast<SectionAttr>(Attr))
+ NewAttr = mergeSectionAttr(D, SA->getRange(), SA->getName());
+ else if (!DeclHasAttr(D, Attr))
+ NewAttr = cast<InheritableAttr>(Attr->clone(Context));
+
+ if (NewAttr) {
+ NewAttr->setInherited(true);
+ D->addAttr(NewAttr);
+ return true;
+ }
+
+ return false;
+}
+
/// mergeDeclAttributes - Copy attributes from the Old decl to the New one.
void Sema::mergeDeclAttributes(Decl *New, Decl *Old,
bool MergeDeprecation) {
@@ -1681,12 +1721,8 @@
isa<AvailabilityAttr>(*i)))
continue;
- if (!DeclHasAttr(New, *i)) {
- InheritableAttr *newAttr = cast<InheritableAttr>((*i)->clone(Context));
- newAttr->setInherited(true);
- New->addAttr(newAttr);
+ if (mergeDeclAttribute(New, *i))
foundAny = true;
- }
}
if (!foundAny) New->dropAttrs();
@@ -5376,6 +5412,10 @@
NewFD->setInvalidDecl();
}
+ // Handle attributes.
+ ProcessDeclAttributes(S, NewFD, D,
+ /*NonInheritable=*/false, /*Inheritable=*/true);
+
if (!getLangOpts().CPlusPlus) {
// Perform semantic checking on the function declaration.
bool isExplicitSpecialization=false;
@@ -5623,14 +5663,6 @@
<< D.getCXXScopeSpec().getRange();
}
}
-
-
- // Handle attributes. We need to have merged decls when handling attributes
- // (for example to check for conflicts, etc).
- // FIXME: This needs to happen before we merge declarations. Then,
- // let attribute merging cope with attribute conflicts.
- ProcessDeclAttributes(S, NewFD, D,
- /*NonInheritable=*/false, /*Inheritable=*/true);
// attributes declared post-definition are currently ignored
// FIXME: This should happen during attribute merging
@@ -6083,55 +6115,73 @@
}
}
- void VisitExpr(Expr *E) {
- if (isa<ObjCMessageExpr>(*E)) return;
- if (isRecordType) {
- Expr *expr = E;
- if (MemberExpr *ME = dyn_cast<MemberExpr>(E)) {
- ValueDecl *VD = ME->getMemberDecl();
- if (isa<EnumConstantDecl>(VD) || isa<VarDecl>(VD)) return;
- expr = ME->getBase();
- }
- if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(expr)) {
+ // Sometimes, the expression passed in lacks the casts that are used
+ // to determine which DeclRefExpr's to check. Assume that the casts
+ // are present and continue visiting the expression.
+ void HandleExpr(Expr *E) {
+ // Skip checking T a = a where T is not a record type. Doing so is a
+ // way to silence uninitialized warnings.
+ if (isRecordType)
+ if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(E))
HandleDeclRefExpr(DRE);
- return;
- }
+
+ if (ConditionalOperator *CO = dyn_cast<ConditionalOperator>(E)) {
+ HandleValue(CO->getTrueExpr());
+ HandleValue(CO->getFalseExpr());
+ }
+
+ Visit(E);
+ }
+
+ // For most expressions, the cast is directly above the DeclRefExpr.
+ // For conditional operators, the cast can be outside the conditional
+ // operator if both expressions are DeclRefExpr's.
+ void HandleValue(Expr *E) {
+ E = E->IgnoreParenImpCasts();
+ if (DeclRefExpr* DRE = dyn_cast<DeclRefExpr>(E)) {
+ HandleDeclRefExpr(DRE);
+ return;
}
- Inherited::VisitExpr(E);
+
+ if (ConditionalOperator *CO = dyn_cast<ConditionalOperator>(E)) {
+ HandleValue(CO->getTrueExpr());
+ HandleValue(CO->getFalseExpr());
+ }
+ }
+
+ void VisitImplicitCastExpr(ImplicitCastExpr *E) {
+ if ((!isRecordType && E->getCastKind() == CK_LValueToRValue) ||
+ (isRecordType && E->getCastKind() == CK_NoOp))
+ HandleValue(E->getSubExpr());
+
+ Inherited::VisitImplicitCastExpr(E);
}
void VisitMemberExpr(MemberExpr *E) {
+ // Don't warn on arrays since they can be treated as pointers.
if (E->getType()->canDecayToPointerType()) return;
+
ValueDecl *VD = E->getMemberDecl();
- if (isa<FieldDecl>(VD) || isa<CXXMethodDecl>(VD))
+ CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(VD);
+ if (isa<FieldDecl>(VD) || (MD && !MD->isStatic()))
if (DeclRefExpr *DRE
= dyn_cast<DeclRefExpr>(E->getBase()->IgnoreParenImpCasts())) {
HandleDeclRefExpr(DRE);
return;
}
- Inherited::VisitMemberExpr(E);
- }
- void VisitImplicitCastExpr(ImplicitCastExpr *E) {
- if ((!isRecordType &&E->getCastKind() == CK_LValueToRValue) ||
- (isRecordType && E->getCastKind() == CK_NoOp)) {
- Expr* SubExpr = E->getSubExpr()->IgnoreParenImpCasts();
- if (MemberExpr *ME = dyn_cast<MemberExpr>(SubExpr))
- SubExpr = ME->getBase()->IgnoreParenImpCasts();
- if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(SubExpr)) {
- HandleDeclRefExpr(DRE);
- return;
- }
- }
- Inherited::VisitImplicitCastExpr(E);
+ Inherited::VisitMemberExpr(E);
}
void VisitUnaryOperator(UnaryOperator *E) {
// For POD record types, addresses of its own members are well-defined.
- if (isRecordType && isPODType) return;
+ if (E->getOpcode() == UO_AddrOf && isRecordType && isPODType &&
+ isa<MemberExpr>(E->getSubExpr())) return;
Inherited::VisitUnaryOperator(E);
}
-
+
+ void VisitObjCMessageExpr(ObjCMessageExpr *E) { return; }
+
void HandleDeclRefExpr(DeclRefExpr *DRE) {
Decl* ReferenceDecl = DRE->getDecl();
if (OrigDecl != ReferenceDecl) return;
@@ -6148,7 +6198,7 @@
/// CheckSelfReference - Warns if OrigDecl is used in expression E.
void Sema::CheckSelfReference(Decl* OrigDecl, Expr *E) {
- SelfReferenceChecker(*this, OrigDecl).VisitExpr(E);
+ SelfReferenceChecker(*this, OrigDecl).HandleExpr(E);
}
/// AddInitializerToDecl - Adds the initializer Init to the
@@ -7175,9 +7225,10 @@
// Parameter declarators cannot be interface types. All ObjC objects are
// passed by reference.
if (T->isObjCObjectType()) {
+ SourceLocation TypeEndLoc = TSInfo->getTypeLoc().getLocEnd();
Diag(NameLoc,
diag::err_object_cannot_be_passed_returned_by_value) << 1 << T
- << FixItHint::CreateInsertion(NameLoc, "*");
+ << FixItHint::CreateInsertion(TypeEndLoc, "*");
T = Context.getObjCObjectPointerType(T);
New->setType(T);
}
@@ -8696,6 +8747,9 @@
InFunctionDeclarator && Name)
DeclsInPrototypeScope.push_back(New);
+ if (PrevDecl)
+ mergeDeclAttributes(New, PrevDecl);
+
OwnedDecl = true;
return New;
}
@@ -9486,7 +9540,11 @@
S->AddDecl(NewID);
IdResolver.AddDecl(NewID);
}
-
+
+ if (LangOpts.ObjCNonFragileABI2 &&
+ !NewID->isInvalidDecl() && isa<ObjCInterfaceDecl>(EnclosingDecl))
+ Diag(Loc, diag::warn_ivars_in_interface);
+
return NewID;
}
Modified: cfe/branches/tooling/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaDeclAttr.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaDeclAttr.cpp Tue May 15 13:51:08 2012
@@ -1294,6 +1294,46 @@
Str->getString()));
}
+static void handleColdAttr(Sema &S, Decl *D, const AttributeList &Attr) {
+ // Check the attribute arguments.
+ if (!checkAttributeNumArgs(S, Attr, 0))
+ return;
+
+ if (!isa<FunctionDecl>(D)) {
+ S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type)
+ << Attr.getName() << ExpectedFunction;
+ return;
+ }
+
+ if (D->hasAttr<HotAttr>()) {
+ S.Diag(Attr.getLoc(), diag::err_attributes_are_not_compatible)
+ << Attr.getName() << "hot";
+ return;
+ }
+
+ D->addAttr(::new (S.Context) ColdAttr(Attr.getRange(), S.Context));
+}
+
+static void handleHotAttr(Sema &S, Decl *D, const AttributeList &Attr) {
+ // Check the attribute arguments.
+ if (!checkAttributeNumArgs(S, Attr, 0))
+ return;
+
+ if (!isa<FunctionDecl>(D)) {
+ S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type)
+ << Attr.getName() << ExpectedFunction;
+ return;
+ }
+
+ if (D->hasAttr<ColdAttr>()) {
+ S.Diag(Attr.getLoc(), diag::err_attributes_are_not_compatible)
+ << Attr.getName() << "cold";
+ return;
+ }
+
+ D->addAttr(::new (S.Context) HotAttr(Attr.getRange(), S.Context));
+}
+
static void handleNakedAttr(Sema &S, Decl *D, const AttributeList &Attr) {
// Check the attribute arguments.
if (!checkAttributeNumArgs(S, Attr, 0))
@@ -1729,76 +1769,94 @@
return false;
}
-static void mergeAvailabilityAttr(Sema &S, Decl *D, SourceRange Range,
- IdentifierInfo *Platform,
- VersionTuple Introduced,
- VersionTuple Deprecated,
- VersionTuple Obsoleted,
- bool IsUnavailable,
- StringRef Message) {
- VersionTuple MergedIntroduced;
- VersionTuple MergedDeprecated;
- VersionTuple MergedObsoleted;
+AvailabilityAttr *Sema::mergeAvailabilityAttr(Decl *D, SourceRange Range,
+ IdentifierInfo *Platform,
+ VersionTuple Introduced,
+ VersionTuple Deprecated,
+ VersionTuple Obsoleted,
+ bool IsUnavailable,
+ StringRef Message) {
+ VersionTuple MergedIntroduced = Introduced;
+ VersionTuple MergedDeprecated = Deprecated;
+ VersionTuple MergedObsoleted = Obsoleted;
bool FoundAny = false;
- for (specific_attr_iterator<AvailabilityAttr>
- i = D->specific_attr_begin<AvailabilityAttr>(),
- e = D->specific_attr_end<AvailabilityAttr>();
- i != e ; ++i) {
- const AvailabilityAttr *OldAA = *i;
- IdentifierInfo *OldPlatform = OldAA->getPlatform();
- if (OldPlatform != Platform)
- continue;
- FoundAny = true;
- VersionTuple OldIntroduced = OldAA->getIntroduced();
- VersionTuple OldDeprecated = OldAA->getDeprecated();
- VersionTuple OldObsoleted = OldAA->getObsoleted();
- bool OldIsUnavailable = OldAA->getUnavailable();
- StringRef OldMessage = OldAA->getMessage();
-
- if ((!OldIntroduced.empty() && !Introduced.empty() &&
- OldIntroduced != Introduced) ||
- (!OldDeprecated.empty() && !Deprecated.empty() &&
- OldDeprecated != Deprecated) ||
- (!OldObsoleted.empty() && !Obsoleted.empty() &&
- OldObsoleted != Obsoleted) ||
- (OldIsUnavailable != IsUnavailable) ||
- (OldMessage != Message)) {
- S.Diag(Range.getBegin(), diag::warn_mismatched_availability);
- S.Diag(OldAA->getLocation(), diag::note_previous_attribute);
- return;
- }
- if (MergedIntroduced.empty())
- MergedIntroduced = OldIntroduced;
- if (MergedDeprecated.empty())
- MergedDeprecated = OldDeprecated;
- if (MergedObsoleted.empty())
- MergedObsoleted = OldObsoleted;
+ if (D->hasAttrs()) {
+ AttrVec &Attrs = D->getAttrs();
+ for (unsigned i = 0, e = Attrs.size(); i != e;) {
+ const AvailabilityAttr *OldAA = dyn_cast<AvailabilityAttr>(Attrs[i]);
+ if (!OldAA) {
+ ++i;
+ continue;
+ }
+
+ IdentifierInfo *OldPlatform = OldAA->getPlatform();
+ if (OldPlatform != Platform) {
+ ++i;
+ continue;
+ }
+
+ FoundAny = true;
+ VersionTuple OldIntroduced = OldAA->getIntroduced();
+ VersionTuple OldDeprecated = OldAA->getDeprecated();
+ VersionTuple OldObsoleted = OldAA->getObsoleted();
+ bool OldIsUnavailable = OldAA->getUnavailable();
+ StringRef OldMessage = OldAA->getMessage();
+
+ if ((!OldIntroduced.empty() && !Introduced.empty() &&
+ OldIntroduced != Introduced) ||
+ (!OldDeprecated.empty() && !Deprecated.empty() &&
+ OldDeprecated != Deprecated) ||
+ (!OldObsoleted.empty() && !Obsoleted.empty() &&
+ OldObsoleted != Obsoleted) ||
+ (OldIsUnavailable != IsUnavailable) ||
+ (OldMessage != Message)) {
+ Diag(OldAA->getLocation(), diag::warn_mismatched_availability);
+ Diag(Range.getBegin(), diag::note_previous_attribute);
+ Attrs.erase(Attrs.begin() + i);
+ --e;
+ continue;
+ }
+
+ VersionTuple MergedIntroduced2 = MergedIntroduced;
+ VersionTuple MergedDeprecated2 = MergedDeprecated;
+ VersionTuple MergedObsoleted2 = MergedObsoleted;
+
+ if (MergedIntroduced2.empty())
+ MergedIntroduced2 = OldIntroduced;
+ if (MergedDeprecated2.empty())
+ MergedDeprecated2 = OldDeprecated;
+ if (MergedObsoleted2.empty())
+ MergedObsoleted2 = OldObsoleted;
+
+ if (checkAvailabilityAttr(*this, OldAA->getRange(), Platform,
+ MergedIntroduced2, MergedDeprecated2,
+ MergedObsoleted2)) {
+ Attrs.erase(Attrs.begin() + i);
+ --e;
+ continue;
+ }
+
+ MergedIntroduced = MergedIntroduced2;
+ MergedDeprecated = MergedDeprecated2;
+ MergedObsoleted = MergedObsoleted2;
+ ++i;
+ }
}
if (FoundAny &&
MergedIntroduced == Introduced &&
MergedDeprecated == Deprecated &&
MergedObsoleted == Obsoleted)
- return;
+ return NULL;
- if (MergedIntroduced.empty())
- MergedIntroduced = Introduced;
- if (MergedDeprecated.empty())
- MergedDeprecated = Deprecated;
- if (MergedObsoleted.empty())
- MergedObsoleted = Obsoleted;
-
- if (!checkAvailabilityAttr(S, Range, Platform, MergedIntroduced,
+ if (!checkAvailabilityAttr(*this, Range, Platform, MergedIntroduced,
MergedDeprecated, MergedObsoleted)) {
- D->addAttr(::new (S.Context) AvailabilityAttr(Range, S.Context,
- Platform,
- Introduced,
- Deprecated,
- Obsoleted,
- IsUnavailable,
- Message));
+ return ::new (Context) AvailabilityAttr(Range, Context, Platform,
+ Introduced, Deprecated,
+ Obsoleted, IsUnavailable, Message);
}
+ return NULL;
}
static void handleAvailabilityAttr(Sema &S, Decl *D,
@@ -1820,13 +1878,32 @@
if (SE)
Str = SE->getString();
- mergeAvailabilityAttr(S, D, Attr.getRange(),
- Platform,
- Introduced.Version,
- Deprecated.Version,
- Obsoleted.Version,
- IsUnavailable,
- Str);
+ AvailabilityAttr *NewAttr = S.mergeAvailabilityAttr(D, Attr.getRange(),
+ Platform,
+ Introduced.Version,
+ Deprecated.Version,
+ Obsoleted.Version,
+ IsUnavailable, Str);
+ if (NewAttr)
+ D->addAttr(NewAttr);
+}
+
+VisibilityAttr *Sema::mergeVisibilityAttr(Decl *D, SourceRange Range,
+ VisibilityAttr::VisibilityType Vis) {
+ if (isa<TypedefNameDecl>(D)) {
+ Diag(Range.getBegin(), diag::warn_attribute_ignored) << "visibility";
+ return NULL;
+ }
+ VisibilityAttr *ExistingAttr = D->getAttr<VisibilityAttr>();
+ if (ExistingAttr) {
+ VisibilityAttr::VisibilityType ExistingVis = ExistingAttr->getVisibility();
+ if (ExistingVis == Vis)
+ return NULL;
+ Diag(ExistingAttr->getLocation(), diag::err_mismatched_visibility);
+ Diag(Range.getBegin(), diag::note_previous_attribute);
+ D->dropAttr<VisibilityAttr>();
+ }
+ return ::new (Context) VisibilityAttr(Range, Context, Vis);
}
static void handleVisibilityAttr(Sema &S, Decl *D, const AttributeList &Attr) {
@@ -1867,25 +1944,9 @@
return;
}
- // Find the last Decl that has an attribute.
- VisibilityAttr *PrevAttr = 0;
- assert(D->redecls_begin() == D);
- for (Decl::redecl_iterator I = D->redecls_begin(), E = D->redecls_end();
- I != E; ++I) {
- PrevAttr = I->getAttr<VisibilityAttr>() ;
- if (PrevAttr)
- break;
- }
-
- if (PrevAttr) {
- VisibilityAttr::VisibilityType PrevVisibility = PrevAttr->getVisibility();
- if (PrevVisibility != type) {
- S.Diag(Attr.getLoc(), diag::err_mismatched_visibility);
- S.Diag(PrevAttr->getLocation(), diag::note_previous_attribute);
- return;
- }
- }
- D->addAttr(::new (S.Context) VisibilityAttr(Attr.getRange(), S.Context, type));
+ VisibilityAttr *NewAttr = S.mergeVisibilityAttr(D, Attr.getRange(), type);
+ if (NewAttr)
+ D->addAttr(NewAttr);
}
static void handleObjCMethodFamilyAttr(Sema &S, Decl *decl,
@@ -2216,6 +2277,18 @@
WGSize[2]));
}
+SectionAttr *Sema::mergeSectionAttr(Decl *D, SourceRange Range,
+ StringRef Name) {
+ if (SectionAttr *ExistingAttr = D->getAttr<SectionAttr>()) {
+ if (ExistingAttr->getName() == Name)
+ return NULL;
+ Diag(ExistingAttr->getLocation(), diag::warn_mismatched_section);
+ Diag(Range.getBegin(), diag::note_previous_attribute);
+ return NULL;
+ }
+ return ::new (Context) SectionAttr(Range, Context, Name);
+}
+
static void handleSectionAttr(Sema &S, Decl *D, const AttributeList &Attr) {
// Attribute has no arguments.
if (!checkAttributeNumArgs(S, Attr, 1))
@@ -2243,9 +2316,10 @@
S.Diag(SE->getLocStart(), diag::err_attribute_section_local_variable);
return;
}
-
- D->addAttr(::new (S.Context) SectionAttr(Attr.getRange(), S.Context,
- SE->getString()));
+ SectionAttr *NewAttr = S.mergeSectionAttr(D, Attr.getRange(),
+ SE->getString());
+ if (NewAttr)
+ D->addAttr(NewAttr);
}
@@ -2505,6 +2579,29 @@
prioritynum));
}
+FormatAttr *Sema::mergeFormatAttr(Decl *D, SourceRange Range, StringRef Format,
+ int FormatIdx, int FirstArg) {
+ // Check whether we already have an equivalent format attribute.
+ for (specific_attr_iterator<FormatAttr>
+ i = D->specific_attr_begin<FormatAttr>(),
+ e = D->specific_attr_end<FormatAttr>();
+ i != e ; ++i) {
+ FormatAttr *f = *i;
+ if (f->getType() == Format &&
+ f->getFormatIdx() == FormatIdx &&
+ f->getFirstArg() == FirstArg) {
+ // If we don't have a valid location for this attribute, adopt the
+ // location.
+ if (f->getLocation().isInvalid())
+ f->setRange(Range);
+ return NULL;
+ }
+ }
+
+ return ::new (Context) FormatAttr(Range, Context, Format, FormatIdx,
+ FirstArg);
+}
+
/// Handle __attribute__((format(type,idx,firstarg))) attributes based on
/// http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
static void handleFormatAttr(Sema &S, Decl *D, const AttributeList &Attr) {
@@ -2640,26 +2737,11 @@
return;
}
- // Check whether we already have an equivalent format attribute.
- for (specific_attr_iterator<FormatAttr>
- i = D->specific_attr_begin<FormatAttr>(),
- e = D->specific_attr_end<FormatAttr>();
- i != e ; ++i) {
- FormatAttr *f = *i;
- if (f->getType() == Format &&
- f->getFormatIdx() == (int)Idx.getZExtValue() &&
- f->getFirstArg() == (int)FirstArg.getZExtValue()) {
- // If we don't have a valid location for this attribute, adopt the
- // location.
- if (f->getLocation().isInvalid())
- f->setRange(Attr.getRange());
- return;
- }
- }
-
- D->addAttr(::new (S.Context) FormatAttr(Attr.getRange(), S.Context, Format,
+ FormatAttr *NewAttr = S.mergeFormatAttr(D, Attr.getRange(), Format,
Idx.getZExtValue(),
- FirstArg.getZExtValue()));
+ FirstArg.getZExtValue());
+ if (NewAttr)
+ D->addAttr(NewAttr);
}
static void handleTransparentUnionAttr(Sema &S, Decl *D,
@@ -3788,6 +3870,8 @@
case AttributeList::AT_ownership_takes:
case AttributeList::AT_ownership_holds:
handleOwnershipAttr (S, D, Attr); break;
+ case AttributeList::AT_cold: handleColdAttr (S, D, Attr); break;
+ case AttributeList::AT_hot: handleHotAttr (S, D, Attr); break;
case AttributeList::AT_naked: handleNakedAttr (S, D, Attr); break;
case AttributeList::AT_noreturn: handleNoReturnAttr (S, D, Attr); break;
case AttributeList::AT_nothrow: handleNothrowAttr (S, D, Attr); break;
@@ -3986,12 +4070,8 @@
void Sema::ProcessDeclAttributeList(Scope *S, Decl *D,
const AttributeList *AttrList,
bool NonInheritable, bool Inheritable) {
- SmallVector<const AttributeList*, 4> attrs;
for (const AttributeList* l = AttrList; l; l = l->getNext()) {
- attrs.push_back(l);
- }
- for (int i = attrs.size() - 1; i >= 0; --i) {
- ProcessDeclAttribute(*this, S, D, *attrs[i], NonInheritable, Inheritable);
+ ProcessDeclAttribute(*this, S, D, *l, NonInheritable, Inheritable);
}
// GCC accepts
Modified: cfe/branches/tooling/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaDeclCXX.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaDeclCXX.cpp Tue May 15 13:51:08 2012
@@ -3801,550 +3801,204 @@
void Sema::CheckExplicitlyDefaultedMethods(CXXRecordDecl *Record) {
for (CXXRecordDecl::method_iterator MI = Record->method_begin(),
ME = Record->method_end();
- MI != ME; ++MI) {
- if (!MI->isInvalidDecl() && MI->isExplicitlyDefaulted()) {
- switch (getSpecialMember(&*MI)) {
- case CXXDefaultConstructor:
- CheckExplicitlyDefaultedDefaultConstructor(
- cast<CXXConstructorDecl>(&*MI));
- break;
-
- case CXXDestructor:
- CheckExplicitlyDefaultedDestructor(cast<CXXDestructorDecl>(&*MI));
- break;
-
- case CXXCopyConstructor:
- CheckExplicitlyDefaultedCopyConstructor(cast<CXXConstructorDecl>(&*MI));
- break;
-
- case CXXCopyAssignment:
- CheckExplicitlyDefaultedCopyAssignment(&*MI);
- break;
-
- case CXXMoveConstructor:
- CheckExplicitlyDefaultedMoveConstructor(cast<CXXConstructorDecl>(&*MI));
- break;
-
- case CXXMoveAssignment:
- CheckExplicitlyDefaultedMoveAssignment(&*MI);
- break;
-
- case CXXInvalid:
- llvm_unreachable("non-special member explicitly defaulted!");
- }
- }
- }
-
+ MI != ME; ++MI)
+ if (!MI->isInvalidDecl() && MI->isExplicitlyDefaulted())
+ CheckExplicitlyDefaultedSpecialMember(&*MI);
}
-void Sema::CheckExplicitlyDefaultedDefaultConstructor(CXXConstructorDecl *CD) {
- assert(CD->isExplicitlyDefaulted() && CD->isDefaultConstructor());
-
- // Whether this was the first-declared instance of the constructor.
- // This affects whether we implicitly add an exception spec (and, eventually,
- // constexpr). It is also ill-formed to explicitly default a constructor such
- // that it would be deleted. (C++0x [decl.fct.def.default])
- bool First = CD == CD->getCanonicalDecl();
-
- bool HadError = false;
- if (CD->getNumParams() != 0) {
- Diag(CD->getLocation(), diag::err_defaulted_default_ctor_params)
- << CD->getSourceRange();
- HadError = true;
- }
-
- ImplicitExceptionSpecification Spec
- = ComputeDefaultedDefaultCtorExceptionSpec(CD->getParent());
- FunctionProtoType::ExtProtoInfo EPI = Spec.getEPI();
- if (EPI.ExceptionSpecType == EST_Delayed) {
- // Exception specification depends on some deferred part of the class. We'll
- // try again when the class's definition has been fully processed.
- return;
- }
- const FunctionProtoType *CtorType = CD->getType()->getAs<FunctionProtoType>(),
- *ExceptionType = Context.getFunctionType(
- Context.VoidTy, 0, 0, EPI)->getAs<FunctionProtoType>();
-
- // C++11 [dcl.fct.def.default]p2:
- // An explicitly-defaulted function may be declared constexpr only if it
- // would have been implicitly declared as constexpr,
- // Do not apply this rule to templates, since core issue 1358 makes such
- // functions always instantiate to constexpr functions.
- if (CD->isConstexpr() &&
- CD->getTemplatedKind() == FunctionDecl::TK_NonTemplate) {
- if (!CD->getParent()->defaultedDefaultConstructorIsConstexpr()) {
- Diag(CD->getLocStart(), diag::err_incorrect_defaulted_constexpr)
- << CXXDefaultConstructor;
- HadError = true;
- }
- }
- // and may have an explicit exception-specification only if it is compatible
- // with the exception-specification on the implicit declaration.
- if (CtorType->hasExceptionSpec()) {
- if (CheckEquivalentExceptionSpec(
- PDiag(diag::err_incorrect_defaulted_exception_spec)
- << CXXDefaultConstructor,
- PDiag(),
- ExceptionType, SourceLocation(),
- CtorType, CD->getLocation())) {
- HadError = true;
- }
- }
-
- // If a function is explicitly defaulted on its first declaration,
- if (First) {
- // -- it is implicitly considered to be constexpr if the implicit
- // definition would be,
- CD->setConstexpr(CD->getParent()->defaultedDefaultConstructorIsConstexpr());
-
- // -- it is implicitly considered to have the same
- // exception-specification as if it had been implicitly declared
- //
- // FIXME: a compatible, but different, explicit exception specification
- // will be silently overridden. We should issue a warning if this happens.
- EPI.ExtInfo = CtorType->getExtInfo();
-
- // Such a function is also trivial if the implicitly-declared function
- // would have been.
- CD->setTrivial(CD->getParent()->hasTrivialDefaultConstructor());
- }
-
- if (HadError) {
- CD->setInvalidDecl();
- return;
- }
-
- if (ShouldDeleteSpecialMember(CD, CXXDefaultConstructor)) {
- if (First) {
- CD->setDeletedAsWritten();
- } else {
- Diag(CD->getLocation(), diag::err_out_of_line_default_deletes)
- << CXXDefaultConstructor;
- CD->setInvalidDecl();
- }
- }
-}
+void Sema::CheckExplicitlyDefaultedSpecialMember(CXXMethodDecl *MD) {
+ CXXRecordDecl *RD = MD->getParent();
+ CXXSpecialMember CSM = getSpecialMember(MD);
-void Sema::CheckExplicitlyDefaultedCopyConstructor(CXXConstructorDecl *CD) {
- assert(CD->isExplicitlyDefaulted() && CD->isCopyConstructor());
+ assert(MD->isExplicitlyDefaulted() && CSM != CXXInvalid &&
+ "not an explicitly-defaulted special member");
// Whether this was the first-declared instance of the constructor.
- bool First = CD == CD->getCanonicalDecl();
-
- bool HadError = false;
- if (CD->getNumParams() != 1) {
- Diag(CD->getLocation(), diag::err_defaulted_copy_ctor_params)
- << CD->getSourceRange();
- HadError = true;
- }
-
- ImplicitExceptionSpecification Spec(*this);
- bool Const;
- llvm::tie(Spec, Const) =
- ComputeDefaultedCopyCtorExceptionSpecAndConst(CD->getParent());
-
- FunctionProtoType::ExtProtoInfo EPI = Spec.getEPI();
- const FunctionProtoType *CtorType = CD->getType()->getAs<FunctionProtoType>(),
- *ExceptionType = Context.getFunctionType(
- Context.VoidTy, 0, 0, EPI)->getAs<FunctionProtoType>();
-
- // Check for parameter type matching.
- // This is a copy ctor so we know it's a cv-qualified reference to T.
- QualType ArgType = CtorType->getArgType(0);
- if (ArgType->getPointeeType().isVolatileQualified()) {
- Diag(CD->getLocation(), diag::err_defaulted_copy_ctor_volatile_param);
- HadError = true;
- }
- if (ArgType->getPointeeType().isConstQualified() && !Const) {
- Diag(CD->getLocation(), diag::err_defaulted_copy_ctor_const_param);
- HadError = true;
- }
-
- // C++11 [dcl.fct.def.default]p2:
- // An explicitly-defaulted function may be declared constexpr only if it
- // would have been implicitly declared as constexpr,
- // Do not apply this rule to templates, since core issue 1358 makes such
- // functions always instantiate to constexpr functions.
- if (CD->isConstexpr() &&
- CD->getTemplatedKind() == FunctionDecl::TK_NonTemplate) {
- if (!CD->getParent()->defaultedCopyConstructorIsConstexpr()) {
- Diag(CD->getLocStart(), diag::err_incorrect_defaulted_constexpr)
- << CXXCopyConstructor;
- HadError = true;
- }
- }
- // and may have an explicit exception-specification only if it is compatible
- // with the exception-specification on the implicit declaration.
- if (CtorType->hasExceptionSpec()) {
- if (CheckEquivalentExceptionSpec(
- PDiag(diag::err_incorrect_defaulted_exception_spec)
- << CXXCopyConstructor,
- PDiag(),
- ExceptionType, SourceLocation(),
- CtorType, CD->getLocation())) {
- HadError = true;
- }
- }
-
- // If a function is explicitly defaulted on its first declaration,
- if (First) {
- // -- it is implicitly considered to be constexpr if the implicit
- // definition would be,
- CD->setConstexpr(CD->getParent()->defaultedCopyConstructorIsConstexpr());
-
- // -- it is implicitly considered to have the same
- // exception-specification as if it had been implicitly declared, and
- //
- // FIXME: a compatible, but different, explicit exception specification
- // will be silently overridden. We should issue a warning if this happens.
- EPI.ExtInfo = CtorType->getExtInfo();
-
- // -- [...] it shall have the same parameter type as if it had been
- // implicitly declared.
- CD->setType(Context.getFunctionType(Context.VoidTy, &ArgType, 1, EPI));
-
- // Such a function is also trivial if the implicitly-declared function
- // would have been.
- CD->setTrivial(CD->getParent()->hasTrivialCopyConstructor());
- }
-
- if (HadError) {
- CD->setInvalidDecl();
- return;
- }
-
- if (ShouldDeleteSpecialMember(CD, CXXCopyConstructor)) {
- if (First) {
- CD->setDeletedAsWritten();
- } else {
- Diag(CD->getLocation(), diag::err_out_of_line_default_deletes)
- << CXXCopyConstructor;
- CD->setInvalidDecl();
- }
- }
-}
-
-void Sema::CheckExplicitlyDefaultedCopyAssignment(CXXMethodDecl *MD) {
- assert(MD->isExplicitlyDefaulted());
-
- // Whether this was the first-declared instance of the operator
+ // This affects whether we implicitly add an exception spec and constexpr.
bool First = MD == MD->getCanonicalDecl();
bool HadError = false;
- if (MD->getNumParams() != 1) {
- Diag(MD->getLocation(), diag::err_defaulted_copy_assign_params)
- << MD->getSourceRange();
- HadError = true;
- }
- QualType ReturnType =
- MD->getType()->getAs<FunctionType>()->getResultType();
- if (!ReturnType->isLValueReferenceType() ||
- !Context.hasSameType(
- Context.getCanonicalType(ReturnType->getPointeeType()),
- Context.getCanonicalType(Context.getTypeDeclType(MD->getParent())))) {
- Diag(MD->getLocation(), diag::err_defaulted_copy_assign_return_type);
+ // C++11 [dcl.fct.def.default]p1:
+ // A function that is explicitly defaulted shall
+ // -- be a special member function (checked elsewhere),
+ // -- have the same type (except for ref-qualifiers, and except that a
+ // copy operation can take a non-const reference) as an implicit
+ // declaration, and
+ // -- not have default arguments.
+ unsigned ExpectedParams = 1;
+ if (CSM == CXXDefaultConstructor || CSM == CXXDestructor)
+ ExpectedParams = 0;
+ if (MD->getNumParams() != ExpectedParams) {
+ // This also checks for default arguments: a copy or move constructor with a
+ // default argument is classified as a default constructor, and assignment
+ // operations and destructors can't have default arguments.
+ Diag(MD->getLocation(), diag::err_defaulted_special_member_params)
+ << CSM << MD->getSourceRange();
HadError = true;
}
+ const FunctionProtoType *Type = MD->getType()->getAs<FunctionProtoType>();
+
+ // Compute implicit exception specification, argument constness, constexpr
+ // and triviality.
ImplicitExceptionSpecification Spec(*this);
- bool Const;
- llvm::tie(Spec, Const) =
- ComputeDefaultedCopyCtorExceptionSpecAndConst(MD->getParent());
-
- FunctionProtoType::ExtProtoInfo EPI = Spec.getEPI();
- const FunctionProtoType *OperType = MD->getType()->getAs<FunctionProtoType>(),
- *ExceptionType = Context.getFunctionType(
- Context.VoidTy, 0, 0, EPI)->getAs<FunctionProtoType>();
+ bool Const = false;
+ bool Constexpr = false;
+ bool Trivial;
+ switch (CSM) {
+ case CXXDefaultConstructor:
+ Spec = ComputeDefaultedDefaultCtorExceptionSpec(RD);
+ if (Spec.isDelayed())
+ // Exception specification depends on some deferred part of the class.
+ // We'll try again when the class's definition has been fully processed.
+ return;
+ Constexpr = RD->defaultedDefaultConstructorIsConstexpr();
+ Trivial = RD->hasTrivialDefaultConstructor();
+ break;
+ case CXXCopyConstructor:
+ llvm::tie(Spec, Const) =
+ ComputeDefaultedCopyCtorExceptionSpecAndConst(RD);
+ Constexpr = RD->defaultedCopyConstructorIsConstexpr();
+ Trivial = RD->hasTrivialCopyConstructor();
+ break;
+ case CXXCopyAssignment:
+ llvm::tie(Spec, Const) =
+ ComputeDefaultedCopyAssignmentExceptionSpecAndConst(RD);
+ Trivial = RD->hasTrivialCopyAssignment();
+ break;
+ case CXXMoveConstructor:
+ Spec = ComputeDefaultedMoveCtorExceptionSpec(RD);
+ Constexpr = RD->defaultedMoveConstructorIsConstexpr();
+ Trivial = RD->hasTrivialMoveConstructor();
+ break;
+ case CXXMoveAssignment:
+ Spec = ComputeDefaultedMoveAssignmentExceptionSpec(RD);
+ Trivial = RD->hasTrivialMoveAssignment();
+ break;
+ case CXXDestructor:
+ Spec = ComputeDefaultedDtorExceptionSpec(RD);
+ Trivial = RD->hasTrivialDestructor();
+ break;
+ case CXXInvalid:
+ llvm_unreachable("non-special member explicitly defaulted!");
+ }
- QualType ArgType = OperType->getArgType(0);
- if (!ArgType->isLValueReferenceType()) {
- Diag(MD->getLocation(), diag::err_defaulted_copy_assign_not_ref);
- HadError = true;
- } else {
- if (ArgType->getPointeeType().isVolatileQualified()) {
- Diag(MD->getLocation(), diag::err_defaulted_copy_assign_volatile_param);
+ QualType ReturnType = Context.VoidTy;
+ if (CSM == CXXCopyAssignment || CSM == CXXMoveAssignment) {
+ // Check for return type matching.
+ ReturnType = Type->getResultType();
+ QualType ExpectedReturnType =
+ Context.getLValueReferenceType(Context.getTypeDeclType(RD));
+ if (!Context.hasSameType(ReturnType, ExpectedReturnType)) {
+ Diag(MD->getLocation(), diag::err_defaulted_special_member_return_type)
+ << (CSM == CXXMoveAssignment) << ExpectedReturnType;
HadError = true;
}
- if (ArgType->getPointeeType().isConstQualified() && !Const) {
- Diag(MD->getLocation(), diag::err_defaulted_copy_assign_const_param);
+
+ // A defaulted special member cannot have cv-qualifiers.
+ if (Type->getTypeQuals()) {
+ Diag(MD->getLocation(), diag::err_defaulted_special_member_quals)
+ << (CSM == CXXMoveAssignment);
HadError = true;
}
}
- if (OperType->getTypeQuals()) {
- Diag(MD->getLocation(), diag::err_defaulted_copy_assign_quals);
- HadError = true;
- }
-
- if (OperType->hasExceptionSpec()) {
- if (CheckEquivalentExceptionSpec(
- PDiag(diag::err_incorrect_defaulted_exception_spec)
- << CXXCopyAssignment,
- PDiag(),
- ExceptionType, SourceLocation(),
- OperType, MD->getLocation())) {
+ // Check for parameter type matching.
+ QualType ArgType = ExpectedParams ? Type->getArgType(0) : QualType();
+ if (ExpectedParams && ArgType->isReferenceType()) {
+ // Argument must be reference to possibly-const T.
+ QualType ReferentType = ArgType->getPointeeType();
+
+ if (ReferentType.isVolatileQualified()) {
+ Diag(MD->getLocation(),
+ diag::err_defaulted_special_member_volatile_param) << CSM;
HadError = true;
}
- }
- if (First) {
- // We set the declaration to have the computed exception spec here.
- // We duplicate the one parameter type.
- EPI.RefQualifier = OperType->getRefQualifier();
- EPI.ExtInfo = OperType->getExtInfo();
- MD->setType(Context.getFunctionType(ReturnType, &ArgType, 1, EPI));
-
- // Such a function is also trivial if the implicitly-declared function
- // would have been.
- MD->setTrivial(MD->getParent()->hasTrivialCopyAssignment());
- }
- if (HadError) {
- MD->setInvalidDecl();
- return;
- }
-
- if (ShouldDeleteSpecialMember(MD, CXXCopyAssignment)) {
- if (First) {
- MD->setDeletedAsWritten();
- } else {
- Diag(MD->getLocation(), diag::err_out_of_line_default_deletes)
- << CXXCopyAssignment;
- MD->setInvalidDecl();
+ if (ReferentType.isConstQualified() && !Const) {
+ if (CSM == CXXCopyConstructor || CSM == CXXCopyAssignment) {
+ Diag(MD->getLocation(),
+ diag::err_defaulted_special_member_copy_const_param)
+ << (CSM == CXXCopyAssignment);
+ // FIXME: Explain why this special member can't be const.
+ } else {
+ Diag(MD->getLocation(),
+ diag::err_defaulted_special_member_move_const_param)
+ << (CSM == CXXMoveAssignment);
+ }
+ HadError = true;
}
- }
-}
-
-void Sema::CheckExplicitlyDefaultedMoveConstructor(CXXConstructorDecl *CD) {
- assert(CD->isExplicitlyDefaulted() && CD->isMoveConstructor());
-
- // Whether this was the first-declared instance of the constructor.
- bool First = CD == CD->getCanonicalDecl();
- bool HadError = false;
- if (CD->getNumParams() != 1) {
- Diag(CD->getLocation(), diag::err_defaulted_move_ctor_params)
- << CD->getSourceRange();
+ // If a function is explicitly defaulted on its first declaration, it shall
+ // have the same parameter type as if it had been implicitly declared.
+ // (Presumably this is to prevent it from being trivial?)
+ if (!ReferentType.isConstQualified() && Const && First)
+ Diag(MD->getLocation(),
+ diag::err_defaulted_special_member_copy_non_const_param)
+ << (CSM == CXXCopyAssignment);
+ } else if (ExpectedParams) {
+ // A copy assignment operator can take its argument by value, but a
+ // defaulted one cannot.
+ assert(CSM == CXXCopyAssignment && "unexpected non-ref argument");
+ Diag(MD->getLocation(), diag::err_defaulted_copy_assign_not_ref);
HadError = true;
}
- ImplicitExceptionSpecification Spec(
- ComputeDefaultedMoveCtorExceptionSpec(CD->getParent()));
-
- FunctionProtoType::ExtProtoInfo EPI = Spec.getEPI();
- const FunctionProtoType *CtorType = CD->getType()->getAs<FunctionProtoType>(),
- *ExceptionType = Context.getFunctionType(
- Context.VoidTy, 0, 0, EPI)->getAs<FunctionProtoType>();
-
- // Check for parameter type matching.
- // This is a move ctor so we know it's a cv-qualified rvalue reference to T.
- QualType ArgType = CtorType->getArgType(0);
- if (ArgType->getPointeeType().isVolatileQualified()) {
- Diag(CD->getLocation(), diag::err_defaulted_move_ctor_volatile_param);
- HadError = true;
- }
- if (ArgType->getPointeeType().isConstQualified()) {
- Diag(CD->getLocation(), diag::err_defaulted_move_ctor_const_param);
- HadError = true;
- }
+ // Rebuild the type with the implicit exception specification added.
+ FunctionProtoType::ExtProtoInfo EPI = Type->getExtProtoInfo();
+ Spec.getEPI(EPI);
+ const FunctionProtoType *ImplicitType = cast<FunctionProtoType>(
+ Context.getFunctionType(ReturnType, &ArgType, ExpectedParams, EPI));
// C++11 [dcl.fct.def.default]p2:
// An explicitly-defaulted function may be declared constexpr only if it
// would have been implicitly declared as constexpr,
- // Do not apply this rule to templates, since core issue 1358 makes such
- // functions always instantiate to constexpr functions.
- if (CD->isConstexpr() &&
- CD->getTemplatedKind() == FunctionDecl::TK_NonTemplate) {
- if (!CD->getParent()->defaultedMoveConstructorIsConstexpr()) {
- Diag(CD->getLocStart(), diag::err_incorrect_defaulted_constexpr)
- << CXXMoveConstructor;
- HadError = true;
- }
+ // Do not apply this rule to members of class templates, since core issue 1358
+ // makes such functions always instantiate to constexpr functions. For
+ // non-constructors, this is checked elsewhere.
+ if (isa<CXXConstructorDecl>(MD) && MD->isConstexpr() && !Constexpr &&
+ MD->getTemplatedKind() == FunctionDecl::TK_NonTemplate) {
+ Diag(MD->getLocStart(), diag::err_incorrect_defaulted_constexpr) << CSM;
+ HadError = true;
}
// and may have an explicit exception-specification only if it is compatible
// with the exception-specification on the implicit declaration.
- if (CtorType->hasExceptionSpec()) {
- if (CheckEquivalentExceptionSpec(
- PDiag(diag::err_incorrect_defaulted_exception_spec)
- << CXXMoveConstructor,
- PDiag(),
- ExceptionType, SourceLocation(),
- CtorType, CD->getLocation())) {
- HadError = true;
- }
- }
+ if (Type->hasExceptionSpec() &&
+ CheckEquivalentExceptionSpec(
+ PDiag(diag::err_incorrect_defaulted_exception_spec) << CSM,
+ PDiag(), ImplicitType, SourceLocation(), Type, MD->getLocation()))
+ HadError = true;
// If a function is explicitly defaulted on its first declaration,
if (First) {
// -- it is implicitly considered to be constexpr if the implicit
// definition would be,
- CD->setConstexpr(CD->getParent()->defaultedMoveConstructorIsConstexpr());
+ MD->setConstexpr(Constexpr);
- // -- it is implicitly considered to have the same
- // exception-specification as if it had been implicitly declared, and
- //
- // FIXME: a compatible, but different, explicit exception specification
- // will be silently overridden. We should issue a warning if this happens.
- EPI.ExtInfo = CtorType->getExtInfo();
-
- // -- [...] it shall have the same parameter type as if it had been
- // implicitly declared.
- CD->setType(Context.getFunctionType(Context.VoidTy, &ArgType, 1, EPI));
+ // -- it is implicitly considered to have the same exception-specification
+ // as if it had been implicitly declared,
+ MD->setType(QualType(ImplicitType, 0));
// Such a function is also trivial if the implicitly-declared function
// would have been.
- CD->setTrivial(CD->getParent()->hasTrivialMoveConstructor());
- }
-
- if (HadError) {
- CD->setInvalidDecl();
- return;
+ MD->setTrivial(Trivial);
}
- if (ShouldDeleteSpecialMember(CD, CXXMoveConstructor)) {
+ if (ShouldDeleteSpecialMember(MD, CSM)) {
if (First) {
- CD->setDeletedAsWritten();
+ MD->setDeletedAsWritten();
} else {
- Diag(CD->getLocation(), diag::err_out_of_line_default_deletes)
- << CXXMoveConstructor;
- CD->setInvalidDecl();
- }
- }
-}
-
-void Sema::CheckExplicitlyDefaultedMoveAssignment(CXXMethodDecl *MD) {
- assert(MD->isExplicitlyDefaulted());
-
- // Whether this was the first-declared instance of the operator
- bool First = MD == MD->getCanonicalDecl();
-
- bool HadError = false;
- if (MD->getNumParams() != 1) {
- Diag(MD->getLocation(), diag::err_defaulted_move_assign_params)
- << MD->getSourceRange();
- HadError = true;
- }
-
- QualType ReturnType =
- MD->getType()->getAs<FunctionType>()->getResultType();
- if (!ReturnType->isLValueReferenceType() ||
- !Context.hasSameType(
- Context.getCanonicalType(ReturnType->getPointeeType()),
- Context.getCanonicalType(Context.getTypeDeclType(MD->getParent())))) {
- Diag(MD->getLocation(), diag::err_defaulted_move_assign_return_type);
- HadError = true;
- }
-
- ImplicitExceptionSpecification Spec(
- ComputeDefaultedMoveCtorExceptionSpec(MD->getParent()));
-
- FunctionProtoType::ExtProtoInfo EPI = Spec.getEPI();
- const FunctionProtoType *OperType = MD->getType()->getAs<FunctionProtoType>(),
- *ExceptionType = Context.getFunctionType(
- Context.VoidTy, 0, 0, EPI)->getAs<FunctionProtoType>();
-
- QualType ArgType = OperType->getArgType(0);
- if (!ArgType->isRValueReferenceType()) {
- Diag(MD->getLocation(), diag::err_defaulted_move_assign_not_ref);
- HadError = true;
- } else {
- if (ArgType->getPointeeType().isVolatileQualified()) {
- Diag(MD->getLocation(), diag::err_defaulted_move_assign_volatile_param);
- HadError = true;
- }
- if (ArgType->getPointeeType().isConstQualified()) {
- Diag(MD->getLocation(), diag::err_defaulted_move_assign_const_param);
+ // C++11 [dcl.fct.def.default]p4:
+ // [For a] user-provided explicitly-defaulted function [...] if such a
+ // function is implicitly defined as deleted, the program is ill-formed.
+ Diag(MD->getLocation(), diag::err_out_of_line_default_deletes) << CSM;
HadError = true;
}
}
- if (OperType->getTypeQuals()) {
- Diag(MD->getLocation(), diag::err_defaulted_move_assign_quals);
- HadError = true;
- }
-
- if (OperType->hasExceptionSpec()) {
- if (CheckEquivalentExceptionSpec(
- PDiag(diag::err_incorrect_defaulted_exception_spec)
- << CXXMoveAssignment,
- PDiag(),
- ExceptionType, SourceLocation(),
- OperType, MD->getLocation())) {
- HadError = true;
- }
- }
- if (First) {
- // We set the declaration to have the computed exception spec here.
- // We duplicate the one parameter type.
- EPI.RefQualifier = OperType->getRefQualifier();
- EPI.ExtInfo = OperType->getExtInfo();
- MD->setType(Context.getFunctionType(ReturnType, &ArgType, 1, EPI));
-
- // Such a function is also trivial if the implicitly-declared function
- // would have been.
- MD->setTrivial(MD->getParent()->hasTrivialMoveAssignment());
- }
-
- if (HadError) {
+ if (HadError)
MD->setInvalidDecl();
- return;
- }
-
- if (ShouldDeleteSpecialMember(MD, CXXMoveAssignment)) {
- if (First) {
- MD->setDeletedAsWritten();
- } else {
- Diag(MD->getLocation(), diag::err_out_of_line_default_deletes)
- << CXXMoveAssignment;
- MD->setInvalidDecl();
- }
- }
-}
-
-void Sema::CheckExplicitlyDefaultedDestructor(CXXDestructorDecl *DD) {
- assert(DD->isExplicitlyDefaulted());
-
- // Whether this was the first-declared instance of the destructor.
- bool First = DD == DD->getCanonicalDecl();
-
- ImplicitExceptionSpecification Spec
- = ComputeDefaultedDtorExceptionSpec(DD->getParent());
- FunctionProtoType::ExtProtoInfo EPI = Spec.getEPI();
- const FunctionProtoType *DtorType = DD->getType()->getAs<FunctionProtoType>(),
- *ExceptionType = Context.getFunctionType(
- Context.VoidTy, 0, 0, EPI)->getAs<FunctionProtoType>();
-
- if (DtorType->hasExceptionSpec()) {
- if (CheckEquivalentExceptionSpec(
- PDiag(diag::err_incorrect_defaulted_exception_spec)
- << CXXDestructor,
- PDiag(),
- ExceptionType, SourceLocation(),
- DtorType, DD->getLocation())) {
- DD->setInvalidDecl();
- return;
- }
- }
- if (First) {
- // We set the declaration to have the computed exception spec here.
- // There are no parameters.
- EPI.ExtInfo = DtorType->getExtInfo();
- DD->setType(Context.getFunctionType(Context.VoidTy, 0, 0, EPI));
-
- // Such a function is also trivial if the implicitly-declared function
- // would have been.
- DD->setTrivial(DD->getParent()->hasTrivialDestructor());
- }
-
- if (ShouldDeleteSpecialMember(DD, CXXDestructor)) {
- if (First) {
- DD->setDeletedAsWritten();
- } else {
- Diag(DD->getLocation(), diag::err_out_of_line_default_deletes)
- << CXXDestructor;
- DD->setInvalidDecl();
- }
- }
}
namespace {
@@ -7021,7 +6675,7 @@
// specification is deferred until now.
if (!CtorDecl->isInvalidDecl() && CtorDecl->isExplicitlyDefaulted() &&
!ClassDecl->isDependentType())
- CheckExplicitlyDefaultedDefaultConstructor(CtorDecl);
+ CheckExplicitlyDefaultedSpecialMember(CtorDecl);
}
void Sema::DeclareInheritedConstructors(CXXRecordDecl *ClassDecl) {
@@ -7600,7 +7254,7 @@
Sema::ComputeDefaultedCopyAssignmentExceptionSpecAndConst(
CXXRecordDecl *ClassDecl) {
if (ClassDecl->isInvalidDecl())
- return std::make_pair(ImplicitExceptionSpecification(*this), false);
+ return std::make_pair(ImplicitExceptionSpecification(*this), true);
// C++ [class.copy]p10:
// If the class definition does not explicitly declare a copy
@@ -8635,7 +8289,7 @@
std::pair<Sema::ImplicitExceptionSpecification, bool>
Sema::ComputeDefaultedCopyCtorExceptionSpecAndConst(CXXRecordDecl *ClassDecl) {
if (ClassDecl->isInvalidDecl())
- return std::make_pair(ImplicitExceptionSpecification(*this), false);
+ return std::make_pair(ImplicitExceptionSpecification(*this), true);
// C++ [class.copy]p5:
// The implicitly-declared copy constructor for a class X will
@@ -10546,7 +10200,7 @@
switch (Member) {
case CXXDefaultConstructor: {
CXXConstructorDecl *CD = cast<CXXConstructorDecl>(MD);
- CheckExplicitlyDefaultedDefaultConstructor(CD);
+ CheckExplicitlyDefaultedSpecialMember(CD);
if (!CD->isInvalidDecl())
DefineImplicitDefaultConstructor(DefaultLoc, CD);
break;
@@ -10554,14 +10208,14 @@
case CXXCopyConstructor: {
CXXConstructorDecl *CD = cast<CXXConstructorDecl>(MD);
- CheckExplicitlyDefaultedCopyConstructor(CD);
+ CheckExplicitlyDefaultedSpecialMember(CD);
if (!CD->isInvalidDecl())
DefineImplicitCopyConstructor(DefaultLoc, CD);
break;
}
case CXXCopyAssignment: {
- CheckExplicitlyDefaultedCopyAssignment(MD);
+ CheckExplicitlyDefaultedSpecialMember(MD);
if (!MD->isInvalidDecl())
DefineImplicitCopyAssignment(DefaultLoc, MD);
break;
@@ -10569,7 +10223,7 @@
case CXXDestructor: {
CXXDestructorDecl *DD = cast<CXXDestructorDecl>(MD);
- CheckExplicitlyDefaultedDestructor(DD);
+ CheckExplicitlyDefaultedSpecialMember(DD);
if (!DD->isInvalidDecl())
DefineImplicitDestructor(DefaultLoc, DD);
break;
@@ -10577,14 +10231,14 @@
case CXXMoveConstructor: {
CXXConstructorDecl *CD = cast<CXXConstructorDecl>(MD);
- CheckExplicitlyDefaultedMoveConstructor(CD);
+ CheckExplicitlyDefaultedSpecialMember(CD);
if (!CD->isInvalidDecl())
DefineImplicitMoveConstructor(DefaultLoc, CD);
break;
}
case CXXMoveAssignment: {
- CheckExplicitlyDefaultedMoveAssignment(MD);
+ CheckExplicitlyDefaultedSpecialMember(MD);
if (!MD->isInvalidDecl())
DefineImplicitMoveAssignment(DefaultLoc, MD);
break;
Modified: cfe/branches/tooling/lib/Sema/SemaDeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaDeclObjC.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaDeclObjC.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaDeclObjC.cpp Tue May 15 13:51:08 2012
@@ -2444,19 +2444,10 @@
return false;
}
-namespace {
- /// \brief Describes the compatibility of a result type with its method.
- enum ResultTypeCompatibilityKind {
- RTC_Compatible,
- RTC_Incompatible,
- RTC_Unknown
- };
-}
-
/// \brief Check whether the declared result type of the given Objective-C
/// method declaration is compatible with the method's class.
///
-static ResultTypeCompatibilityKind
+static Sema::ResultTypeCompatibilityKind
CheckRelatedResultTypeCompatibility(Sema &S, ObjCMethodDecl *Method,
ObjCInterfaceDecl *CurrentClass) {
QualType ResultType = Method->getResultType();
@@ -2469,27 +2460,27 @@
// - it is id or qualified id, or
if (ResultObjectType->isObjCIdType() ||
ResultObjectType->isObjCQualifiedIdType())
- return RTC_Compatible;
+ return Sema::RTC_Compatible;
if (CurrentClass) {
if (ObjCInterfaceDecl *ResultClass
= ResultObjectType->getInterfaceDecl()) {
// - it is the same as the method's class type, or
if (declaresSameEntity(CurrentClass, ResultClass))
- return RTC_Compatible;
+ return Sema::RTC_Compatible;
// - it is a superclass of the method's class type
if (ResultClass->isSuperClassOf(CurrentClass))
- return RTC_Compatible;
+ return Sema::RTC_Compatible;
}
} else {
// Any Objective-C pointer type might be acceptable for a protocol
// method; we just don't know.
- return RTC_Unknown;
+ return Sema::RTC_Unknown;
}
}
- return RTC_Incompatible;
+ return Sema::RTC_Incompatible;
}
namespace {
@@ -2639,6 +2630,67 @@
};
}
+void Sema::CheckObjCMethodOverrides(ObjCMethodDecl *ObjCMethod,
+ ObjCInterfaceDecl *CurrentClass,
+ ResultTypeCompatibilityKind RTC) {
+ // Search for overridden methods and merge information down from them.
+ OverrideSearch overrides(*this, ObjCMethod);
+ // Keep track if the method overrides any method in the class's base classes,
+ // its protocols, or its categories' protocols; we will keep that info
+ // in the ObjCMethodDecl.
+ // For this info, a method in an implementation is not considered as
+ // overriding the same method in the interface or its categories.
+ bool hasOverriddenMethodsInBaseOrProtocol = false;
+ for (OverrideSearch::iterator
+ i = overrides.begin(), e = overrides.end(); i != e; ++i) {
+ ObjCMethodDecl *overridden = *i;
+
+ if (isa<ObjCProtocolDecl>(overridden->getDeclContext()) ||
+ CurrentClass != overridden->getClassInterface() ||
+ overridden->isOverriding())
+ hasOverriddenMethodsInBaseOrProtocol = true;
+
+ // Propagate down the 'related result type' bit from overridden methods.
+ if (RTC != Sema::RTC_Incompatible && overridden->hasRelatedResultType())
+ ObjCMethod->SetRelatedResultType();
+
+ // Then merge the declarations.
+ mergeObjCMethodDecls(ObjCMethod, overridden);
+
+ if (ObjCMethod->isImplicit() && overridden->isImplicit())
+ continue; // Conflicting properties are detected elsewhere.
+
+ // Check for overriding methods
+ if (isa<ObjCInterfaceDecl>(ObjCMethod->getDeclContext()) ||
+ isa<ObjCImplementationDecl>(ObjCMethod->getDeclContext()))
+ CheckConflictingOverridingMethod(ObjCMethod, overridden,
+ isa<ObjCProtocolDecl>(overridden->getDeclContext()));
+
+ if (CurrentClass && overridden->getDeclContext() != CurrentClass &&
+ isa<ObjCInterfaceDecl>(overridden->getDeclContext())) {
+ ObjCMethodDecl::param_iterator ParamI = ObjCMethod->param_begin(),
+ E = ObjCMethod->param_end();
+ ObjCMethodDecl::param_iterator PrevI = overridden->param_begin();
+ for (; ParamI != E; ++ParamI, ++PrevI) {
+ // Number of parameters are the same and is guaranteed by selector match.
+ assert(PrevI != overridden->param_end() && "Param mismatch");
+ QualType T1 = Context.getCanonicalType((*ParamI)->getType());
+ QualType T2 = Context.getCanonicalType((*PrevI)->getType());
+ // If type of argument of method in this class does not match its
+ // respective argument type in the super class method, issue warning;
+ if (!Context.typesAreCompatible(T1, T2)) {
+ Diag((*ParamI)->getLocation(), diag::ext_typecheck_base_super)
+ << T1 << T2;
+ Diag(overridden->getLocation(), diag::note_previous_declaration);
+ break;
+ }
+ }
+ }
+ }
+
+ ObjCMethod->setOverriding(hasOverriddenMethodsInBaseOrProtocol);
+}
+
Decl *Sema::ActOnMethodDeclaration(
Scope *S,
SourceLocation MethodLoc, SourceLocation EndLoc,
@@ -2828,53 +2880,14 @@
ResultTypeCompatibilityKind RTC
= CheckRelatedResultTypeCompatibility(*this, ObjCMethod, CurrentClass);
- // Search for overridden methods and merge information down from them.
- OverrideSearch overrides(*this, ObjCMethod);
- for (OverrideSearch::iterator
- i = overrides.begin(), e = overrides.end(); i != e; ++i) {
- ObjCMethodDecl *overridden = *i;
-
- // Propagate down the 'related result type' bit from overridden methods.
- if (RTC != RTC_Incompatible && overridden->hasRelatedResultType())
- ObjCMethod->SetRelatedResultType();
+ CheckObjCMethodOverrides(ObjCMethod, CurrentClass, RTC);
- // Then merge the declarations.
- mergeObjCMethodDecls(ObjCMethod, overridden);
-
- // Check for overriding methods
- if (isa<ObjCInterfaceDecl>(ObjCMethod->getDeclContext()) ||
- isa<ObjCImplementationDecl>(ObjCMethod->getDeclContext()))
- CheckConflictingOverridingMethod(ObjCMethod, overridden,
- isa<ObjCProtocolDecl>(overridden->getDeclContext()));
-
- if (CurrentClass && overridden->getDeclContext() != CurrentClass &&
- isa<ObjCInterfaceDecl>(overridden->getDeclContext())) {
- ObjCMethodDecl::param_iterator ParamI = ObjCMethod->param_begin(),
- E = ObjCMethod->param_end();
- ObjCMethodDecl::param_iterator PrevI = overridden->param_begin();
- for (; ParamI != E; ++ParamI, ++PrevI) {
- // Number of parameters are the same and is guaranteed by selector match.
- assert(PrevI != overridden->param_end() && "Param mismatch");
- QualType T1 = Context.getCanonicalType((*ParamI)->getType());
- QualType T2 = Context.getCanonicalType((*PrevI)->getType());
- // If type of argument of method in this class does not match its
- // respective argument type in the super class method, issue warning;
- if (!Context.typesAreCompatible(T1, T2)) {
- Diag((*ParamI)->getLocation(), diag::ext_typecheck_base_super)
- << T1 << T2;
- Diag(overridden->getLocation(), diag::note_previous_declaration);
- break;
- }
- }
- }
- }
-
bool ARCError = false;
if (getLangOpts().ObjCAutoRefCount)
ARCError = CheckARCMethodDecl(*this, ObjCMethod);
// Infer the related result type when possible.
- if (!ARCError && RTC == RTC_Compatible &&
+ if (!ARCError && RTC == Sema::RTC_Compatible &&
!ObjCMethod->hasRelatedResultType() &&
LangOpts.ObjCInferRelatedResultType) {
bool InferRelatedResultType = false;
Modified: cfe/branches/tooling/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaExpr.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaExpr.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaExpr.cpp Tue May 15 13:51:08 2012
@@ -3380,11 +3380,18 @@
// arguments for the remaining parameters), don't make the call.
if (NumArgs < NumArgsInProto) {
if (NumArgs < MinArgs) {
- Diag(RParenLoc, MinArgs == NumArgsInProto
- ? diag::err_typecheck_call_too_few_args
- : diag::err_typecheck_call_too_few_args_at_least)
- << FnKind
- << MinArgs << NumArgs << Fn->getSourceRange();
+ if (MinArgs == 1 && FDecl && FDecl->getParamDecl(0)->getDeclName())
+ Diag(RParenLoc, MinArgs == NumArgsInProto && !Proto->isVariadic()
+ ? diag::err_typecheck_call_too_few_args_one
+ : diag::err_typecheck_call_too_few_args_at_least_one)
+ << FnKind
+ << FDecl->getParamDecl(0) << Fn->getSourceRange();
+ else
+ Diag(RParenLoc, MinArgs == NumArgsInProto && !Proto->isVariadic()
+ ? diag::err_typecheck_call_too_few_args
+ : diag::err_typecheck_call_too_few_args_at_least)
+ << FnKind
+ << MinArgs << NumArgs << Fn->getSourceRange();
// Emit the location of the prototype.
if (FDecl && !FDecl->getBuiltinID() && !IsExecConfig)
@@ -3400,14 +3407,24 @@
// them.
if (NumArgs > NumArgsInProto) {
if (!Proto->isVariadic()) {
- Diag(Args[NumArgsInProto]->getLocStart(),
- MinArgs == NumArgsInProto
- ? diag::err_typecheck_call_too_many_args
- : diag::err_typecheck_call_too_many_args_at_most)
- << FnKind
- << NumArgsInProto << NumArgs << Fn->getSourceRange()
- << SourceRange(Args[NumArgsInProto]->getLocStart(),
- Args[NumArgs-1]->getLocEnd());
+ if (NumArgsInProto == 1 && FDecl && FDecl->getParamDecl(0)->getDeclName())
+ Diag(Args[NumArgsInProto]->getLocStart(),
+ MinArgs == NumArgsInProto
+ ? diag::err_typecheck_call_too_many_args_one
+ : diag::err_typecheck_call_too_many_args_at_most_one)
+ << FnKind
+ << FDecl->getParamDecl(0) << NumArgs << Fn->getSourceRange()
+ << SourceRange(Args[NumArgsInProto]->getLocStart(),
+ Args[NumArgs-1]->getLocEnd());
+ else
+ Diag(Args[NumArgsInProto]->getLocStart(),
+ MinArgs == NumArgsInProto
+ ? diag::err_typecheck_call_too_many_args
+ : diag::err_typecheck_call_too_many_args_at_most)
+ << FnKind
+ << NumArgsInProto << NumArgs << Fn->getSourceRange()
+ << SourceRange(Args[NumArgsInProto]->getLocStart(),
+ Args[NumArgs-1]->getLocEnd());
// Emit the location of the prototype.
if (FDecl && !FDecl->getBuiltinID() && !IsExecConfig)
Modified: cfe/branches/tooling/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaExprCXX.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaExprCXX.cpp Tue May 15 13:51:08 2012
@@ -4775,11 +4775,11 @@
CXXDestructorDecl *Destructor = LookupDestructor(RD);
Temp->setDestructor(Destructor);
- MarkFunctionReferenced(E->getExprLoc(), Destructor);
- CheckDestructorAccess(E->getExprLoc(), Destructor,
+ MarkFunctionReferenced(Bind->getExprLoc(), Destructor);
+ CheckDestructorAccess(Bind->getExprLoc(), Destructor,
PDiag(diag::err_access_dtor_temp)
- << E->getType());
- DiagnoseUseOfDecl(Destructor, E->getExprLoc());
+ << Bind->getType());
+ DiagnoseUseOfDecl(Destructor, Bind->getExprLoc());
// We need a cleanup, but we don't need to remember the temporary.
ExprNeedsCleanups = true;
Modified: cfe/branches/tooling/lib/Sema/SemaExprObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaExprObjC.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaExprObjC.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaExprObjC.cpp Tue May 15 13:51:08 2012
@@ -140,6 +140,30 @@
return new (Context) ObjCStringLiteral(S, Ty, AtLoc);
}
+/// \brief Emits an error if the given method does not exist, or if the return
+/// type is not an Objective-C object.
+static bool validateBoxingMethod(Sema &S, SourceLocation Loc,
+ const ObjCInterfaceDecl *Class,
+ Selector Sel, const ObjCMethodDecl *Method) {
+ if (!Method) {
+ // FIXME: Is there a better way to avoid quotes than using getName()?
+ S.Diag(Loc, diag::err_undeclared_boxing_method) << Sel << Class->getName();
+ return false;
+ }
+
+ // Make sure the return type is reasonable.
+ QualType ReturnType = Method->getResultType();
+ if (!ReturnType->isObjCObjectPointerType()) {
+ S.Diag(Loc, diag::err_objc_literal_method_sig)
+ << Sel;
+ S.Diag(Method->getLocation(), diag::note_objc_literal_method_return)
+ << ReturnType;
+ return false;
+ }
+
+ return true;
+}
+
/// \brief Retrieve the NSNumber factory method that should be used to create
/// an Objective-C literal for the given type.
static ObjCMethodDecl *getNSNumberFactoryMethod(Sema &S, SourceLocation Loc,
@@ -169,17 +193,18 @@
// Look up the NSNumber class, if we haven't done so already. It's cached
// in the Sema instance.
if (!S.NSNumberDecl) {
- IdentifierInfo *NSNumberId = S.NSAPIObj->getNSClassId(NSAPI::ClassId_NSNumber);
+ IdentifierInfo *NSNumberId =
+ S.NSAPIObj->getNSClassId(NSAPI::ClassId_NSNumber);
NamedDecl *IF = S.LookupSingleName(S.TUScope, NSNumberId,
Loc, Sema::LookupOrdinaryName);
S.NSNumberDecl = dyn_cast_or_null<ObjCInterfaceDecl>(IF);
if (!S.NSNumberDecl) {
if (S.getLangOpts().DebuggerObjCLiteral) {
// Create a stub definition of NSNumber.
- S.NSNumberDecl = ObjCInterfaceDecl::Create (CX,
- CX.getTranslationUnitDecl(),
- SourceLocation(), NSNumberId,
- 0, SourceLocation());
+ S.NSNumberDecl = ObjCInterfaceDecl::Create(CX,
+ CX.getTranslationUnitDecl(),
+ SourceLocation(), NSNumberId,
+ 0, SourceLocation());
} else {
// Otherwise, require a declaration of NSNumber.
S.Diag(Loc, diag::err_undeclared_nsnumber);
@@ -191,41 +216,34 @@
}
// generate the pointer to NSNumber type.
- S.NSNumberPointer = CX.getObjCObjectPointerType(CX.getObjCInterfaceType(S.NSNumberDecl));
+ QualType NSNumberObject = CX.getObjCInterfaceType(S.NSNumberDecl);
+ S.NSNumberPointer = CX.getObjCObjectPointerType(NSNumberObject);
}
// Look for the appropriate method within NSNumber.
- ObjCMethodDecl *Method = S.NSNumberDecl->lookupClassMethod(Sel);;
+ ObjCMethodDecl *Method = S.NSNumberDecl->lookupClassMethod(Sel);
if (!Method && S.getLangOpts().DebuggerObjCLiteral) {
// create a stub definition this NSNumber factory method.
TypeSourceInfo *ResultTInfo = 0;
Method = ObjCMethodDecl::Create(CX, SourceLocation(), SourceLocation(), Sel,
- S.NSNumberPointer, ResultTInfo, S.NSNumberDecl,
+ S.NSNumberPointer, ResultTInfo,
+ S.NSNumberDecl,
/*isInstance=*/false, /*isVariadic=*/false,
/*isSynthesized=*/false,
/*isImplicitlyDeclared=*/true,
- /*isDefined=*/false, ObjCMethodDecl::Required,
+ /*isDefined=*/false,
+ ObjCMethodDecl::Required,
/*HasRelatedResultType=*/false);
ParmVarDecl *value = ParmVarDecl::Create(S.Context, Method,
SourceLocation(), SourceLocation(),
&CX.Idents.get("value"),
- NumberType, /*TInfo=*/0, SC_None, SC_None, 0);
+ NumberType, /*TInfo=*/0, SC_None,
+ SC_None, 0);
Method->setMethodParams(S.Context, value, ArrayRef<SourceLocation>());
}
- if (!Method) {
- S.Diag(Loc, diag::err_undeclared_nsnumber_method) << Sel;
+ if (!validateBoxingMethod(S, Loc, S.NSNumberDecl, Sel, Method))
return 0;
- }
-
- // Make sure the return type is reasonable.
- if (!Method->getResultType()->isObjCObjectPointerType()) {
- S.Diag(Loc, diag::err_objc_literal_method_sig)
- << Sel;
- S.Diag(Method->getLocation(), diag::note_objc_literal_method_return)
- << Method->getResultType();
- return 0;
- }
// Note: if the parameter type is out-of-line, we'll catch it later in the
// implicit conversion.
@@ -320,9 +338,11 @@
// type.
if (S.getLangOpts().CPlusPlus && Element->getType()->isRecordType()) {
InitializedEntity Entity
- = InitializedEntity::InitializeParameter(S.Context, T, /*Consumed=*/false);
+ = InitializedEntity::InitializeParameter(S.Context, T,
+ /*Consumed=*/false);
InitializationKind Kind
- = InitializationKind::CreateCopy(Element->getLocStart(), SourceLocation());
+ = InitializationKind::CreateCopy(Element->getLocStart(),
+ SourceLocation());
InitializationSequence Seq(S, Entity, Kind, &Element, 1);
if (!Seq.Failed())
return Seq.Perform(S, Entity, Kind, MultiExprArg(S, &Element, 1));
@@ -425,9 +445,10 @@
if (!NSStringDecl) {
if (getLangOpts().DebuggerObjCLiteral) {
// Support boxed expressions in the debugger w/o NSString declaration.
- NSStringDecl = ObjCInterfaceDecl::Create(Context,
- Context.getTranslationUnitDecl(),
- SourceLocation(), NSStringId,
+ DeclContext *TU = Context.getTranslationUnitDecl();
+ NSStringDecl = ObjCInterfaceDecl::Create(Context, TU,
+ SourceLocation(),
+ NSStringId,
0, SourceLocation());
} else {
Diag(SR.getBegin(), diag::err_undeclared_nsstring);
@@ -438,8 +459,8 @@
return ExprError();
}
assert(NSStringDecl && "NSStringDecl should not be NULL");
- NSStringPointer =
- Context.getObjCObjectPointerType(Context.getObjCInterfaceType(NSStringDecl));
+ QualType NSStringObject = Context.getObjCInterfaceType(NSStringDecl);
+ NSStringPointer = Context.getObjCObjectPointerType(NSStringObject);
}
if (!StringWithUTF8StringMethod) {
@@ -447,8 +468,8 @@
Selector stringWithUTF8String = Context.Selectors.getUnarySelector(II);
// Look for the appropriate method within NSString.
- StringWithUTF8StringMethod = NSStringDecl->lookupClassMethod(stringWithUTF8String);
- if (!StringWithUTF8StringMethod && getLangOpts().DebuggerObjCLiteral) {
+ BoxingMethod = NSStringDecl->lookupClassMethod(stringWithUTF8String);
+ if (!BoxingMethod && getLangOpts().DebuggerObjCLiteral) {
// Debugger needs to work even if NSString hasn't been defined.
TypeSourceInfo *ResultTInfo = 0;
ObjCMethodDecl *M =
@@ -461,18 +482,23 @@
/*isDefined=*/false,
ObjCMethodDecl::Required,
/*HasRelatedResultType=*/false);
+ QualType ConstCharType = Context.CharTy.withConst();
ParmVarDecl *value =
ParmVarDecl::Create(Context, M,
SourceLocation(), SourceLocation(),
&Context.Idents.get("value"),
- Context.getPointerType(Context.CharTy.withConst()),
+ Context.getPointerType(ConstCharType),
/*TInfo=*/0,
SC_None, SC_None, 0);
M->setMethodParams(Context, value, ArrayRef<SourceLocation>());
- StringWithUTF8StringMethod = M;
+ BoxingMethod = M;
}
- assert(StringWithUTF8StringMethod &&
- "StringWithUTF8StringMethod should not be NULL");
+
+ if (!validateBoxingMethod(*this, SR.getBegin(), NSStringDecl,
+ stringWithUTF8String, BoxingMethod))
+ return ExprError();
+
+ StringWithUTF8StringMethod = BoxingMethod;
}
BoxingMethod = StringWithUTF8StringMethod;
@@ -593,11 +619,10 @@
if (!ArrayWithObjectsMethod) {
Selector
Sel = NSAPIObj->getNSArraySelector(NSAPI::NSArr_arrayWithObjectsCount);
- ArrayWithObjectsMethod = NSArrayDecl->lookupClassMethod(Sel);
- if (!ArrayWithObjectsMethod && getLangOpts().DebuggerObjCLiteral) {
+ ObjCMethodDecl *Method = NSArrayDecl->lookupClassMethod(Sel);
+ if (!Method && getLangOpts().DebuggerObjCLiteral) {
TypeSourceInfo *ResultTInfo = 0;
- ArrayWithObjectsMethod =
- ObjCMethodDecl::Create(Context,
+ Method = ObjCMethodDecl::Create(Context,
SourceLocation(), SourceLocation(), Sel,
IdT,
ResultTInfo,
@@ -608,80 +633,68 @@
ObjCMethodDecl::Required,
false);
SmallVector<ParmVarDecl *, 2> Params;
- ParmVarDecl *objects = ParmVarDecl::Create(Context, ArrayWithObjectsMethod,
- SourceLocation(), SourceLocation(),
- &Context.Idents.get("objects"),
- Context.getPointerType(IdT),
- /*TInfo=*/0,
- SC_None,
- SC_None,
- 0);
+ ParmVarDecl *objects = ParmVarDecl::Create(Context, Method,
+ SourceLocation(),
+ SourceLocation(),
+ &Context.Idents.get("objects"),
+ Context.getPointerType(IdT),
+ /*TInfo=*/0, SC_None, SC_None,
+ 0);
Params.push_back(objects);
- ParmVarDecl *cnt = ParmVarDecl::Create(Context, ArrayWithObjectsMethod,
- SourceLocation(), SourceLocation(),
- &Context.Idents.get("cnt"),
- Context.UnsignedLongTy,
- /*TInfo=*/0,
- SC_None,
- SC_None,
- 0);
+ ParmVarDecl *cnt = ParmVarDecl::Create(Context, Method,
+ SourceLocation(),
+ SourceLocation(),
+ &Context.Idents.get("cnt"),
+ Context.UnsignedLongTy,
+ /*TInfo=*/0, SC_None, SC_None,
+ 0);
Params.push_back(cnt);
- ArrayWithObjectsMethod->setMethodParams(Context, Params,
- ArrayRef<SourceLocation>());
-
-
+ Method->setMethodParams(Context, Params, ArrayRef<SourceLocation>());
}
- if (!ArrayWithObjectsMethod) {
- Diag(SR.getBegin(), diag::err_undeclared_arraywithobjects) << Sel;
+ if (!validateBoxingMethod(*this, SR.getBegin(), NSArrayDecl, Sel, Method))
+ return ExprError();
+
+ // Dig out the type that all elements should be converted to.
+ QualType T = Method->param_begin()[0]->getType();
+ const PointerType *PtrT = T->getAs<PointerType>();
+ if (!PtrT ||
+ !Context.hasSameUnqualifiedType(PtrT->getPointeeType(), IdT)) {
+ Diag(SR.getBegin(), diag::err_objc_literal_method_sig)
+ << Sel;
+ Diag(Method->param_begin()[0]->getLocation(),
+ diag::note_objc_literal_method_param)
+ << 0 << T
+ << Context.getPointerType(IdT.withConst());
return ExprError();
}
- }
- // Make sure the return type is reasonable.
- if (!ArrayWithObjectsMethod->getResultType()->isObjCObjectPointerType()) {
- Diag(SR.getBegin(), diag::err_objc_literal_method_sig)
- << ArrayWithObjectsMethod->getSelector();
- Diag(ArrayWithObjectsMethod->getLocation(),
- diag::note_objc_literal_method_return)
- << ArrayWithObjectsMethod->getResultType();
- return ExprError();
- }
+ // Check that the 'count' parameter is integral.
+ if (!Method->param_begin()[1]->getType()->isIntegerType()) {
+ Diag(SR.getBegin(), diag::err_objc_literal_method_sig)
+ << Sel;
+ Diag(Method->param_begin()[1]->getLocation(),
+ diag::note_objc_literal_method_param)
+ << 1
+ << Method->param_begin()[1]->getType()
+ << "integral";
+ return ExprError();
+ }
- // Dig out the type that all elements should be converted to.
- QualType T = ArrayWithObjectsMethod->param_begin()[0]->getType();
- const PointerType *PtrT = T->getAs<PointerType>();
- if (!PtrT ||
- !Context.hasSameUnqualifiedType(PtrT->getPointeeType(), IdT)) {
- Diag(SR.getBegin(), diag::err_objc_literal_method_sig)
- << ArrayWithObjectsMethod->getSelector();
- Diag(ArrayWithObjectsMethod->param_begin()[0]->getLocation(),
- diag::note_objc_literal_method_param)
- << 0 << T
- << Context.getPointerType(IdT.withConst());
- return ExprError();
- }
- T = PtrT->getPointeeType();
-
- // Check that the 'count' parameter is integral.
- if (!ArrayWithObjectsMethod->param_begin()[1]->getType()->isIntegerType()) {
- Diag(SR.getBegin(), diag::err_objc_literal_method_sig)
- << ArrayWithObjectsMethod->getSelector();
- Diag(ArrayWithObjectsMethod->param_begin()[1]->getLocation(),
- diag::note_objc_literal_method_param)
- << 1
- << ArrayWithObjectsMethod->param_begin()[1]->getType()
- << "integral";
- return ExprError();
+ // We've found a good +arrayWithObjects:count: method. Save it!
+ ArrayWithObjectsMethod = Method;
}
+ QualType ObjectsType = ArrayWithObjectsMethod->param_begin()[0]->getType();
+ QualType RequiredType = ObjectsType->castAs<PointerType>()->getPointeeType();
+
// Check that each of the elements provided is valid in a collection literal,
// performing conversions as necessary.
Expr **ElementsBuffer = Elements.get();
for (unsigned I = 0, N = Elements.size(); I != N; ++I) {
ExprResult Converted = CheckObjCCollectionLiteralElement(*this,
ElementsBuffer[I],
- T);
+ RequiredType);
if (Converted.isInvalid())
return ExprError();
@@ -726,11 +739,10 @@
QualType IdT = Context.getObjCIdType();
if (!DictionaryWithObjectsMethod) {
Selector Sel = NSAPIObj->getNSDictionarySelector(
- NSAPI::NSDict_dictionaryWithObjectsForKeysCount);
- DictionaryWithObjectsMethod = NSDictionaryDecl->lookupClassMethod(Sel);
- if (!DictionaryWithObjectsMethod && getLangOpts().DebuggerObjCLiteral) {
- DictionaryWithObjectsMethod =
- ObjCMethodDecl::Create(Context,
+ NSAPI::NSDict_dictionaryWithObjectsForKeysCount);
+ ObjCMethodDecl *Method = NSDictionaryDecl->lookupClassMethod(Sel);
+ if (!Method && getLangOpts().DebuggerObjCLiteral) {
+ Method = ObjCMethodDecl::Create(Context,
SourceLocation(), SourceLocation(), Sel,
IdT,
0 /*TypeSourceInfo */,
@@ -741,117 +753,107 @@
ObjCMethodDecl::Required,
false);
SmallVector<ParmVarDecl *, 3> Params;
- ParmVarDecl *objects = ParmVarDecl::Create(Context, DictionaryWithObjectsMethod,
- SourceLocation(), SourceLocation(),
- &Context.Idents.get("objects"),
- Context.getPointerType(IdT),
- /*TInfo=*/0,
- SC_None,
- SC_None,
- 0);
+ ParmVarDecl *objects = ParmVarDecl::Create(Context, Method,
+ SourceLocation(),
+ SourceLocation(),
+ &Context.Idents.get("objects"),
+ Context.getPointerType(IdT),
+ /*TInfo=*/0, SC_None, SC_None,
+ 0);
Params.push_back(objects);
- ParmVarDecl *keys = ParmVarDecl::Create(Context, DictionaryWithObjectsMethod,
- SourceLocation(), SourceLocation(),
- &Context.Idents.get("keys"),
- Context.getPointerType(IdT),
- /*TInfo=*/0,
- SC_None,
- SC_None,
- 0);
+ ParmVarDecl *keys = ParmVarDecl::Create(Context, Method,
+ SourceLocation(),
+ SourceLocation(),
+ &Context.Idents.get("keys"),
+ Context.getPointerType(IdT),
+ /*TInfo=*/0, SC_None, SC_None,
+ 0);
Params.push_back(keys);
- ParmVarDecl *cnt = ParmVarDecl::Create(Context, DictionaryWithObjectsMethod,
- SourceLocation(), SourceLocation(),
- &Context.Idents.get("cnt"),
- Context.UnsignedLongTy,
- /*TInfo=*/0,
- SC_None,
- SC_None,
- 0);
+ ParmVarDecl *cnt = ParmVarDecl::Create(Context, Method,
+ SourceLocation(),
+ SourceLocation(),
+ &Context.Idents.get("cnt"),
+ Context.UnsignedLongTy,
+ /*TInfo=*/0, SC_None, SC_None,
+ 0);
Params.push_back(cnt);
- DictionaryWithObjectsMethod->setMethodParams(Context, Params,
- ArrayRef<SourceLocation>());
+ Method->setMethodParams(Context, Params, ArrayRef<SourceLocation>());
}
- if (!DictionaryWithObjectsMethod) {
- Diag(SR.getBegin(), diag::err_undeclared_dictwithobjects) << Sel;
- return ExprError();
+ if (!validateBoxingMethod(*this, SR.getBegin(), NSDictionaryDecl, Sel,
+ Method))
+ return ExprError();
+
+ // Dig out the type that all values should be converted to.
+ QualType ValueT = Method->param_begin()[0]->getType();
+ const PointerType *PtrValue = ValueT->getAs<PointerType>();
+ if (!PtrValue ||
+ !Context.hasSameUnqualifiedType(PtrValue->getPointeeType(), IdT)) {
+ Diag(SR.getBegin(), diag::err_objc_literal_method_sig)
+ << Sel;
+ Diag(Method->param_begin()[0]->getLocation(),
+ diag::note_objc_literal_method_param)
+ << 0 << ValueT
+ << Context.getPointerType(IdT.withConst());
+ return ExprError();
}
- }
-
- // Make sure the return type is reasonable.
- if (!DictionaryWithObjectsMethod->getResultType()->isObjCObjectPointerType()){
- Diag(SR.getBegin(), diag::err_objc_literal_method_sig)
- << DictionaryWithObjectsMethod->getSelector();
- Diag(DictionaryWithObjectsMethod->getLocation(),
- diag::note_objc_literal_method_return)
- << DictionaryWithObjectsMethod->getResultType();
- return ExprError();
- }
- // Dig out the type that all values should be converted to.
- QualType ValueT = DictionaryWithObjectsMethod->param_begin()[0]->getType();
- const PointerType *PtrValue = ValueT->getAs<PointerType>();
- if (!PtrValue ||
- !Context.hasSameUnqualifiedType(PtrValue->getPointeeType(), IdT)) {
- Diag(SR.getBegin(), diag::err_objc_literal_method_sig)
- << DictionaryWithObjectsMethod->getSelector();
- Diag(DictionaryWithObjectsMethod->param_begin()[0]->getLocation(),
- diag::note_objc_literal_method_param)
- << 0 << ValueT
- << Context.getPointerType(IdT.withConst());
- return ExprError();
- }
- ValueT = PtrValue->getPointeeType();
-
- // Dig out the type that all keys should be converted to.
- QualType KeyT = DictionaryWithObjectsMethod->param_begin()[1]->getType();
- const PointerType *PtrKey = KeyT->getAs<PointerType>();
- if (!PtrKey ||
- !Context.hasSameUnqualifiedType(PtrKey->getPointeeType(),
- IdT)) {
- bool err = true;
- if (PtrKey) {
- if (QIDNSCopying.isNull()) {
- // key argument of selector is id<NSCopying>?
- if (ObjCProtocolDecl *NSCopyingPDecl =
- LookupProtocol(&Context.Idents.get("NSCopying"), SR.getBegin())) {
- ObjCProtocolDecl *PQ[] = {NSCopyingPDecl};
- QIDNSCopying =
- Context.getObjCObjectType(Context.ObjCBuiltinIdTy,
- (ObjCProtocolDecl**) PQ,1);
- QIDNSCopying = Context.getObjCObjectPointerType(QIDNSCopying);
+ // Dig out the type that all keys should be converted to.
+ QualType KeyT = Method->param_begin()[1]->getType();
+ const PointerType *PtrKey = KeyT->getAs<PointerType>();
+ if (!PtrKey ||
+ !Context.hasSameUnqualifiedType(PtrKey->getPointeeType(),
+ IdT)) {
+ bool err = true;
+ if (PtrKey) {
+ if (QIDNSCopying.isNull()) {
+ // key argument of selector is id<NSCopying>?
+ if (ObjCProtocolDecl *NSCopyingPDecl =
+ LookupProtocol(&Context.Idents.get("NSCopying"), SR.getBegin())) {
+ ObjCProtocolDecl *PQ[] = {NSCopyingPDecl};
+ QIDNSCopying =
+ Context.getObjCObjectType(Context.ObjCBuiltinIdTy,
+ (ObjCProtocolDecl**) PQ,1);
+ QIDNSCopying = Context.getObjCObjectPointerType(QIDNSCopying);
+ }
}
+ if (!QIDNSCopying.isNull())
+ err = !Context.hasSameUnqualifiedType(PtrKey->getPointeeType(),
+ QIDNSCopying);
}
- if (!QIDNSCopying.isNull())
- err = !Context.hasSameUnqualifiedType(PtrKey->getPointeeType(),
- QIDNSCopying);
- }
- if (err) {
+ if (err) {
+ Diag(SR.getBegin(), diag::err_objc_literal_method_sig)
+ << Sel;
+ Diag(Method->param_begin()[1]->getLocation(),
+ diag::note_objc_literal_method_param)
+ << 1 << KeyT
+ << Context.getPointerType(IdT.withConst());
+ return ExprError();
+ }
+ }
+
+ // Check that the 'count' parameter is integral.
+ QualType CountType = Method->param_begin()[2]->getType();
+ if (!CountType->isIntegerType()) {
Diag(SR.getBegin(), diag::err_objc_literal_method_sig)
- << DictionaryWithObjectsMethod->getSelector();
- Diag(DictionaryWithObjectsMethod->param_begin()[1]->getLocation(),
+ << Sel;
+ Diag(Method->param_begin()[2]->getLocation(),
diag::note_objc_literal_method_param)
- << 1 << KeyT
- << Context.getPointerType(IdT.withConst());
+ << 2 << CountType
+ << "integral";
return ExprError();
}
- }
- KeyT = PtrKey->getPointeeType();
- // Check that the 'count' parameter is integral.
- if (!DictionaryWithObjectsMethod->param_begin()[2]->getType()
- ->isIntegerType()) {
- Diag(SR.getBegin(), diag::err_objc_literal_method_sig)
- << DictionaryWithObjectsMethod->getSelector();
- Diag(DictionaryWithObjectsMethod->param_begin()[2]->getLocation(),
- diag::note_objc_literal_method_param)
- << 2
- << DictionaryWithObjectsMethod->param_begin()[2]->getType()
- << "integral";
- return ExprError();
+ // We've found a good +dictionaryWithObjects:keys:count: method; save it!
+ DictionaryWithObjectsMethod = Method;
}
+ QualType ValuesT = DictionaryWithObjectsMethod->param_begin()[0]->getType();
+ QualType ValueT = ValuesT->castAs<PointerType>()->getPointeeType();
+ QualType KeysT = DictionaryWithObjectsMethod->param_begin()[1]->getType();
+ QualType KeyT = KeysT->castAs<PointerType>()->getPointeeType();
+
// Check that each of the keys and values provided is valid in a collection
// literal, performing conversions as necessary.
bool HasPackExpansions = false;
@@ -1194,7 +1196,8 @@
if (Args[i]->isTypeDependent())
continue;
- ExprResult Arg = DefaultVariadicArgumentPromotion(Args[i], VariadicMethod, 0);
+ ExprResult Arg = DefaultVariadicArgumentPromotion(Args[i], VariadicMethod,
+ 0);
IsError |= Arg.isInvalid();
Args[i] = Arg.take();
}
@@ -2143,7 +2146,7 @@
receiverIsId);
if (!Method)
Method = LookupFactoryMethodInGlobalPool(Sel,
- SourceRange(LBracLoc, RBracLoc),
+ SourceRange(LBracLoc,RBracLoc),
receiverIsId);
} else if (ReceiverType->isObjCClassType() ||
ReceiverType->isObjCQualifiedClassType()) {
@@ -2255,7 +2258,7 @@
// compatibility. FIXME: should we deviate??
if (OCIType->qual_empty()) {
Method = LookupInstanceMethodInGlobalPool(Sel,
- SourceRange(LBracLoc, RBracLoc));
+ SourceRange(LBracLoc, RBracLoc));
if (Method && !forwardClass)
Diag(Loc, diag::warn_maynot_respond)
<< OCIType->getInterfaceDecl()->getIdentifier() << Sel;
@@ -2280,8 +2283,9 @@
// TODO: specialized warning on null receivers?
bool IsNull = Receiver->isNullPointerConstant(Context,
Expr::NPC_ValueDependentIsNull);
+ CastKind Kind = IsNull ? CK_NullToPointer : CK_IntegralToPointer;
Receiver = ImpCastExprToType(Receiver, Context.getObjCIdType(),
- IsNull ? CK_NullToPointer : CK_IntegralToPointer).take();
+ Kind).take();
}
ReceiverType = Receiver->getType();
} else {
Modified: cfe/branches/tooling/lib/Sema/SemaObjCProperty.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaObjCProperty.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaObjCProperty.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaObjCProperty.cpp Tue May 15 13:51:08 2012
@@ -658,6 +658,7 @@
}
ObjCIvarDecl *Ivar = 0;
bool CompleteTypeErr = false;
+ bool compat = true;
// Check that we have a valid, previously declared ivar for @synthesize
if (Synthesize) {
// @synthesize
@@ -773,8 +774,8 @@
QualType IvarType = Context.getCanonicalType(Ivar->getType());
// Check that type of property and its ivar are type compatible.
- if (Context.getCanonicalType(PropertyIvarType) != IvarType) {
- bool compat = false;
+ if (!Context.hasSameType(PropertyIvarType, IvarType)) {
+ compat = false;
if (isa<ObjCObjectPointerType>(PropertyIvarType)
&& isa<ObjCObjectPointerType>(IvarType))
compat =
@@ -794,19 +795,20 @@
// Note! I deliberately want it to fall thru so, we have a
// a property implementation and to avoid future warnings.
}
-
- // FIXME! Rules for properties are somewhat different that those
- // for assignments. Use a new routine to consolidate all cases;
- // specifically for property redeclarations as well as for ivars.
- QualType lhsType =Context.getCanonicalType(PropertyIvarType).getUnqualifiedType();
- QualType rhsType =Context.getCanonicalType(IvarType).getUnqualifiedType();
- if (lhsType != rhsType &&
- lhsType->isArithmeticType()) {
- Diag(PropertyDiagLoc, diag::error_property_ivar_type)
- << property->getDeclName() << PropType
- << Ivar->getDeclName() << IvarType;
- Diag(Ivar->getLocation(), diag::note_ivar_decl);
- // Fall thru - see previous comment
+ else {
+ // FIXME! Rules for properties are somewhat different that those
+ // for assignments. Use a new routine to consolidate all cases;
+ // specifically for property redeclarations as well as for ivars.
+ QualType lhsType =Context.getCanonicalType(PropertyIvarType).getUnqualifiedType();
+ QualType rhsType =Context.getCanonicalType(IvarType).getUnqualifiedType();
+ if (lhsType != rhsType &&
+ lhsType->isArithmeticType()) {
+ Diag(PropertyDiagLoc, diag::error_property_ivar_type)
+ << property->getDeclName() << PropType
+ << Ivar->getDeclName() << IvarType;
+ Diag(Ivar->getLocation(), diag::note_ivar_decl);
+ // Fall thru - see previous comment
+ }
}
// __weak is explicit. So it works on Canonical type.
if ((PropType.isObjCGCWeak() && !IvarType.isObjCGCWeak() &&
@@ -840,7 +842,7 @@
: ObjCPropertyImplDecl::Dynamic),
Ivar, PropertyIvarLoc);
- if (CompleteTypeErr)
+ if (CompleteTypeErr || !compat)
PIDecl->setInvalidDecl();
if (ObjCMethodDecl *getterMethod = property->getGetterMethodDecl()) {
@@ -1428,7 +1430,7 @@
SourceLocation()));
if (PIDecl) {
Diag(Prop->getLocation(), diag::warn_missing_explicit_synthesis);
- Diag(IMPDecl->getLocation(), diag::not_while_in_implementation);
+ Diag(IMPDecl->getLocation(), diag::note_while_in_implementation);
}
}
}
@@ -1776,6 +1778,18 @@
AddInstanceMethodToGlobalPool(GetterMethod);
if (SetterMethod)
AddInstanceMethodToGlobalPool(SetterMethod);
+
+ ObjCInterfaceDecl *CurrentClass = dyn_cast<ObjCInterfaceDecl>(CD);
+ if (!CurrentClass) {
+ if (ObjCCategoryDecl *Cat = dyn_cast<ObjCCategoryDecl>(CD))
+ CurrentClass = Cat->getClassInterface();
+ else if (ObjCImplDecl *Impl = dyn_cast<ObjCImplDecl>(CD))
+ CurrentClass = Impl->getClassInterface();
+ }
+ if (GetterMethod)
+ CheckObjCMethodOverrides(GetterMethod, CurrentClass, Sema::RTC_Unknown);
+ if (SetterMethod)
+ CheckObjCMethodOverrides(SetterMethod, CurrentClass, Sema::RTC_Unknown);
}
void Sema::CheckObjCPropertyAttributes(Decl *PDecl,
Modified: cfe/branches/tooling/lib/Sema/SemaOverload.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaOverload.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaOverload.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaOverload.cpp Tue May 15 13:51:08 2012
@@ -8149,9 +8149,14 @@
std::string Description;
OverloadCandidateKind FnKind = ClassifyOverloadCandidate(S, Fn, Description);
- S.Diag(Fn->getLocation(), diag::note_ovl_candidate_arity)
- << (unsigned) FnKind << (Fn->getDescribedFunctionTemplate() != 0) << mode
- << modeCount << NumFormalArgs;
+ if (modeCount == 1 && Fn->getParamDecl(0)->getDeclName())
+ S.Diag(Fn->getLocation(), diag::note_ovl_candidate_arity_one)
+ << (unsigned) FnKind << (Fn->getDescribedFunctionTemplate() != 0) << mode
+ << Fn->getParamDecl(0) << NumFormalArgs;
+ else
+ S.Diag(Fn->getLocation(), diag::note_ovl_candidate_arity)
+ << (unsigned) FnKind << (Fn->getDescribedFunctionTemplate() != 0) << mode
+ << modeCount << NumFormalArgs;
MaybeEmitInheritedConstructorNote(S, Fn);
}
@@ -8263,13 +8268,23 @@
Fn->getDescribedFunctionTemplate()->getTemplateParameters(), *Args);
}
+ // If this candidate was disabled by enable_if, say so.
+ PartialDiagnosticAt *PDiag = Cand->DeductionFailure.getSFINAEDiagnostic();
+ if (PDiag && PDiag->second.getDiagID() ==
+ diag::err_typename_nested_not_found_enable_if) {
+ // FIXME: Use the source range of the condition, and the fully-qualified
+ // name of the enable_if template. These are both present in PDiag.
+ S.Diag(PDiag->first, diag::note_ovl_candidate_disabled_by_enable_if)
+ << "'enable_if'" << TemplateArgString;
+ return;
+ }
+
// Format the SFINAE diagnostic into the argument string.
// FIXME: Add a general mechanism to include a PartialDiagnostic *'s
// formatted message in another diagnostic.
llvm::SmallString<128> SFINAEArgString;
SourceRange R;
- if (PartialDiagnosticAt *PDiag =
- Cand->DeductionFailure.getSFINAEDiagnostic()) {
+ if (PDiag) {
SFINAEArgString = ": ";
R = SourceRange(PDiag->first, PDiag->first);
PDiag->second.EmitToString(S.getDiagnostics(), SFINAEArgString);
Modified: cfe/branches/tooling/lib/Sema/SemaStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaStmt.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaStmt.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaStmt.cpp Tue May 15 13:51:08 2012
@@ -2033,8 +2033,7 @@
if (AllowNRVO &&
(NRVOCandidate || getCopyElisionCandidate(ResultType, Value, true))) {
ImplicitCastExpr AsRvalue(ImplicitCastExpr::OnStack,
- Value->getType(), CK_LValueToRValue,
- Value, VK_XValue);
+ Value->getType(), CK_NoOp, Value, VK_XValue);
Expr *InitExpr = &AsRvalue;
InitializationKind Kind
@@ -2069,8 +2068,7 @@
// Promote "AsRvalue" to the heap, since we now need this
// expression node to persist.
Value = ImplicitCastExpr::Create(Context, Value->getType(),
- CK_LValueToRValue, Value, 0,
- VK_XValue);
+ CK_NoOp, Value, 0, VK_XValue);
// Complete type-checking the initialization of the return type
// using the constructor we found.
@@ -2677,15 +2675,13 @@
Finally));
}
-StmtResult Sema::BuildObjCAtThrowStmt(SourceLocation AtLoc,
- Expr *Throw) {
+StmtResult Sema::BuildObjCAtThrowStmt(SourceLocation AtLoc, Expr *Throw) {
if (Throw) {
- Throw = MaybeCreateExprWithCleanups(Throw);
ExprResult Result = DefaultLvalueConversion(Throw);
if (Result.isInvalid())
return StmtError();
- Throw = Result.take();
+ Throw = MaybeCreateExprWithCleanups(Result.take());
QualType ThrowType = Throw->getType();
// Make sure the expression type is an ObjC pointer or "void *".
if (!ThrowType->isDependentType() &&
Modified: cfe/branches/tooling/lib/Sema/SemaTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaTemplate.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaTemplate.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaTemplate.cpp Tue May 15 13:51:08 2012
@@ -6923,6 +6923,42 @@
}
+/// Determine whether this failed name lookup should be treated as being
+/// disabled by a usage of std::enable_if.
+static bool isEnableIf(NestedNameSpecifierLoc NNS, const IdentifierInfo &II,
+ SourceRange &CondRange) {
+ // We must be looking for a ::type...
+ if (!II.isStr("type"))
+ return false;
+
+ // ... within an explicitly-written template specialization...
+ if (!NNS || !NNS.getNestedNameSpecifier()->getAsType())
+ return false;
+ TypeLoc EnableIfTy = NNS.getTypeLoc();
+ TemplateSpecializationTypeLoc *EnableIfTSTLoc =
+ dyn_cast<TemplateSpecializationTypeLoc>(&EnableIfTy);
+ if (!EnableIfTSTLoc || EnableIfTSTLoc->getNumArgs() == 0)
+ return false;
+ const TemplateSpecializationType *EnableIfTST =
+ cast<TemplateSpecializationType>(EnableIfTSTLoc->getTypePtr());
+
+ // ... which names a complete class template declaration...
+ const TemplateDecl *EnableIfDecl =
+ EnableIfTST->getTemplateName().getAsTemplateDecl();
+ if (!EnableIfDecl || EnableIfTST->isIncompleteType())
+ return false;
+
+ // ... called "enable_if".
+ const IdentifierInfo *EnableIfII =
+ EnableIfDecl->getDeclName().getAsIdentifierInfo();
+ if (!EnableIfII || !EnableIfII->isStr("enable_if"))
+ return false;
+
+ // Assume the first template argument is the condition.
+ CondRange = EnableIfTSTLoc->getArgLoc(0).getSourceRange();
+ return true;
+}
+
/// \brief Build the type that describes a C++ typename specifier,
/// e.g., "typename T::type".
QualType
@@ -6959,9 +6995,19 @@
unsigned DiagID = 0;
Decl *Referenced = 0;
switch (Result.getResultKind()) {
- case LookupResult::NotFound:
+ case LookupResult::NotFound: {
+ // If we're looking up 'type' within a template named 'enable_if', produce
+ // a more specific diagnostic.
+ SourceRange CondRange;
+ if (isEnableIf(QualifierLoc, II, CondRange)) {
+ Diag(CondRange.getBegin(), diag::err_typename_nested_not_found_enable_if)
+ << Ctx << CondRange;
+ return QualType();
+ }
+
DiagID = diag::err_typename_nested_not_found;
break;
+ }
case LookupResult::FoundUnresolvedValue: {
// We found a using declaration that is a value. Most likely, the using
Modified: cfe/branches/tooling/lib/Sema/SemaTemplateInstantiateDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaTemplateInstantiateDecl.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaTemplateInstantiateDecl.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaTemplateInstantiateDecl.cpp Tue May 15 13:51:08 2012
@@ -102,7 +102,8 @@
} else {
Attr *NewAttr = sema::instantiateTemplateAttribute(TmplAttr, Context,
*this, TemplateArgs);
- New->addAttr(NewAttr);
+ if (NewAttr)
+ New->addAttr(NewAttr);
}
}
}
Modified: cfe/branches/tooling/lib/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/SemaType.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/SemaType.cpp (original)
+++ cfe/branches/tooling/lib/Sema/SemaType.cpp Tue May 15 13:51:08 2012
@@ -2882,6 +2882,10 @@
}
void VisitObjCInterfaceTypeLoc(ObjCInterfaceTypeLoc TL) {
TL.setNameLoc(DS.getTypeSpecTypeLoc());
+ // FIXME. We should have DS.getTypeSpecTypeEndLoc(). But, it requires
+ // addition field. What we have is good enough for dispay of location
+ // of 'fixit' on interface name.
+ TL.setNameEndLoc(DS.getLocEnd());
}
void VisitObjCObjectTypeLoc(ObjCObjectTypeLoc TL) {
// Handle the base type, which might not have been written explicitly.
Modified: cfe/branches/tooling/lib/Sema/TargetAttributesSema.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/TargetAttributesSema.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/TargetAttributesSema.cpp (original)
+++ cfe/branches/tooling/lib/Sema/TargetAttributesSema.cpp Tue May 15 13:51:08 2012
@@ -151,6 +151,18 @@
S.Context));
}
+DLLImportAttr *Sema::mergeDLLImportAttr(Decl *D, SourceRange Range) {
+ if (D->hasAttr<DLLExportAttr>()) {
+ Diag(Range.getBegin(), diag::warn_attribute_ignored) << "dllimport";
+ return NULL;
+ }
+
+ if (D->hasAttr<DLLImportAttr>())
+ return NULL;
+
+ return ::new (Context) DLLImportAttr(Range, Context);
+}
+
static void HandleDLLImportAttr(Decl *D, const AttributeList &Attr, Sema &S) {
// check the attribute arguments.
if (Attr.getNumArgs() != 0) {
@@ -159,13 +171,8 @@
}
// Attribute can be applied only to functions or variables.
- if (isa<VarDecl>(D)) {
- D->addAttr(::new (S.Context) DLLImportAttr(Attr.getLoc(), S.Context));
- return;
- }
-
FunctionDecl *FD = dyn_cast<FunctionDecl>(D);
- if (!FD) {
+ if (!FD && !isa<VarDecl>(D)) {
// Apparently Visual C++ thinks it is okay to not emit a warning
// in this case, so only emit a warning when -fms-extensions is not
// specified.
@@ -177,17 +184,26 @@
// Currently, the dllimport attribute is ignored for inlined functions.
// Warning is emitted.
- if (FD->isInlineSpecified()) {
+ if (FD && FD->isInlineSpecified()) {
S.Diag(Attr.getLoc(), diag::warn_attribute_ignored) << "dllimport";
return;
}
- if (D->getAttr<DLLExportAttr>()) {
- S.Diag(Attr.getLoc(), diag::warn_attribute_ignored) << "dllimport";
- return;
+ DLLImportAttr *NewAttr = S.mergeDLLImportAttr(D, Attr.getRange());
+ if (NewAttr)
+ D->addAttr(NewAttr);
+}
+
+DLLExportAttr *Sema::mergeDLLExportAttr(Decl *D, SourceRange Range) {
+ if (DLLImportAttr *Import = D->getAttr<DLLImportAttr>()) {
+ Diag(Import->getLocation(), diag::warn_attribute_ignored) << "dllimport";
+ D->dropAttr<DLLImportAttr>();
}
- D->addAttr(::new (S.Context) DLLImportAttr(Attr.getLoc(), S.Context));
+ if (D->hasAttr<DLLExportAttr>())
+ return NULL;
+
+ return ::new (Context) DLLExportAttr(Range, Context);
}
static void HandleDLLExportAttr(Decl *D, const AttributeList &Attr, Sema &S) {
@@ -198,13 +214,8 @@
}
// Attribute can be applied only to functions or variables.
- if (isa<VarDecl>(D)) {
- D->addAttr(::new (S.Context) DLLExportAttr(Attr.getLoc(), S.Context));
- return;
- }
-
FunctionDecl *FD = dyn_cast<FunctionDecl>(D);
- if (!FD) {
+ if (!FD && !isa<VarDecl>(D)) {
S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type)
<< Attr.getName() << 2 /*variable and function*/;
return;
@@ -212,18 +223,15 @@
// Currently, the dllexport attribute is ignored for inlined functions, unless
// the -fkeep-inline-functions flag has been used. Warning is emitted;
- if (FD->isInlineSpecified()) {
+ if (FD && FD->isInlineSpecified()) {
// FIXME: ... unless the -fkeep-inline-functions flag has been used.
S.Diag(Attr.getLoc(), diag::warn_attribute_ignored) << "dllexport";
return;
}
- if (DLLImportAttr *Import = D->getAttr<DLLImportAttr>()) {
- S.Diag(Import->getLocation(), diag::warn_attribute_ignored) << "dllimport";
- D->dropAttr<DLLImportAttr>();
- }
-
- D->addAttr(::new (S.Context) DLLExportAttr(Attr.getLoc(), S.Context));
+ DLLExportAttr *NewAttr = S.mergeDLLExportAttr(D, Attr.getRange());
+ if (NewAttr)
+ D->addAttr(NewAttr);
}
namespace {
Modified: cfe/branches/tooling/lib/Sema/TreeTransform.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Sema/TreeTransform.h?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Sema/TreeTransform.h (original)
+++ cfe/branches/tooling/lib/Sema/TreeTransform.h Tue May 15 13:51:08 2012
@@ -9268,7 +9268,11 @@
DeclarationNameInfo NameInfo(Name, Destroyed.getLocation());
NameInfo.setNamedTypeInfo(DestroyedType);
- // FIXME: the ScopeType should be tacked onto SS.
+ // The scope type is now known to be a valid nested name specifier
+ // component. Tack it on to the end of the nested name specifier.
+ if (ScopeType)
+ SS.Extend(SemaRef.Context, SourceLocation(),
+ ScopeType->getTypeLoc(), CCLoc);
SourceLocation TemplateKWLoc; // FIXME: retrieve it from caller.
return getSema().BuildMemberReferenceExpr(Base, BaseType,
Modified: cfe/branches/tooling/lib/Serialization/ASTReaderDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Serialization/ASTReaderDecl.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Serialization/ASTReaderDecl.cpp (original)
+++ cfe/branches/tooling/lib/Serialization/ASTReaderDecl.cpp Tue May 15 13:51:08 2012
@@ -642,6 +642,7 @@
MD->setVariadic(Record[Idx++]);
MD->setSynthesized(Record[Idx++]);
MD->setDefined(Record[Idx++]);
+ MD->IsOverriding = Record[Idx++];
MD->IsRedeclaration = Record[Idx++];
MD->HasRedeclaration = Record[Idx++];
Modified: cfe/branches/tooling/lib/Serialization/ASTWriterDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Serialization/ASTWriterDecl.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Serialization/ASTWriterDecl.cpp (original)
+++ cfe/branches/tooling/lib/Serialization/ASTWriterDecl.cpp Tue May 15 13:51:08 2012
@@ -417,6 +417,7 @@
Record.push_back(D->isVariadic());
Record.push_back(D->isSynthesized());
Record.push_back(D->isDefined());
+ Record.push_back(D->IsOverriding);
Record.push_back(D->IsRedeclaration);
Record.push_back(D->HasRedeclaration);
Modified: cfe/branches/tooling/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Checkers/CStringChecker.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Checkers/CStringChecker.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Checkers/CStringChecker.cpp Tue May 15 13:51:08 2012
@@ -1404,6 +1404,24 @@
// For strncpy, this is just checking that lenVal <= sizeof(dst)
// (Yes, strncpy and strncat differ in how they treat termination.
// strncat ALWAYS terminates, but strncpy doesn't.)
+
+ // We need a special case for when the copy size is zero, in which
+ // case strncpy will do no work at all. Our bounds check uses n-1
+ // as the last element accessed, so n == 0 is problematic.
+ ProgramStateRef StateZeroSize, StateNonZeroSize;
+ llvm::tie(StateZeroSize, StateNonZeroSize) =
+ assumeZero(C, state, *lenValNL, sizeTy);
+
+ // If the size is known to be zero, we're done.
+ if (StateZeroSize && !StateNonZeroSize) {
+ StateZeroSize = StateZeroSize->BindExpr(CE, LCtx, DstVal);
+ C.addTransition(StateZeroSize);
+ return;
+ }
+
+ // Otherwise, go ahead and figure out the last element we'll touch.
+ // We don't record the non-zero assumption here because we can't
+ // be sure. We won't warn on a possible zero.
NonLoc one = cast<NonLoc>(svalBuilder.makeIntVal(1, sizeTy));
maxLastElementIndex = svalBuilder.evalBinOpNN(state, BO_Sub, *lenValNL,
one, sizeTy);
Modified: cfe/branches/tooling/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Checkers/MallocChecker.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Checkers/MallocChecker.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Checkers/MallocChecker.cpp Tue May 15 13:51:08 2012
@@ -210,15 +210,17 @@
// The allocated region symbol tracked by the main analysis.
SymbolRef Sym;
- // The mode we are in, i.e. what kind of diagnostics will be emitted.
- NotificationMode Mode;
+ // The mode we are in, i.e. what kind of diagnostics will be emitted.
+ NotificationMode Mode;
- // A symbol from when the primary region should have been reallocated.
- SymbolRef FailedReallocSymbol;
+ // A symbol from when the primary region should have been reallocated.
+ SymbolRef FailedReallocSymbol;
- public:
- MallocBugVisitor(SymbolRef S)
- : Sym(S), Mode(Normal), FailedReallocSymbol(0) {}
+ bool IsLeak;
+
+ public:
+ MallocBugVisitor(SymbolRef S, bool isLeak = false)
+ : Sym(S), Mode(Normal), FailedReallocSymbol(0), IsLeak(isLeak) {}
virtual ~MallocBugVisitor() {}
@@ -256,6 +258,20 @@
const ExplodedNode *PrevN,
BugReporterContext &BRC,
BugReport &BR);
+
+ PathDiagnosticPiece* getEndPath(BugReporterContext &BRC,
+ const ExplodedNode *EndPathNode,
+ BugReport &BR) {
+ if (!IsLeak)
+ return 0;
+
+ PathDiagnosticLocation L =
+ PathDiagnosticLocation::createEndOfPath(EndPathNode,
+ BRC.getSourceManager());
+ // Do not add the statement itself as a range in case of leak.
+ return new PathDiagnosticEventPiece(L, BR.getDescription(), false);
+ }
+
private:
class StackHintGeneratorForReallocationFailed
: public StackHintGeneratorForSymbol {
@@ -895,7 +911,7 @@
BugReport *R = new BugReport(*BT_Leak, os.str(), N, LocUsedForUniqueing);
R->markInteresting(Sym);
- R->addVisitor(new MallocBugVisitor(Sym));
+ R->addVisitor(new MallocBugVisitor(Sym, true));
C.EmitReport(R);
}
Modified: cfe/branches/tooling/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp Tue May 15 13:51:08 2012
@@ -60,7 +60,8 @@
check::PreStmt<ReturnStmt>,
check::PreStmt<CallExpr>,
check::PostStmt<CallExpr>,
- check::Location > {
+ check::Location,
+ check::Bind > {
public:
void checkPreObjCMessage(ObjCMessage msg, CheckerContext &C) const;
void checkPostObjCMessage(ObjCMessage msg, CheckerContext &C) const;
@@ -70,6 +71,7 @@
void checkPostStmt(const CallExpr *CE, CheckerContext &C) const;
void checkLocation(SVal location, bool isLoad, const Stmt *S,
CheckerContext &C) const;
+ void checkBind(SVal loc, SVal val, const Stmt *S, CheckerContext &C) const;
void checkPreStmt(const CallOrObjCMessage &CE, CheckerContext &C) const;
void checkPostStmt(const CallOrObjCMessage &CE, CheckerContext &C) const;
@@ -336,6 +338,28 @@
addSelfFlag(state, state->getSVal(cast<Loc>(location)), SelfFlag_Self, C);
}
+
+void ObjCSelfInitChecker::checkBind(SVal loc, SVal val, const Stmt *S,
+ CheckerContext &C) const {
+ // Allow assignment of anything to self. Self is a local variable in the
+ // initializer, so it is legal to assign anything to it, like results of
+ // static functions/method calls. After self is assigned something we cannot
+ // reason about, stop enforcing the rules.
+ // (Only continue checking if the assigned value should be treated as self.)
+ if ((isSelfVar(loc, C)) &&
+ !hasSelfFlag(val, SelfFlag_InitRes, C) &&
+ !hasSelfFlag(val, SelfFlag_Self, C) &&
+ !isSelfVar(val, C)) {
+
+ // Stop tracking the checker-specific state in the state.
+ ProgramStateRef State = C.getState();
+ State = State->remove<CalledInit>();
+ if (SymbolRef sym = loc.getAsSymbol())
+ State = State->remove<SelfFlag>(sym);
+ C.addTransition(State);
+ }
+}
+
// FIXME: A callback should disable checkers at the start of functions.
static bool shouldRunOnFunctionOrMethod(const NamedDecl *ND) {
if (!ND)
Modified: cfe/branches/tooling/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp Tue May 15 13:51:08 2012
@@ -1867,6 +1867,15 @@
return false;
}
+static bool isNumericLiteralExpression(const Expr *E) {
+ // FIXME: This set of cases was copied from SemaExprObjC.
+ return isa<IntegerLiteral>(E) ||
+ isa<CharacterLiteral>(E) ||
+ isa<FloatingLiteral>(E) ||
+ isa<ObjCBoolLiteralExpr>(E) ||
+ isa<CXXBoolLiteralExpr>(E);
+}
+
static bool isPropertyAccess(const Stmt *S, ParentMap &PM) {
unsigned maxDepth = 4;
while (S && maxDepth) {
@@ -1916,6 +1925,24 @@
else if (isa<ObjCDictionaryLiteral>(S)) {
os << "NSDictionary literal is an object with a +0 retain count";
}
+ else if (const ObjCBoxedExpr *BL = dyn_cast<ObjCBoxedExpr>(S)) {
+ if (isNumericLiteralExpression(BL->getSubExpr()))
+ os << "NSNumber literal is an object with a +0 retain count";
+ else {
+ const ObjCInterfaceDecl *BoxClass = 0;
+ if (const ObjCMethodDecl *Method = BL->getBoxingMethod())
+ BoxClass = Method->getClassInterface();
+
+ // We should always be able to find the boxing class interface,
+ // but consider this future-proofing.
+ if (BoxClass)
+ os << *BoxClass << " b";
+ else
+ os << "B";
+
+ os << "oxed expression produces an object with a +0 retain count";
+ }
+ }
else {
if (const CallExpr *CE = dyn_cast<CallExpr>(S)) {
// Get the name of the callee (if it is available).
@@ -2324,6 +2351,7 @@
check::PostStmt<CXXConstructExpr>,
check::PostStmt<ObjCArrayLiteral>,
check::PostStmt<ObjCDictionaryLiteral>,
+ check::PostStmt<ObjCBoxedExpr>,
check::PostObjCMessage,
check::PreStmt<ReturnStmt>,
check::RegionChanges,
@@ -2470,6 +2498,8 @@
void checkPostStmt(const CXXConstructExpr *CE, CheckerContext &C) const;
void checkPostStmt(const ObjCArrayLiteral *AL, CheckerContext &C) const;
void checkPostStmt(const ObjCDictionaryLiteral *DL, CheckerContext &C) const;
+ void checkPostStmt(const ObjCBoxedExpr *BE, CheckerContext &C) const;
+
void checkPostObjCMessage(const ObjCMessage &Msg, CheckerContext &C) const;
void checkSummary(const RetainSummary &Summ, const CallOrObjCMessage &Call,
@@ -2721,6 +2751,21 @@
processObjCLiterals(C, DL);
}
+void RetainCountChecker::checkPostStmt(const ObjCBoxedExpr *Ex,
+ CheckerContext &C) const {
+ const ExplodedNode *Pred = C.getPredecessor();
+ const LocationContext *LCtx = Pred->getLocationContext();
+ ProgramStateRef State = Pred->getState();
+
+ if (SymbolRef Sym = State->getSVal(Ex, LCtx).getAsSymbol()) {
+ QualType ResultTy = Ex->getType();
+ State = State->set<RefBindings>(Sym, RefVal::makeNotOwned(RetEffect::ObjC,
+ ResultTy));
+ }
+
+ C.addTransition(State);
+}
+
void RetainCountChecker::checkPostObjCMessage(const ObjCMessage &Msg,
CheckerContext &C) const {
ProgramStateRef state = C.getState();
Modified: cfe/branches/tooling/lib/StaticAnalyzer/Core/ExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Core/ExprEngine.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Core/ExprEngine.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Core/ExprEngine.cpp Tue May 15 13:51:08 2012
@@ -588,7 +588,6 @@
case Stmt::ObjCIsaExprClass:
case Stmt::ObjCProtocolExprClass:
case Stmt::ObjCSelectorExprClass:
- case Expr::ObjCBoxedExprClass:
case Stmt::ParenListExprClass:
case Stmt::PredefinedExprClass:
case Stmt::ShuffleVectorExprClass:
@@ -628,22 +627,24 @@
}
case Expr::ObjCArrayLiteralClass:
- case Expr::ObjCDictionaryLiteralClass: {
+ case Expr::ObjCDictionaryLiteralClass:
+ // FIXME: explicitly model with a region and the actual contents
+ // of the container. For now, conjure a symbol.
+ case Expr::ObjCBoxedExprClass: {
Bldr.takeNodes(Pred);
ExplodedNodeSet preVisit;
getCheckerManager().runCheckersForPreStmt(preVisit, Pred, S, *this);
- // FIXME: explicitly model with a region and the actual contents
- // of the container. For now, conjure a symbol.
ExplodedNodeSet Tmp;
StmtNodeBuilder Bldr2(preVisit, Tmp, *currentBuilderContext);
+ const Expr *Ex = cast<Expr>(S);
+ QualType resultType = Ex->getType();
+
for (ExplodedNodeSet::iterator it = preVisit.begin(), et = preVisit.end();
it != et; ++it) {
ExplodedNode *N = *it;
- const Expr *Ex = cast<Expr>(S);
- QualType resultType = Ex->getType();
const LocationContext *LCtx = N->getLocationContext();
SVal result =
svalBuilder.getConjuredSymbolVal(0, Ex, LCtx, resultType,
Modified: cfe/branches/tooling/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp Tue May 15 13:51:08 2012
@@ -441,9 +441,10 @@
FullSourceLoc L = MP->getLocation().asLocation().getExpansionLoc();
assert(L.isFileID());
StringRef BufferInfo = L.getBufferData();
- const char* MacroName = L.getDecomposedLoc().second + BufferInfo.data();
- Lexer rawLexer(L, PP.getLangOpts(), BufferInfo.begin(),
- MacroName, BufferInfo.end());
+ std::pair<FileID, unsigned> LocInfo = L.getDecomposedLoc();
+ const char* MacroName = LocInfo.second + BufferInfo.data();
+ Lexer rawLexer(SM.getLocForStartOfFile(LocInfo.first), PP.getLangOpts(),
+ BufferInfo.begin(), MacroName, BufferInfo.end());
Token TheTok;
rawLexer.LexFromRawLexer(TheTok);
Modified: cfe/branches/tooling/lib/StaticAnalyzer/Core/ObjCMessage.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Core/ObjCMessage.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Core/ObjCMessage.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Core/ObjCMessage.cpp Tue May 15 13:51:08 2012
@@ -94,7 +94,9 @@
return false;
// If a parameter is a block or a callback, assume it can modify pointer.
- if (T->isBlockPointerType() || T->isFunctionPointerType())
+ if (T->isBlockPointerType() ||
+ T->isFunctionPointerType() ||
+ T->isObjCSelType())
return true;
// Check if a callback is passed inside a struct (for both, struct passed by
Modified: cfe/branches/tooling/lib/StaticAnalyzer/Core/RegionStore.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Core/RegionStore.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Core/RegionStore.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Core/RegionStore.cpp Tue May 15 13:51:08 2012
@@ -81,14 +81,9 @@
} // end anonymous namespace
BindingKey BindingKey::Make(const MemRegion *R, Kind k) {
- if (const ElementRegion *ER = dyn_cast<ElementRegion>(R)) {
- const RegionRawOffset &O = ER->getAsArrayOffset();
-
- // FIXME: There are some ElementRegions for which we cannot compute
- // raw offsets yet, including regions with symbolic offsets. These will be
- // ignored by the store.
- return BindingKey(O.getRegion(), O.getOffset().getQuantity(), k);
- }
+ const RegionOffset &RO = R->getAsOffset();
+ if (RO.getRegion())
+ return BindingKey(RO.getRegion(), RO.getOffset(), k);
return BindingKey(R, 0, k);
}
@@ -307,6 +302,9 @@
/// BindStruct - Bind a compound value to a structure.
StoreRef BindStruct(Store store, const TypedValueRegion* R, SVal V);
+ /// BindVector - Bind a compound value to a vector.
+ StoreRef BindVector(Store store, const TypedValueRegion* R, SVal V);
+
StoreRef BindArray(Store store, const TypedValueRegion* R, SVal V);
/// KillStruct - Set the entire struct to unknown.
@@ -377,7 +375,8 @@
/// Get the state and region whose binding this region R corresponds to.
std::pair<Store, const MemRegion*>
GetLazyBinding(RegionBindings B, const MemRegion *R,
- const MemRegion *originalRegion);
+ const MemRegion *originalRegion,
+ bool includeSuffix = false);
StoreRef CopyLazyBindings(nonloc::LazyCompoundVal V, Store store,
const TypedRegion *R);
@@ -648,7 +647,7 @@
for (RegionBindings::iterator RI = B.begin(), RE = B.end(); RI != RE; ++RI){
const SubRegion *baseR = dyn_cast<SubRegion>(RI.getKey().getRegion());
- if (baseR && baseR->isSubRegionOf(LazyR))
+ if (baseR && (baseR == LazyR || baseR->isSubRegionOf(LazyR)))
VisitBinding(RI.getData());
}
@@ -1113,7 +1112,8 @@
std::pair<Store, const MemRegion *>
RegionStoreManager::GetLazyBinding(RegionBindings B, const MemRegion *R,
- const MemRegion *originalRegion) {
+ const MemRegion *originalRegion,
+ bool includeSuffix) {
if (originalRegion != R) {
if (Optional<SVal> OV = getDefaultBinding(B, R)) {
@@ -1135,9 +1135,13 @@
const std::pair<Store, const MemRegion *> &X =
GetLazyBinding(B, FR->getSuperRegion(), originalRegion);
- if (X.second)
- return std::make_pair(X.first,
- MRMgr.getFieldRegionWithSuper(FR, X.second));
+ if (X.second) {
+ if (includeSuffix)
+ return std::make_pair(X.first,
+ MRMgr.getFieldRegionWithSuper(FR, X.second));
+ return X;
+ }
+
}
// C++ base object region is another kind of region that we should blast
// through to look for lazy compound value. It is like a field region.
@@ -1146,9 +1150,13 @@
const std::pair<Store, const MemRegion *> &X =
GetLazyBinding(B, baseReg->getSuperRegion(), originalRegion);
- if (X.second)
- return std::make_pair(X.first,
- MRMgr.getCXXBaseObjectRegionWithSuper(baseReg, X.second));
+ if (X.second) {
+ if (includeSuffix)
+ return std::make_pair(X.first,
+ MRMgr.getCXXBaseObjectRegionWithSuper(baseReg,
+ X.second));
+ return X;
+ }
}
// The NULL MemRegion indicates an non-existent lazy binding. A NULL Store is
@@ -1157,7 +1165,11 @@
}
SVal RegionStoreManager::getBindingForElement(Store store,
- const ElementRegion* R) {
+ const ElementRegion* R) {
+ // We do not currently model bindings of the CompoundLiteralregion.
+ if (isa<CompoundLiteralRegion>(R->getBaseRegion()))
+ return UnknownVal();
+
// Check if the region has a binding.
RegionBindings B = GetRegionBindings(store);
if (const Optional<SVal> &V = getDirectBinding(B, R))
@@ -1292,7 +1304,8 @@
// Lazy binding?
Store lazyBindingStore = NULL;
const MemRegion *lazyBindingRegion = NULL;
- llvm::tie(lazyBindingStore, lazyBindingRegion) = GetLazyBinding(B, R, R);
+ llvm::tie(lazyBindingStore, lazyBindingRegion) = GetLazyBinding(B, R, R,
+ true);
if (lazyBindingRegion)
return getLazyBinding(lazyBindingRegion, lazyBindingStore);
@@ -1427,12 +1440,30 @@
SVal RegionStoreManager::getBindingForStruct(Store store,
const TypedValueRegion* R) {
assert(R->getValueType()->isStructureOrClassType());
+
+ // If we already have a lazy binding, don't create a new one.
+ RegionBindings B = GetRegionBindings(store);
+ BindingKey K = BindingKey::Make(R, BindingKey::Default);
+ if (const nonloc::LazyCompoundVal *V =
+ dyn_cast_or_null<nonloc::LazyCompoundVal>(lookup(B, K))) {
+ return *V;
+ }
+
return svalBuilder.makeLazyCompoundVal(StoreRef(store, *this), R);
}
-SVal RegionStoreManager::getBindingForArray(Store store,
+SVal RegionStoreManager::getBindingForArray(Store store,
const TypedValueRegion * R) {
assert(Ctx.getAsConstantArrayType(R->getValueType()));
+
+ // If we already have a lazy binding, don't create a new one.
+ RegionBindings B = GetRegionBindings(store);
+ BindingKey K = BindingKey::Make(R, BindingKey::Default);
+ if (const nonloc::LazyCompoundVal *V =
+ dyn_cast_or_null<nonloc::LazyCompoundVal>(lookup(B, K))) {
+ return *V;
+ }
+
return svalBuilder.makeLazyCompoundVal(StoreRef(store, *this), R);
}
@@ -1475,9 +1506,13 @@
const MemRegion *R = cast<loc::MemRegionVal>(L).getRegion();
// Check if the region is a struct region.
- if (const TypedValueRegion* TR = dyn_cast<TypedValueRegion>(R))
- if (TR->getValueType()->isStructureOrClassType())
+ if (const TypedValueRegion* TR = dyn_cast<TypedValueRegion>(R)) {
+ QualType Ty = TR->getValueType();
+ if (Ty->isStructureOrClassType())
return BindStruct(store, TR, V);
+ if (Ty->isVectorType())
+ return BindVector(store, TR, V);
+ }
if (const ElementRegion *ER = dyn_cast<ElementRegion>(R)) {
if (ER->getIndex().isZeroConstant()) {
@@ -1621,6 +1656,47 @@
return newStore;
}
+StoreRef RegionStoreManager::BindVector(Store store, const TypedValueRegion* R,
+ SVal V) {
+ QualType T = R->getValueType();
+ assert(T->isVectorType());
+ const VectorType *VT = T->getAs<VectorType>(); // Use getAs for typedefs.
+
+ // Handle lazy compound values.
+ if (nonloc::LazyCompoundVal *LCV = dyn_cast<nonloc::LazyCompoundVal>(&V))
+ return CopyLazyBindings(*LCV, store, R);
+
+ // We may get non-CompoundVal accidentally due to imprecise cast logic or
+ // that we are binding symbolic struct value. Kill the field values, and if
+ // the value is symbolic go and bind it as a "default" binding.
+ if (V.isUnknown() || !isa<nonloc::CompoundVal>(V)) {
+ SVal SV = isa<nonloc::SymbolVal>(V) ? V : UnknownVal();
+ return KillStruct(store, R, SV);
+ }
+
+ QualType ElemType = VT->getElementType();
+ nonloc::CompoundVal& CV = cast<nonloc::CompoundVal>(V);
+ nonloc::CompoundVal::iterator VI = CV.begin(), VE = CV.end();
+ unsigned index = 0, numElements = VT->getNumElements();
+ StoreRef newStore(store, *this);
+
+ for ( ; index != numElements ; ++index) {
+ if (VI == VE)
+ break;
+
+ NonLoc Idx = svalBuilder.makeArrayIndex(index);
+ const ElementRegion *ER = MRMgr.getElementRegion(ElemType, Idx, R, Ctx);
+
+ if (ElemType->isArrayType())
+ newStore = BindArray(newStore.getStore(), ER, *VI);
+ else if (ElemType->isStructureOrClassType())
+ newStore = BindStruct(newStore.getStore(), ER, *VI);
+ else
+ newStore = Bind(newStore.getStore(), svalBuilder.makeLoc(ER), *VI);
+ }
+ return newStore;
+}
+
StoreRef RegionStoreManager::BindStruct(Store store, const TypedValueRegion* R,
SVal V) {
@@ -2016,7 +2092,9 @@
void RegionStoreManager::print(Store store, raw_ostream &OS,
const char* nl, const char *sep) {
RegionBindings B = GetRegionBindings(store);
- OS << "Store (direct and default bindings):" << nl;
+ OS << "Store (direct and default bindings), "
+ << (void*) B.getRootWithoutRetain()
+ << " :" << nl;
for (RegionBindings::iterator I = B.begin(), E = B.end(); I != E; ++I)
OS << ' ' << I.getKey() << " : " << I.getData() << nl;
Modified: cfe/branches/tooling/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp Tue May 15 13:51:08 2012
@@ -137,6 +137,11 @@
SymbolRef Sym, bool Assumption) {
BasicValueFactory &BVF = getBasicVals();
QualType T = Sym->getType(BVF.getContext());
+
+ // None of the constraint solvers currently support non-integer types.
+ if (!T->isIntegerType())
+ return State;
+
const llvm::APSInt &zero = BVF.getValue(0, T);
if (Assumption)
return assumeSymNE(State, Sym, zero, zero);
Modified: cfe/branches/tooling/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp (original)
+++ cfe/branches/tooling/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp Tue May 15 13:51:08 2012
@@ -246,6 +246,7 @@
SetOfConstDecls *VisitedCallees);
/// Visitors for the RecursiveASTVisitor.
+ bool shouldWalkTypesOfTypeLocs() const { return false; }
/// Handle callbacks for arbitrary Decls.
bool VisitDecl(Decl *D) {
Modified: cfe/branches/tooling/lib/Tooling/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Tooling/CMakeLists.txt?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Tooling/CMakeLists.txt (original)
+++ cfe/branches/tooling/lib/Tooling/CMakeLists.txt Tue May 15 13:51:08 2012
@@ -6,4 +6,5 @@
CompilationDatabase.cpp
Refactoring.cpp
Tooling.cpp
+ ArgumentsAdjusters.cpp
)
Modified: cfe/branches/tooling/lib/Tooling/CompilationDatabase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Tooling/CompilationDatabase.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Tooling/CompilationDatabase.cpp (original)
+++ cfe/branches/tooling/lib/Tooling/CompilationDatabase.cpp Tue May 15 13:51:08 2012
@@ -222,10 +222,9 @@
ErrorMessage = "Expected object.";
return false;
}
- llvm::yaml::ScalarNode *Directory;
- llvm::yaml::ScalarNode *Command;
- llvm::SmallString<8> FileStorage;
- llvm::StringRef File;
+ llvm::yaml::ScalarNode *Directory = NULL;
+ llvm::yaml::ScalarNode *Command = NULL;
+ llvm::yaml::ScalarNode *File = NULL;
for (llvm::yaml::MappingNode::iterator KVI = Object->begin(),
KVE = Object->end();
KVI != KVE; ++KVI) {
@@ -242,20 +241,37 @@
}
llvm::yaml::ScalarNode *KeyString =
llvm::dyn_cast<llvm::yaml::ScalarNode>((*KVI).getKey());
+ if (KeyString == NULL) {
+ ErrorMessage = "Expected strings as key.";
+ return false;
+ }
llvm::SmallString<8> KeyStorage;
if (KeyString->getValue(KeyStorage) == "directory") {
Directory = ValueString;
} else if (KeyString->getValue(KeyStorage) == "command") {
Command = ValueString;
} else if (KeyString->getValue(KeyStorage) == "file") {
- File = ValueString->getValue(FileStorage);
+ File = ValueString;
} else {
ErrorMessage = ("Unknown key: \"" +
KeyString->getRawValue() + "\"").str();
return false;
}
}
- IndexByFile[File].push_back(
+ if (!File) {
+ ErrorMessage = "Missing key: \"file\".";
+ return false;
+ }
+ if (!Command) {
+ ErrorMessage = "Missing key: \"command\".";
+ return false;
+ }
+ if (!Directory) {
+ ErrorMessage = "Missing key: \"directory\".";
+ return false;
+ }
+ llvm::SmallString<8> FileStorage;
+ IndexByFile[File->getValue(FileStorage)].push_back(
CompileCommandRef(Directory, Command));
}
return true;
Modified: cfe/branches/tooling/lib/Tooling/Tooling.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/lib/Tooling/Tooling.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/lib/Tooling/Tooling.cpp (original)
+++ cfe/branches/tooling/lib/Tooling/Tooling.cpp Tue May 15 13:51:08 2012
@@ -12,6 +12,7 @@
//
//===----------------------------------------------------------------------===//
+#include "clang/Tooling/ArgumentsAdjusters.h"
#include "clang/Tooling/Tooling.h"
#include "clang/Tooling/CompilationDatabase.h"
#include "clang/Driver/Compilation.h"
@@ -253,7 +254,8 @@
ClangTool::ClangTool(const CompilationDatabase &Compilations,
ArrayRef<std::string> SourcePaths)
- : Files((FileSystemOptions())) {
+ : Files((FileSystemOptions())),
+ ArgsAdjuster(new ClangSyntaxOnlyAdjuster()) {
llvm::SmallString<1024> BaseDirectory;
if (const char *PWD = ::getenv("PWD"))
BaseDirectory = PWD;
@@ -285,6 +287,10 @@
MappedFileContents.push_back(std::make_pair(FilePath, Content));
}
+void ClangTool::setArgumentsAdjuster(ArgumentsAdjuster *Adjuster) {
+ ArgsAdjuster.reset(Adjuster);
+}
+
int ClangTool::run(FrontendActionFactory *ActionFactory) {
bool ProcessingFailed = false;
for (unsigned I = 0; I < CompileCommands.size(); ++I) {
@@ -299,8 +305,8 @@
if (chdir(CompileCommands[I].second.Directory.c_str()))
llvm::report_fatal_error("Cannot chdir into \"" +
CompileCommands[I].second.Directory + "\n!");
- std::vector<std::string> &CommandLine =
- CompileCommands[I].second.CommandLine;
+ std::vector<std::string> CommandLine =
+ ArgsAdjuster->Adjust(CompileCommands[I].second.CommandLine);
llvm::outs() << "Processing: " << File << ".\n";
ToolInvocation Invocation(CommandLine, ActionFactory->create(), &Files);
for (int I = 0, E = MappedFileContents.size(); I != E; ++I) {
Modified: cfe/branches/tooling/test/ARCMT/objcmt-numeric-literals.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/objcmt-numeric-literals.m?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/objcmt-numeric-literals.m (original)
+++ cfe/branches/tooling/test/ARCMT/objcmt-numeric-literals.m Tue May 15 13:51:08 2012
@@ -1,6 +1,7 @@
// RUN: rm -rf %t
// RUN: %clang_cc1 -objcmt-migrate-literals -objcmt-migrate-subscripting -mt-migrate-directory %t %s -x objective-c++
// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c++ %s.result
#define YES __objc_yes
#define NO __objc_no
Modified: cfe/branches/tooling/test/ARCMT/objcmt-numeric-literals.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/objcmt-numeric-literals.m.result?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/objcmt-numeric-literals.m.result (original)
+++ cfe/branches/tooling/test/ARCMT/objcmt-numeric-literals.m.result Tue May 15 13:51:08 2012
@@ -1,6 +1,7 @@
// RUN: rm -rf %t
// RUN: %clang_cc1 -objcmt-migrate-literals -objcmt-migrate-subscripting -mt-migrate-directory %t %s -x objective-c++
// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c++ %s.result
#define YES __objc_yes
#define NO __objc_no
Modified: cfe/branches/tooling/test/ARCMT/objcmt-subscripting-literals.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/objcmt-subscripting-literals.m?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/objcmt-subscripting-literals.m (original)
+++ cfe/branches/tooling/test/ARCMT/objcmt-subscripting-literals.m Tue May 15 13:51:08 2012
@@ -1,10 +1,13 @@
// RUN: rm -rf %t
// RUN: %clang_cc1 -objcmt-migrate-literals -objcmt-migrate-subscripting -mt-migrate-directory %t %s -x objective-c -triple x86_64-apple-darwin11
// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s.result
typedef signed char BOOL;
#define nil ((void*) 0)
+typedef const struct __CFString * CFStringRef;
+
@interface NSObject
+ (id)alloc;
@end
@@ -133,5 +136,21 @@
[mdict setObject:[dict objectForKey:@"key1"] forKey:[dict objectForKey:[NSArray arrayWithObject:@"arrkey"]]];
__strong NSArray **parr = 0;
o = [*parr objectAtIndex:2];
+ void *hd;
+ o = [(NSArray*)hd objectAtIndex:2];
}
@end
+
+extern const CFStringRef globStr;
+
+void test1(NSString *str) {
+ NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: str, globStr, nil];
+ dict = [NSDictionary dictionaryWithObjectsAndKeys: globStr, str, nil];
+ dict = [NSDictionary dictionaryWithObject:str forKey:globStr];
+ dict = [NSDictionary dictionaryWithObject:globStr forKey:str];
+
+ NSArray *arr = [NSArray arrayWithObjects: globStr, globStr, nil];
+ arr = [NSArray arrayWithObjects: str, globStr, nil];
+ arr = [NSArray arrayWithObjects: globStr, str, nil];
+ arr = [NSArray arrayWithObject:globStr];
+}
Modified: cfe/branches/tooling/test/ARCMT/objcmt-subscripting-literals.m.result
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/ARCMT/objcmt-subscripting-literals.m.result?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/ARCMT/objcmt-subscripting-literals.m.result (original)
+++ cfe/branches/tooling/test/ARCMT/objcmt-subscripting-literals.m.result Tue May 15 13:51:08 2012
@@ -1,10 +1,13 @@
// RUN: rm -rf %t
// RUN: %clang_cc1 -objcmt-migrate-literals -objcmt-migrate-subscripting -mt-migrate-directory %t %s -x objective-c -triple x86_64-apple-darwin11
// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c %s.result
typedef signed char BOOL;
#define nil ((void*) 0)
+typedef const struct __CFString * CFStringRef;
+
@interface NSObject
+ (id)alloc;
@end
@@ -133,5 +136,21 @@
mdict[dict[@[@"arrkey"]]] = dict[@"key1"];
__strong NSArray **parr = 0;
o = (*parr)[2];
+ void *hd;
+ o = ((NSArray*)hd)[2];
}
@end
+
+extern const CFStringRef globStr;
+
+void test1(NSString *str) {
+ NSDictionary *dict = @{(id)globStr: str};
+ dict = @{str: (id)globStr};
+ dict = @{(id)globStr: str};
+ dict = @{str: (id)globStr};
+
+ NSArray *arr = @[(id)globStr, (id)globStr];
+ arr = @[str, (id)globStr];
+ arr = @[(id)globStr, str];
+ arr = @[(id)globStr];
+}
Modified: cfe/branches/tooling/test/Analysis/array-struct-region.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/array-struct-region.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/array-struct-region.c (original)
+++ cfe/branches/tooling/test/Analysis/array-struct-region.c Tue May 15 13:51:08 2012
@@ -25,8 +25,8 @@
}
void nested_compound_literals(int rad) {
- int vec[6][2] = {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, // expected-warning 6 {{implicit conversion turns literal floating-point number into integer}}
- {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}}; // expected-warning 6 {{implicit conversion turns literal floating-point number into integer}}
+ int vec[6][2] = {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, // expected-warning 6 {{implicit conversion from 'double' to 'int' changes value from}}
+ {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}}; // expected-warning 6 {{implicit conversion from 'double' to 'int' changes value from}}
int a;
for (a = 0; a < 6; ++a) {
@@ -45,3 +45,16 @@
vec[a][1] *= rad; // no-warning
}
}
+
+
+void struct_as_array() {
+ struct simple { int x; };
+ struct simple a;
+ struct simple *p = &a;
+ p->x = 5;
+ if (!p[0].x)
+ return; // expected-warning{{never executed}}
+ if (p[0].x)
+ return; // no-warning
+}
+
Modified: cfe/branches/tooling/test/Analysis/casts.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/casts.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/casts.c (original)
+++ cfe/branches/tooling/test/Analysis/casts.c Tue May 15 13:51:08 2012
@@ -65,3 +65,11 @@
foo = ((long)(p));
(void) foo;
}
+
+// PR12511 and radar://11215362 - Test that we support SymCastExpr, which represents symbolic int to float cast.
+char ttt(int intSeconds) {
+ double seconds = intSeconds;
+ if (seconds)
+ return 0;
+ return 0;
+}
Modified: cfe/branches/tooling/test/Analysis/malloc-plist.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/malloc-plist.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/malloc-plist.c (original)
+++ cfe/branches/tooling/test/Analysis/malloc-plist.c Tue May 15 13:51:08 2012
@@ -350,21 +350,6 @@
//CHECK: <key>col</key><integer>5</integer>
//CHECK: <key>file</key><integer>0</integer>
//CHECK: </dict>
-//CHECK: <key>ranges</key>
-//CHECK: <array>
-//CHECK: <array>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>14</integer>
-//CHECK: <key>col</key><integer>5</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>14</integer>
-//CHECK: <key>col</key><integer>6</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: </array>
-//CHECK: </array>
//CHECK: <key>depth</key><integer>0</integer>
//CHECK: <key>extended_message</key>
//CHECK: <string>Memory is never released; potential leak of memory pointed to by 'p'</string>
@@ -910,21 +895,6 @@
//CHECK: <key>col</key><integer>9</integer>
//CHECK: <key>file</key><integer>0</integer>
//CHECK: </dict>
-//CHECK: <key>ranges</key>
-//CHECK: <array>
-//CHECK: <array>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>28</integer>
-//CHECK: <key>col</key><integer>9</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>28</integer>
-//CHECK: <key>col</key><integer>14</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: </array>
-//CHECK: </array>
//CHECK: <key>depth</key><integer>0</integer>
//CHECK: <key>extended_message</key>
//CHECK: <string>Memory is never released; potential leak of memory pointed to by 'buf'</string>
@@ -2400,21 +2370,6 @@
//CHECK: <key>col</key><integer>5</integer>
//CHECK: <key>file</key><integer>0</integer>
//CHECK: </dict>
-//CHECK: <key>ranges</key>
-//CHECK: <array>
-//CHECK: <array>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>76</integer>
-//CHECK: <key>col</key><integer>5</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>76</integer>
-//CHECK: <key>col</key><integer>13</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: </array>
-//CHECK: </array>
//CHECK: <key>depth</key><integer>0</integer>
//CHECK: <key>extended_message</key>
//CHECK: <string>Memory is never released; potential leak of memory pointed to by 'buf'</string>
@@ -2843,21 +2798,6 @@
//CHECK: <key>col</key><integer>5</integer>
//CHECK: <key>file</key><integer>0</integer>
//CHECK: </dict>
-//CHECK: <key>ranges</key>
-//CHECK: <array>
-//CHECK: <array>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>97</integer>
-//CHECK: <key>col</key><integer>5</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>97</integer>
-//CHECK: <key>col</key><integer>8</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: </array>
-//CHECK: </array>
//CHECK: <key>depth</key><integer>0</integer>
//CHECK: <key>extended_message</key>
//CHECK: <string>Memory is never released; potential leak of memory pointed to by 'm'</string>
@@ -3062,21 +3002,6 @@
//CHECK: <key>col</key><integer>5</integer>
//CHECK: <key>file</key><integer>0</integer>
//CHECK: </dict>
-//CHECK: <key>ranges</key>
-//CHECK: <array>
-//CHECK: <array>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>102</integer>
-//CHECK: <key>col</key><integer>5</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>102</integer>
-//CHECK: <key>col</key><integer>11</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: </array>
-//CHECK: </array>
//CHECK: <key>depth</key><integer>1</integer>
//CHECK: <key>extended_message</key>
//CHECK: <string>Memory is never released; potential leak of memory pointed to by 'x'</string>
@@ -3281,21 +3206,6 @@
//CHECK: <key>col</key><integer>5</integer>
//CHECK: <key>file</key><integer>0</integer>
//CHECK: </dict>
-//CHECK: <key>ranges</key>
-//CHECK: <array>
-//CHECK: <array>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>111</integer>
-//CHECK: <key>col</key><integer>5</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>111</integer>
-//CHECK: <key>col</key><integer>9</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: </array>
-//CHECK: </array>
//CHECK: <key>depth</key><integer>1</integer>
//CHECK: <key>extended_message</key>
//CHECK: <string>Memory is never released; potential leak of memory pointed to by 'x'</string>
@@ -3568,21 +3478,6 @@
//CHECK: <key>col</key><integer>9</integer>
//CHECK: <key>file</key><integer>0</integer>
//CHECK: </dict>
-//CHECK: <key>ranges</key>
-//CHECK: <array>
-//CHECK: <array>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>120</integer>
-//CHECK: <key>col</key><integer>9</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>120</integer>
-//CHECK: <key>col</key><integer>9</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: </array>
-//CHECK: </array>
//CHECK: <key>depth</key><integer>1</integer>
//CHECK: <key>extended_message</key>
//CHECK: <string>Memory is never released; potential leak of memory pointed to by 'x'</string>
@@ -3855,21 +3750,6 @@
//CHECK: <key>col</key><integer>9</integer>
//CHECK: <key>file</key><integer>0</integer>
//CHECK: </dict>
-//CHECK: <key>ranges</key>
-//CHECK: <array>
-//CHECK: <array>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>131</integer>
-//CHECK: <key>col</key><integer>9</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>131</integer>
-//CHECK: <key>col</key><integer>9</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: </array>
-//CHECK: </array>
//CHECK: <key>depth</key><integer>1</integer>
//CHECK: <key>extended_message</key>
//CHECK: <string>Memory is never released; potential leak of memory pointed to by 'x'</string>
@@ -4074,21 +3954,6 @@
//CHECK: <key>col</key><integer>12</integer>
//CHECK: <key>file</key><integer>0</integer>
//CHECK: </dict>
-//CHECK: <key>ranges</key>
-//CHECK: <array>
-//CHECK: <array>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>142</integer>
-//CHECK: <key>col</key><integer>12</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>142</integer>
-//CHECK: <key>col</key><integer>29</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: </array>
-//CHECK: </array>
//CHECK: <key>depth</key><integer>1</integer>
//CHECK: <key>extended_message</key>
//CHECK: <string>Memory is never released; potential leak of memory pointed to by 'x'</string>
@@ -4293,21 +4158,6 @@
//CHECK: <key>col</key><integer>5</integer>
//CHECK: <key>file</key><integer>0</integer>
//CHECK: </dict>
-//CHECK: <key>ranges</key>
-//CHECK: <array>
-//CHECK: <array>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>153</integer>
-//CHECK: <key>col</key><integer>5</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: <dict>
-//CHECK: <key>line</key><integer>153</integer>
-//CHECK: <key>col</key><integer>23</integer>
-//CHECK: <key>file</key><integer>0</integer>
-//CHECK: </dict>
-//CHECK: </array>
-//CHECK: </array>
//CHECK: <key>depth</key><integer>1</integer>
//CHECK: <key>extended_message</key>
//CHECK: <string>Memory is never released; potential leak of memory pointed to by 'x'</string>
Modified: cfe/branches/tooling/test/Analysis/outofbound.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/outofbound.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/outofbound.c (original)
+++ cfe/branches/tooling/test/Analysis/outofbound.c Tue May 15 13:51:08 2012
@@ -86,3 +86,39 @@
}
return 0;
}
+
+int overflow_binary_search(double in) {
+ int eee = 16;
+ if (in < 1e-8 || in > 1e23) {
+ return 0;
+ } else {
+ static const double ins[] = {1e-8, 1e-7, 1e-6, 1e-5, 1e-4, 1e-3, 1e-2, 1e-1,
+ 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7,
+ 1e8, 1e9, 1e10, 1e11, 1e12, 1e13, 1e14, 1e15,
+ 1e16, 1e17, 1e18, 1e19, 1e20, 1e21, 1e22};
+ if (in < ins[eee]) {
+ eee -= 8;
+ } else {
+ eee += 8;
+ }
+ if (in < ins[eee]) {
+ eee -= 4;
+ } else {
+ eee += 4;
+ }
+ if (in < ins[eee]) {
+ eee -= 2;
+ } else {
+ eee += 2;
+ }
+ if (in < ins[eee]) {
+ eee -= 1;
+ } else {
+ eee += 1;
+ }
+ if (in < ins[eee]) { // expected-warning {{Access out-of-bound array element (buffer overflow)}}
+ eee -= 1;
+ }
+ }
+ return eee;
+}
Modified: cfe/branches/tooling/test/Analysis/retain-release-path-notes.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/retain-release-path-notes.m?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/retain-release-path-notes.m (original)
+++ cfe/branches/tooling/test/Analysis/retain-release-path-notes.m Tue May 15 13:51:08 2012
@@ -130,3 +130,51 @@
return result; // expected-warning{{Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected}} expected-note{{Object returned to caller with a +0 retain count}} expected-note{{Object with a +0 retain count returned to caller where a +1 (owning) retain count is expected}}
}
@end
+
+
+typedef unsigned long NSUInteger;
+
+ at interface NSValue : NSObject
+ at end
+
+ at interface NSNumber : NSValue
++ (NSNumber *)numberWithInt:(int)i;
+ at end
+
+ at interface NSString : NSObject
++ (NSString *)stringWithUTF8String:(const char *)str;
+ at end
+
+ at interface NSArray : NSObject
++ (NSArray *)arrayWithObjects:(const id [])objects count:(NSUInteger)count;
+ at end
+
+ at interface NSDictionary : NSObject
++ (id)dictionaryWithObjects:(const id [])objects forKeys:(const id /* <NSCopying> */ [])keys count:(NSUInteger)count;
+ at end
+
+
+void testNumericLiteral() {
+ id result = @1; // expected-note{{NSNumber literal is an object with a +0 retain count}}
+ [result release]; // expected-warning{{decrement}} expected-note{{Incorrect decrement of the reference count of an object that is not owned at this point by the caller}}
+}
+
+void testBoxedInt(int x) {
+ id result = @(x); // expected-note{{NSNumber boxed expression produces an object with a +0 retain count}}
+ [result release]; // expected-warning{{decrement}} expected-note{{Incorrect decrement of the reference count of an object that is not owned at this point by the caller}}
+}
+
+void testBoxedString(const char *str) {
+ id result = @(str); // expected-note{{NSString boxed expression produces an object with a +0 retain count}}
+ [result release]; // expected-warning{{decrement}} expected-note{{Incorrect decrement of the reference count of an object that is not owned at this point by the caller}}
+}
+
+void testArray(id obj) {
+ id result = @[obj]; // expected-note{{NSArray literal is an object with a +0 retain count}}
+ [result release]; // expected-warning{{decrement}} expected-note{{Incorrect decrement of the reference count of an object that is not owned at this point by the caller}}
+}
+
+void testDictionary(id key, id value) {
+ id result = @{key: value}; // expected-note{{NSDictionary literal is an object with a +0 retain count}}
+ [result release]; // expected-warning{{decrement}} expected-note{{Incorrect decrement of the reference count of an object that is not owned at this point by the caller}}
+}
Modified: cfe/branches/tooling/test/Analysis/retain-release.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/retain-release.m?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/retain-release.m (original)
+++ cfe/branches/tooling/test/Analysis/retain-release.m Tue May 15 13:51:08 2012
@@ -142,9 +142,13 @@
@end
@class NSString, NSDictionary;
@interface NSValue : NSObject <NSCopying, NSCoding> - (void)getValue:(void *)value;
- at end @interface NSNumber : NSValue - (char)charValue;
+ at end
+ at interface NSNumber : NSValue
+- (char)charValue;
- (id)initWithInt:(int)value;
- at end @class NSString;
++ (NSNumber *)numberWithInt:(int)value;
+ at end
+ at class NSString;
@interface NSArray : NSObject <NSCopying, NSMutableCopying, NSCoding, NSFastEnumeration>
- (NSUInteger)count;
- (id)initWithObjects:(const id [])objects count:(NSUInteger)cnt;
@@ -222,8 +226,10 @@
@end @protocol NSValidatedUserInterfaceItem - (SEL)action;
@end @protocol NSUserInterfaceValidations - (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)anItem;
@end @class NSDate, NSDictionary, NSError, NSException, NSNotification;
+ at class NSTextField, NSPanel, NSArray, NSWindow, NSImage, NSButton, NSError;
@interface NSApplication : NSResponder <NSUserInterfaceValidations> {
}
+- (void)beginSheet:(NSWindow *)sheet modalForWindow:(NSWindow *)docWindow modalDelegate:(id)modalDelegate didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo;
@end enum {
NSTerminateCancel = 0, NSTerminateNow = 1, NSTerminateLater = 2 };
typedef NSUInteger NSApplicationTerminateReply;
@@ -231,7 +237,7 @@
@end @class NSAttributedString, NSEvent, NSFont, NSFormatter, NSImage, NSMenu, NSText, NSView, NSTextView;
@interface NSCell : NSObject <NSCopying, NSCoding> {
}
- at end @class NSTextField, NSPanel, NSArray, NSWindow, NSImage, NSButton, NSError;
+ at end
typedef struct {
}
CVTimeStamp;
@@ -1712,6 +1718,32 @@
}
@end
+// Object escapes through a selector callback: radar://11398514
+extern id NSApp;
+ at interface MySheetController
+- (id<SInS>)inputS;
+- (void)showDoSomethingSheetAction:(id)action;
+- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo;
+ at end
+
+ at implementation MySheetController
+- (id<SInS>)inputS {
+ return 0;
+}
+- (void)showDoSomethingSheetAction:(id)action {
+ id<SInS> inputS = [[self inputS] retain];
+ [NSApp beginSheet:0
+ modalForWindow:0
+ modalDelegate:0
+ didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
+ contextInfo:(void *)inputS]; // no - warning
+}
+- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo {
+
+ id contextObject = (id)contextInfo;
+ [contextObject release];
+}
+ at end
//===----------------------------------------------------------------------===//
// Test returning allocated memory in a struct.
//
@@ -1784,6 +1816,19 @@
}
}
+void test_objc_integer_literals() {
+ id value = [@1 retain]; // expected-warning {{leak}}
+ [value description];
+}
+
+void test_objc_boxed_expressions(int x, const char *y) {
+ id value = [@(x) retain]; // expected-warning {{leak}}
+ [value description];
+
+ value = [@(y) retain]; // expected-warning {{leak}}
+ [value description];
+}
+
// Test NSLog doesn't escape tracked objects.
void rdar11400885(int y)
{
Modified: cfe/branches/tooling/test/Analysis/self-init.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/self-init.m?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/self-init.m (original)
+++ cfe/branches/tooling/test/Analysis/self-init.m Tue May 15 13:51:08 2012
@@ -1,7 +1,8 @@
// RUN: %clang_cc1 -analyze -analyzer-checker=osx.cocoa.SelfInit -fobjc-default-synthesize-properties -fno-builtin %s -verify
@class NSZone, NSCoder;
- at protocol NSObject- (id)self;
+ at protocol NSObject
+- (id)self;
@end
@protocol NSCopying - (id)copyWithZone:(NSZone *)zone;
@end
@@ -254,3 +255,28 @@
return self;
}
@end
+
+// Test for radar://11125870: init constructing a special instance.
+typedef signed char BOOL;
+ at interface MyClass : NSObject
+ at end
+ at implementation MyClass
++ (id)specialInstance {
+ return [[MyClass alloc] init];
+}
+- (id)initSpecially:(BOOL)handleSpecially {
+ if ((self = [super init])) {
+ if (handleSpecially) {
+ self = [MyClass specialInstance];
+ }
+ }
+ return self;
+}
+- (id)initSelfSelf {
+ if ((self = [super init])) {
+ self = self;
+ }
+ return self;
+}
+ at end
+
Modified: cfe/branches/tooling/test/Analysis/string.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/string.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/string.c (original)
+++ cfe/branches/tooling/test/Analysis/string.c Tue May 15 13:51:08 2012
@@ -578,6 +578,17 @@
(void)*(int*)0; // no-warning
}
+void strncpy_zero(char *src) {
+ char dst[] = "123";
+ strncpy(dst, src, 0); // no-warning
+}
+
+void strncpy_empty() {
+ char dst[] = "123";
+ char src[] = "";
+ strncpy(dst, src, 4); // no-warning
+}
+
//===----------------------------------------------------------------------===
// strncat()
//===----------------------------------------------------------------------===
@@ -716,6 +727,17 @@
strncat(dst, src, 2); // expected-warning{{This expression will create a string whose length is too big to be represented as a size_t}}
}
+void strncat_zero(char *src) {
+ char dst[] = "123";
+ strncat(dst, src, 0); // no-warning
+}
+
+void strncat_empty() {
+ char dst[8] = "123";
+ char src[] = "";
+ strncat(dst, src, 4); // no-warning
+}
+
//===----------------------------------------------------------------------===
// strcmp()
//===----------------------------------------------------------------------===
Modified: cfe/branches/tooling/test/Analysis/taint-tester.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Analysis/taint-tester.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/Analysis/taint-tester.c (original)
+++ cfe/branches/tooling/test/Analysis/taint-tester.c Tue May 15 13:51:08 2012
@@ -40,7 +40,7 @@
// FIXME: We fail to propagate the taint here because RegionStore does not
// handle ElementRegions with symbolic indexes.
int addrDeref = *addr; // expected-warning + {{tainted}}
- int _addrDeref = addrDeref;
+ int _addrDeref = addrDeref; // expected-warning + {{tainted}}
// Tainted struct address, casts.
struct XYStruct *xyPtr = 0;
Modified: cfe/branches/tooling/test/CXX/class/p6-0x.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/class/p6-0x.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/class/p6-0x.cpp (original)
+++ cfe/branches/tooling/test/CXX/class/p6-0x.cpp Tue May 15 13:51:08 2012
@@ -19,7 +19,7 @@
Trivial2(const Trivial2 &) = default;
Trivial2(Trivial2 &&) = default;
Trivial2 &operator=(const Trivial2 &) = default;
- Trivial2 &operator=(Trivial2 &) = default;
+ Trivial2 &operator=(Trivial2 &&) = default;
~Trivial2() = default;
};
Modified: cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.simple/p5-cxx0x.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.simple/p5-cxx0x.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.simple/p5-cxx0x.cpp (original)
+++ cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.simple/p5-cxx0x.cpp Tue May 15 13:51:08 2012
@@ -21,7 +21,7 @@
class PD {
friend struct A;
- ~PD(); // expected-note 4{{here}}
+ ~PD(); // expected-note 5{{here}}
public:
typedef int n;
};
@@ -37,8 +37,14 @@
};
// Two errors here: one for the decltype, one for the variable.
-decltype(PD(), PD()) pd1; // expected-error 2{{private destructor}}
-decltype(DD(), DD()) dd1; // expected-error 2{{deleted function}}
+decltype(
+ PD(), // expected-error {{private destructor}}
+ PD()) pd1; // expected-error {{private destructor}}
+decltype(DD(), // expected-error {{deleted function}}
+ DD()) dd1; // expected-error {{deleted function}}
+decltype(
+ PD(), // expected-error {{temporary of type 'PD' has private destructor}}
+ 0) pd2;
decltype(((13, ((DD())))))::n dd_parens; // ok
decltype(((((42)), PD())))::n pd_parens_comma; // ok
Modified: cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.typedef/p2-0x.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.typedef/p2-0x.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.typedef/p2-0x.cpp (original)
+++ cfe/branches/tooling/test/CXX/dcl.dcl/dcl.spec/dcl.typedef/p2-0x.cpp Tue May 15 13:51:08 2012
@@ -124,9 +124,7 @@
}
namespace CWG1044 {
- // FIXME: this diagnostic isn't ideal. one diagnostic is enough.
- using T = T; // expected-error {{type name requires a specifier}} \
- expected-error {{expected ';' after alias declaration}}
+ using T = T; // expected-error {{unknown type name 'T'}}
}
namespace StdExample {
Modified: cfe/branches/tooling/test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.default/p2.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.default/p2.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.default/p2.cpp (original)
+++ cfe/branches/tooling/test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.default/p2.cpp Tue May 15 13:51:08 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -fcxx-exceptions %s
// An explicitly-defaulted function may be declared constexpr only if it would
// have been implicitly declared as constexpr.
@@ -54,3 +54,61 @@
};
constexpr S5::S5() = default;
static_assert(S5().m == 4, "");
+
+
+// An explicitly-defaulted function may have an exception specification only if
+// it is compatible with the exception specification on an implicit declaration.
+struct E1 {
+ E1() noexcept = default;
+ E1(const E1&) noexcept = default;
+ E1(E1&&) noexcept = default;
+ E1 &operator=(const E1&) noexcept = default;
+ E1 &operator=(E1&&) noexcept = default;
+ ~E1() noexcept = default;
+};
+struct E2 {
+ E2() noexcept(false) = default; // expected-error {{exception specification of explicitly defaulted default constructor does not match the calculated one}}
+ E2(const E2&) noexcept(false) = default; // expected-error {{exception specification of explicitly defaulted copy constructor does not match the calculated one}}
+ E2(E2&&) noexcept(false) = default; // expected-error {{exception specification of explicitly defaulted move constructor does not match the calculated one}}
+ E2 &operator=(const E2&) noexcept(false) = default; // expected-error {{exception specification of explicitly defaulted copy assignment operator does not match the calculated one}}
+ E2 &operator=(E2&&) noexcept(false) = default; // expected-error {{exception specification of explicitly defaulted move assignment operator does not match the calculated one}}
+ ~E2() noexcept(false) = default; // expected-error {{exception specification of explicitly defaulted destructor does not match the calculated one}}
+};
+
+// If a function is explicitly defaulted on its first declaration
+// -- it is implicitly considered to have the same exception-specification as
+// if it had been implicitly declared
+struct E3 {
+ E3() = default;
+ E3(const E3&) = default;
+ E3(E3&&) = default;
+ E3 &operator=(const E3&) = default;
+ E3 &operator=(E3&&) = default;
+ ~E3() = default;
+};
+E3 e3;
+static_assert(noexcept(E3(), E3(E3()), E3(e3), e3 = E3(), e3 = e3), "");
+struct E4 {
+ E4() noexcept(false);
+ E4(const E4&) noexcept(false);
+ E4(E4&&) noexcept(false);
+ E4 &operator=(const E4&) noexcept(false);
+ E4 &operator=(E4&&) noexcept(false);
+ ~E4() noexcept(false);
+};
+struct E5 {
+ E5() = default;
+ E5(const E5&) = default;
+ E5(E5&&) = default;
+ E5 &operator=(const E5&) = default;
+ E5 &operator=(E5&&) = default;
+ ~E5() = default;
+
+ E4 e4;
+};
+E5 e5;
+static_assert(!noexcept(E5()), "");
+static_assert(!noexcept(E5(static_cast<E5&&>(e5))), "");
+static_assert(!noexcept(E5(e5)), "");
+static_assert(!noexcept(e5 = E5()), "");
+static_assert(!noexcept(e5 = e5), "");
Modified: cfe/branches/tooling/test/CXX/dcl.decl/dcl.init/dcl.init.aggr/p1-0x.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/dcl.decl/dcl.init/dcl.init.aggr/p1-0x.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/dcl.decl/dcl.init/dcl.init.aggr/p1-0x.cpp (original)
+++ cfe/branches/tooling/test/CXX/dcl.decl/dcl.init/dcl.init.aggr/p1-0x.cpp Tue May 15 13:51:08 2012
@@ -72,7 +72,7 @@
DefaultedAggr(const DefaultedAggr &) = default;
DefaultedAggr(DefaultedAggr &&) = default;
DefaultedAggr &operator=(const DefaultedAggr &) = default;
- DefaultedAggr &operator=(DefaultedAggr &) = default;
+ DefaultedAggr &operator=(DefaultedAggr &&) = default;
~DefaultedAggr() = default;
};
DefaultedAggr da = { 42 } ;
Modified: cfe/branches/tooling/test/CXX/dcl.decl/dcl.meaning/dcl.fct/dcl.fct.def.default/p2.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/dcl.decl/dcl.meaning/dcl.fct/dcl.fct.def.default/p2.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/dcl.decl/dcl.meaning/dcl.fct/dcl.fct.def.default/p2.cpp (original)
+++ cfe/branches/tooling/test/CXX/dcl.decl/dcl.meaning/dcl.fct/dcl.fct.def.default/p2.cpp Tue May 15 13:51:08 2012
@@ -14,11 +14,11 @@
};
struct AssignmentRet1 {
- AssignmentRet1&& operator=(AssignmentRet1&&) = default; // expected-error {{an explicitly-defaulted move assignment operator must return an unqualified lvalue reference to its class type}}
+ AssignmentRet1&& operator=(AssignmentRet1&&) = default; // expected-error {{explicitly-defaulted move assignment operator must return 'move::AssignmentRet1 &'}}
};
struct AssignmentRet2 {
- const AssignmentRet2& operator=(AssignmentRet2&&) = default; // expected-error {{an explicitly-defaulted move assignment operator must return an unqualified lvalue reference to its class type}}
+ const AssignmentRet2& operator=(AssignmentRet2&&) = default; // expected-error {{explicitly-defaulted move assignment operator must return 'move::AssignmentRet2 &'}}
};
struct ConstAssignment {
@@ -38,22 +38,35 @@
};
struct NonConst {
- NonConst(NonConst&) = default;
- NonConst& operator=(NonConst&) = default;
+ NonConst(NonConst&) = default; // expected-error {{must be defaulted outside the class}}
+ NonConst& operator=(NonConst&) = default; // expected-error {{must be defaulted outside the class}}
+ };
+
+ struct NonConst2 {
+ NonConst2(NonConst2&);
+ NonConst2& operator=(NonConst2&);
+ };
+ NonConst2::NonConst2(NonConst2&) = default;
+ NonConst2 &NonConst2::operator=(NonConst2&) = default;
+
+ struct NonConst3 {
+ NonConst3(NonConst3&) = default;
+ NonConst3& operator=(NonConst3&) = default;
+ NonConst nc;
};
struct BadConst {
- NonConst nc; // makes implicit copy non-const
BadConst(const BadConst&) = default; // expected-error {{is const, but}}
BadConst& operator=(const BadConst&) = default; // expected-error {{is const, but}}
+ NonConst nc; // makes implicit copy non-const
};
struct AssignmentRet1 {
- AssignmentRet1&& operator=(const AssignmentRet1&) = default; // expected-error {{an explicitly-defaulted copy assignment operator must return an unqualified lvalue reference to its class type}}
+ AssignmentRet1&& operator=(const AssignmentRet1&) = default; // expected-error {{explicitly-defaulted copy assignment operator must return 'copy::AssignmentRet1 &'}}
};
struct AssignmentRet2 {
- const AssignmentRet2& operator=(const AssignmentRet2&) = default; // expected-error {{an explicitly-defaulted copy assignment operator must return an unqualified lvalue reference to its class type}}
+ const AssignmentRet2& operator=(const AssignmentRet2&) = default; // expected-error {{explicitly-defaulted copy assignment operator must return 'copy::AssignmentRet2 &'}}
};
struct ConstAssignment {
Modified: cfe/branches/tooling/test/CXX/dcl.decl/dcl.meaning/dcl.fct/p9-0x.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/dcl.decl/dcl.meaning/dcl.fct/p9-0x.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/dcl.decl/dcl.meaning/dcl.fct/p9-0x.cpp (original)
+++ cfe/branches/tooling/test/CXX/dcl.decl/dcl.meaning/dcl.fct/p9-0x.cpp Tue May 15 13:51:08 2012
@@ -1,3 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
-auto j() -> enum { e3 }; // expected-error{{unnamed enumeration must be a definition}} expected-error {{requires a specifier or qualifier}} expected-error {{without trailing return type}}
+// FIXME: We should catch the case of tag with an incomplete type here (which
+// will necessarily be ill-formed as a trailing return type for a function
+// definition), and recover with a "type cannot be defined in a trailing return
+// type" error.
+auto j() -> enum { e3 }; // expected-error{{unnamed enumeration must be a definition}} expected-error {{expected a type}} expected-error {{without trailing return type}}
Modified: cfe/branches/tooling/test/CXX/expr/expr.unary/expr.unary.op/p6.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/expr/expr.unary/expr.unary.op/p6.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/expr/expr.unary/expr.unary.op/p6.cpp (original)
+++ cfe/branches/tooling/test/CXX/expr/expr.unary/expr.unary.op/p6.cpp Tue May 15 13:51:08 2012
@@ -4,7 +4,7 @@
bool b = !0;
-bool b2 = !1.2;
+bool b2 = !1.2; //expected-warning{{implicit conversion from 'double' to 'bool' changes value from 1.2 to true}}
bool b3 = !4;
Modified: cfe/branches/tooling/test/CXX/special/class.copy/p15-inclass.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/special/class.copy/p15-inclass.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/special/class.copy/p15-inclass.cpp (original)
+++ cfe/branches/tooling/test/CXX/special/class.copy/p15-inclass.cpp Tue May 15 13:51:08 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++11 -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -emit-llvm -o - %s | FileCheck %s
namespace PR11418 {
struct NonPOD {
Modified: cfe/branches/tooling/test/CXX/temp/temp.spec/p5.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/temp/temp.spec/p5.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/temp/temp.spec/p5.cpp (original)
+++ cfe/branches/tooling/test/CXX/temp/temp.spec/p5.cpp Tue May 15 13:51:08 2012
@@ -14,7 +14,7 @@
};
template<typename T>
-T X0<T>::value = 3.14; // expected-warning{{implicit conversion turns literal floating-point number into integer}}
+T X0<T>::value = 3.14; // expected-warning{{implicit conversion from 'double' to 'int' changes value from 3.14 to 3}}
template struct X0<int>; // expected-note{{previous explicit instantiation}} \
expected-note{{requested here}}
Modified: cfe/branches/tooling/test/CXX/temp/temp.spec/temp.expl.spec/p14.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/temp/temp.spec/temp.expl.spec/p14.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/temp/temp.spec/temp.expl.spec/p14.cpp (original)
+++ cfe/branches/tooling/test/CXX/temp/temp.spec/temp.expl.spec/p14.cpp Tue May 15 13:51:08 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o - %s | FileCheck %s
template<class T> void f(T) { /* ... */ }
template<class T> inline void g(T) { /* ... */ }
Modified: cfe/branches/tooling/test/CXX/temp/temp.spec/temp.explicit/p9-linkage.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CXX/temp/temp.spec/temp.explicit/p9-linkage.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CXX/temp/temp.spec/temp.explicit/p9-linkage.cpp (original)
+++ cfe/branches/tooling/test/CXX/temp/temp.spec/temp.explicit/p9-linkage.cpp Tue May 15 13:51:08 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -O1 -emit-llvm -std=c++11 -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -O1 -emit-llvm -std=c++11 -o - %s | FileCheck %s
template<typename T>
struct X0 {
Modified: cfe/branches/tooling/test/CodeGen/2005-07-20-SqrtNoErrno.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/2005-07-20-SqrtNoErrno.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/2005-07-20-SqrtNoErrno.c (original)
+++ cfe/branches/tooling/test/CodeGen/2005-07-20-SqrtNoErrno.c Tue May 15 13:51:08 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - | FileCheck %s
// llvm.sqrt has undefined behavior on negative inputs, so it is
// inappropriate to translate C/C++ sqrt to this.
float sqrtf(float x);
Modified: cfe/branches/tooling/test/CodeGen/2007-02-25-C-DotDotDot.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/2007-02-25-C-DotDotDot.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/2007-02-25-C-DotDotDot.c (original)
+++ cfe/branches/tooling/test/CodeGen/2007-02-25-C-DotDotDot.c Tue May 15 13:51:08 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -O0 %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -O0 %s -emit-llvm -o - | FileCheck %s
// Make sure the call to foo is compiled as:
// call float @foo()
Modified: cfe/branches/tooling/test/CodeGen/2008-03-05-syncPtr.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/2008-03-05-syncPtr.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/2008-03-05-syncPtr.c (original)
+++ cfe/branches/tooling/test/CodeGen/2008-03-05-syncPtr.c Tue May 15 13:51:08 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - | FileCheck %s
int* foo(int** a, int* b, int* c) {
return __sync_val_compare_and_swap (a, b, c);
Modified: cfe/branches/tooling/test/CodeGen/2008-04-08-NoExceptions.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/2008-04-08-NoExceptions.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/2008-04-08-NoExceptions.c (original)
+++ cfe/branches/tooling/test/CodeGen/2008-04-08-NoExceptions.c Tue May 15 13:51:08 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o - %s | FileCheck %s
void f(void);
void g(void) {
Modified: cfe/branches/tooling/test/CodeGen/2009-09-24-SqrtErrno.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/2009-09-24-SqrtErrno.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/2009-09-24-SqrtErrno.c (original)
+++ cfe/branches/tooling/test/CodeGen/2009-09-24-SqrtErrno.c Tue May 15 13:51:08 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -o - -fmath-errno | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - -fmath-errno | FileCheck %s
// llvm.sqrt has undefined behavior on negative inputs, so it is
// inappropriate to translate C/C++ sqrt to this.
Modified: cfe/branches/tooling/test/CodeGen/Atomics.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/Atomics.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/Atomics.c (original)
+++ cfe/branches/tooling/test/CodeGen/Atomics.c Tue May 15 13:51:08 2012
@@ -1,6 +1,6 @@
// Test frontend handling of __sync builtins.
// Modified from a gcc testcase.
-// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm %s -o - | FileCheck %s
signed char sc;
unsigned char uc;
Modified: cfe/branches/tooling/test/CodeGen/address-space.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/address-space.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/address-space.c (original)
+++ cfe/branches/tooling/test/CodeGen/address-space.c Tue May 15 13:51:08 2012
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -emit-llvm < %s | FileCheck %s
-// RUN: %clang_cc1 -emit-llvm < %s | grep 'load.*addrspace(2).. @A'
-// RUN: %clang_cc1 -emit-llvm < %s | grep 'load.*addrspace(2).. @B'
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm < %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm < %s | grep 'load.*addrspace(2).. @A'
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm < %s | grep 'load.*addrspace(2).. @B'
// CHECK: @foo = common addrspace(1) global
Modified: cfe/branches/tooling/test/CodeGen/attributes.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/attributes.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/attributes.c (original)
+++ cfe/branches/tooling/test/CodeGen/attributes.c Tue May 15 13:51:08 2012
@@ -81,3 +81,11 @@
}
// CHECK: [[FPTRVAR:%[a-z0-9]+]] = load void (i32)** @fptr
// CHECK-NEXT: call x86_fastcallcc void [[FPTRVAR]](i32 10)
+
+
+// PR9356: We might want to err on this, but for now at least make sure we
+// use the section in the definition.
+void __attribute__((section(".foo"))) t22(void);
+void __attribute__((section(".bar"))) t22(void) {}
+
+// CHECK: define void @t22() nounwind section ".bar"
Modified: cfe/branches/tooling/test/CodeGen/compound-literal.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/compound-literal.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/compound-literal.c (original)
+++ cfe/branches/tooling/test/CodeGen/compound-literal.c Tue May 15 13:51:08 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm %s -o - | FileCheck %s
int* a = &(int){1};
struct s {int a, b, c;} * b = &(struct s) {1, 2, 3};
Modified: cfe/branches/tooling/test/CodeGen/func-aligned.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/func-aligned.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/func-aligned.c (original)
+++ cfe/branches/tooling/test/CodeGen/func-aligned.c Tue May 15 13:51:08 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - | FileCheck %s
// rdar://7270273
void foo() __attribute__((aligned (64)));
Modified: cfe/branches/tooling/test/CodeGen/func-return-member.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/func-return-member.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/func-return-member.c (original)
+++ cfe/branches/tooling/test/CodeGen/func-return-member.c Tue May 15 13:51:08 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o - %s | FileCheck %s
struct frk { float _Complex c; int x; };
struct faz { struct frk f; };
Modified: cfe/branches/tooling/test/CodeGen/incomplete-function-type.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/incomplete-function-type.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/incomplete-function-type.c (original)
+++ cfe/branches/tooling/test/CodeGen/incomplete-function-type.c Tue May 15 13:51:08 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o - %s | FileCheck %s
// CHECK: ModuleID
// CHECK-NOT: opaque
// CHECK: define void @f0
Modified: cfe/branches/tooling/test/CodeGen/integer-overflow.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/integer-overflow.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/integer-overflow.c (original)
+++ cfe/branches/tooling/test/CodeGen/integer-overflow.c Tue May 15 13:51:08 2012
@@ -1,7 +1,7 @@
-// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s --check-prefix=DEFAULT
-// RUN: %clang_cc1 %s -emit-llvm -o - -fwrapv | FileCheck %s --check-prefix=WRAPV
-// RUN: %clang_cc1 %s -emit-llvm -o - -ftrapv | FileCheck %s --check-prefix=TRAPV
-// RUN: %clang_cc1 %s -emit-llvm -o - -ftrapv -ftrapv-handler foo | FileCheck %s --check-prefix=TRAPV_HANDLER
+// RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - | FileCheck %s --check-prefix=DEFAULT
+// RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - -fwrapv | FileCheck %s --check-prefix=WRAPV
+// RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - -ftrapv | FileCheck %s --check-prefix=TRAPV
+// RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - -ftrapv -ftrapv-handler foo | FileCheck %s --check-prefix=TRAPV_HANDLER
// Tests for signed integer overflow stuff.
Modified: cfe/branches/tooling/test/CodeGen/mips64-class-return.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/mips64-class-return.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/mips64-class-return.cpp (original)
+++ cfe/branches/tooling/test/CodeGen/mips64-class-return.cpp Tue May 15 13:51:08 2012
@@ -39,7 +39,7 @@
gd2 = a0;
}
-// CHECK: define void @_Z4foo42D0(%class.D0* nocapture byval %a0)
+// CHECK: define void @_Z4foo42D0(i64 %a0.coerce0, i64 %a0.coerce1)
void foo4(D0 a0) {
gd0 = a0;
}
Modified: cfe/branches/tooling/test/CodeGen/object-size.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/object-size.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/object-size.c (original)
+++ cfe/branches/tooling/test/CodeGen/object-size.c Tue May 15 13:51:08 2012
@@ -40,7 +40,7 @@
// CHECK: define void @test5
void test5() {
// CHECK: = load i8** @gp
- // CHECK-NEXT:= call i64 @llvm.objectsize.i64(i8* %{{.*}}, i1 false)
+ // CHECK-NEXT:= call i64 @llvm.objectsize.i64(i8* %{{.*}}, i1 false, i32 0)
strcpy(gp, "Hi there");
}
@@ -55,7 +55,7 @@
// CHECK: define void @test7
void test7() {
int i;
- // CHECK: = call i64 @llvm.objectsize.i64(i8* {{.*}}@gbuf{{.*}}, i1 false)
+ // CHECK: = call i64 @llvm.objectsize.i64(i8* {{.*}}@gbuf{{.*}}, i1 false, i32 0)
strcpy((++i, gbuf), "Hi there");
}
Modified: cfe/branches/tooling/test/CodeGen/pr12251.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/pr12251.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/pr12251.c (original)
+++ cfe/branches/tooling/test/CodeGen/pr12251.c Tue May 15 13:51:08 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -O1 -relaxed-aliasing -o - | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -O1 -relaxed-aliasing -o - | FileCheck %s
enum e1 {e1_a = -1 };
enum e1 g1(enum e1 *x) {
Modified: cfe/branches/tooling/test/CodeGen/pragma-visibility.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGen/pragma-visibility.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGen/pragma-visibility.c (original)
+++ cfe/branches/tooling/test/CodeGen/pragma-visibility.c Tue May 15 13:51:08 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o - %s | FileCheck %s
#pragma GCC visibility push(hidden)
int x = 2;
Modified: cfe/branches/tooling/test/CodeGenCXX/cxx0x-initializer-references.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGenCXX/cxx0x-initializer-references.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGenCXX/cxx0x-initializer-references.cpp (original)
+++ cfe/branches/tooling/test/CodeGenCXX/cxx0x-initializer-references.cpp Tue May 15 13:51:08 2012
@@ -28,6 +28,10 @@
// CHECK-NEXT: store %{{.*}}* %{{.*}}, %{{.*}}** %
A &ra1a = {a};
+ using T = A&;
+ // CHECK-NEXT: store %{{.*}}* %{{.*}}, %{{.*}}** %
+ A &ra1b = T{a};
+
// CHECK-NEXT: ret
}
Modified: cfe/branches/tooling/test/CodeGenCXX/mangle-ref-qualifiers.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGenCXX/mangle-ref-qualifiers.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGenCXX/mangle-ref-qualifiers.cpp (original)
+++ cfe/branches/tooling/test/CodeGenCXX/mangle-ref-qualifiers.cpp Tue May 15 13:51:08 2012
@@ -12,5 +12,11 @@
// CHECK: define i32 @_ZNKO1X1hEv
int X::h() const && { return 0; }
-// CHECK: define void @_Z1fM1XRFivEMS_OFivEMS_KOFivE
+// CHECK: define void @_Z1fM1XFivREMS_FivOEMS_KFivOE
void f(int (X::*)() &, int (X::*)() &&, int (X::*)() const&&) { }
+
+// CHECK: define void @_Z1g1AIFivEES_IFivREES_IFivOEES_IKFivEES_IKFivREES_IKFivOEES_IVKFivEES_IVKFivREES_IVKFivOEE()
+template <class T> struct A {};
+void g(A<int()>, A<int()&>, A<int()&&>,
+ A<int() const>, A<int() const &>, A<int() const &&>,
+ A<int() const volatile>, A<int() const volatile &>, A<int() const volatile &&>) {}
Modified: cfe/branches/tooling/test/CodeGenCXX/virtual-destructor-calls.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGenCXX/virtual-destructor-calls.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGenCXX/virtual-destructor-calls.cpp (original)
+++ cfe/branches/tooling/test/CodeGenCXX/virtual-destructor-calls.cpp Tue May 15 13:51:08 2012
@@ -46,3 +46,14 @@
// CHECK: call void @_ZdlPv
// Base dtor: just an alias to B's base dtor.
+
+namespace PR12798 {
+ // A qualified call to a base class destructor should not undergo virtual
+ // dispatch. Template instantiation used to lose the qualifier.
+ struct A { virtual ~A(); };
+ template<typename T> void f(T *p) { p->A::~A(); }
+
+ // CHECK: define {{.*}} @_ZN7PR127981fINS_1AEEEvPT_(
+ // CHECK: call void @_ZN7PR127981AD1Ev(
+ template void f(A*);
+}
Modified: cfe/branches/tooling/test/CodeGenCXX/visibility.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGenCXX/visibility.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGenCXX/visibility.cpp (original)
+++ cfe/branches/tooling/test/CodeGenCXX/visibility.cpp Tue May 15 13:51:08 2012
@@ -712,3 +712,55 @@
// CHECK: define weak_odr hidden void @_ZN6test363fooINS_2S1ENS_2S2EE3barEv
// CHECK-HIDDEN: define weak_odr hidden void @_ZN6test363fooINS_2S1ENS_2S2EE3barEv
}
+
+namespace test37 {
+ struct HIDDEN foo {
+ };
+ template<class T>
+ DEFAULT void bar() {}
+ template DEFAULT void bar<foo>();
+ // CHECK: define weak_odr void @_ZN6test373barINS_3fooEEEvv
+ // CHECK-HIDDEN: define weak_odr void @_ZN6test373barINS_3fooEEEvv
+}
+
+namespace test38 {
+ template<typename T>
+ class DEFAULT foo {
+ void bar() {}
+ };
+ struct HIDDEN zed {
+ };
+ template class foo<zed>;
+ // CHECK: define weak_odr hidden void @_ZN6test383fooINS_3zedEE3barEv
+ // CHECK-HIDDEN: define weak_odr hidden void @_ZN6test383fooINS_3zedEE3barEv
+}
+
+namespace test39 {
+ class DEFAULT default_t;
+ class HIDDEN hidden_t;
+ template <class T> class A {
+ template <class U> class B {
+ HIDDEN void hidden() {}
+ void noattr() {}
+ template <class V> void temp() {}
+ };
+ };
+ template class DEFAULT A<hidden_t>;
+ template class DEFAULT A<hidden_t>::B<hidden_t>;
+ template void A<hidden_t>::B<hidden_t>::temp<default_t>();
+ template void A<hidden_t>::B<hidden_t>::temp<hidden_t>();
+
+ // CHECK: define weak_odr hidden void @_ZN6test391AINS_8hidden_tEE1BIS1_E6hiddenEv
+ // CHECK: define weak_odr void @_ZN6test391AINS_8hidden_tEE1BIS1_E6noattrEv
+ // CHECK: define weak_odr void @_ZN6test391AINS_8hidden_tEE1BIS1_E4tempINS_9default_tEEEvv
+
+ // GCC produces a default for this one. Why?
+ // CHECK: define weak_odr hidden void @_ZN6test391AINS_8hidden_tEE1BIS1_E4tempIS1_EEvv
+
+ // CHECK-HIDDEN: define weak_odr hidden void @_ZN6test391AINS_8hidden_tEE1BIS1_E6hiddenEv
+ // CHECK-HIDDEN: define weak_odr void @_ZN6test391AINS_8hidden_tEE1BIS1_E6noattrEv
+ // CHECK-HIDDEN: define weak_odr void @_ZN6test391AINS_8hidden_tEE1BIS1_E4tempINS_9default_tEEEvv
+
+ // GCC produces a default for this one. Why?
+ // CHECK-HIDDEN: define weak_odr hidden void @_ZN6test391AINS_8hidden_tEE1BIS1_E4tempIS1_EEvv
+}
Modified: cfe/branches/tooling/test/CodeGenObjC/objc-literal-debugger-test.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/CodeGenObjC/objc-literal-debugger-test.m?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/CodeGenObjC/objc-literal-debugger-test.m (original)
+++ cfe/branches/tooling/test/CodeGenObjC/objc-literal-debugger-test.m Tue May 15 13:51:08 2012
@@ -1,4 +1,25 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fdebugger-objc-literal -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fdebugger-objc-literal -emit-llvm -o - %s -DINCLUDE_INTERFACES=1 | FileCheck %s
+
+// We need two different RUN lines here because the first time a class/method is absent,
+// it will be added for -fdebugger-objc-literal.
+
+#ifdef INCLUDE_INTERFACES
+ at interface NSObject
+ at end
+
+ at interface NSNumber : NSObject
+ at end
+
+ at interface NSArray : NSObject
+ at end
+
+ at interface NSDictionary : NSObject
+ at end
+
+ at interface NSString : NSObject
+ at end
+#endif
int main() {
// object literals.
Modified: cfe/branches/tooling/test/Index/complete-with-annotations.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Index/complete-with-annotations.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/Index/complete-with-annotations.cpp (original)
+++ cfe/branches/tooling/test/Index/complete-with-annotations.cpp Tue May 15 13:51:08 2012
@@ -14,7 +14,7 @@
}
// CHECK: CXXMethod:{ResultType void}{TypedText doSomething}{LeftParen (}{RightParen )} (34)
-// CHECK: FieldDecl:{ResultType int}{TypedText field} (35) ("one", "two", "three")
+// CHECK: FieldDecl:{ResultType int}{TypedText field} (35) ("three", "two", "one")
// CHECK: CXXMethod:{ResultType void}{TypedText func2}{LeftParen (}{RightParen )} (34) ("some annotation")
// CHECK: FieldDecl:{ResultType int}{TypedText member2} (35) ("another annotation", "some annotation")
// CHECK: CXXMethod:{ResultType X &}{TypedText operator=}{LeftParen (}{Placeholder const X &}{RightParen )} (34)
Modified: cfe/branches/tooling/test/Index/overrides.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Index/overrides.m?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/Index/overrides.m (original)
+++ cfe/branches/tooling/test/Index/overrides.m Tue May 15 13:51:08 2012
@@ -50,6 +50,52 @@
-(void)meth { }
@end
+ at protocol P5
+-(void)kol;
+-(void)kol;
+ at end
+
+ at protocol P6
+ at property (readonly) id prop1;
+ at property (readonly) id prop2;
+-(void)meth;
+ at end
+
+ at interface I3 <P6>
+ at property (readwrite) id prop1;
+ at property (readonly) id bar;
+ at end
+
+ at interface I3()
+ at property (readwrite) id prop2;
+ at property (readwrite) id bar;
+-(void)meth;
+ at end
+
+ at interface B4
+-(id)prop;
+-(void)setProp:(id)prop;
+ at end
+
+ at interface I4 : B4
+ at property (assign) id prop;
+ at end
+
+ at interface B5
+ at end
+
+ at interface I5 : B5
+-(void)meth;
+ at end
+
+ at interface B5(cat)
+-(void)meth;
+ at end
+
+ at implementation I5
+-(void)meth{}
+ at end
+
// RUN: c-index-test -test-load-source local %s | FileCheck %s
// CHECK: overrides.m:12:9: ObjCInstanceMethodDecl=protoMethod:12:9 [Overrides @3:9]
// CHECK: overrides.m:22:9: ObjCInstanceMethodDecl=method:22:9 [Overrides @16:9]
@@ -59,3 +105,15 @@
// CHECK: overrides.m:32:9: ObjCInstanceMethodDecl=protoMethod:32:9 [Overrides @8:9]
// CHECK: overrides.m:36:9: ObjCInstanceMethodDecl=protoMethod:36:9 [Overrides @12:9, @8:9, @32:9, @17:9]
// CHECK: overrides.m:50:8: ObjCInstanceMethodDecl=meth:50:8 (Definition) [Overrides @43:8]
+// CHECK: overrides.m:55:8: ObjCInstanceMethodDecl=kol:55:8 Extent=[55:1 - 55:12]
+// CHECK: overrides.m:65:26: ObjCInstanceMethodDecl=prop1:65:26 [Overrides @59:25] Extent=[65:26 - 65:31]
+// CHECK: overrides.m:65:26: ObjCInstanceMethodDecl=setProp1::65:26 Extent=[65:26 - 65:31]
+// CHECK: overrides.m:70:26: ObjCInstanceMethodDecl=prop2:70:26 [Overrides @60:25] Extent=[70:26 - 70:31]
+// CHECK: overrides.m:70:26: ObjCInstanceMethodDecl=setProp2::70:26 Extent=[70:26 - 70:31]
+// CHECK: overrides.m:71:26: ObjCInstanceMethodDecl=setBar::71:26 Extent=[71:26 - 71:29]
+// CHECK: overrides.m:72:8: ObjCInstanceMethodDecl=meth:72:8 [Overrides @61:8] Extent=[72:1 - 72:13]
+// CHECK: overrides.m:81:23: ObjCInstanceMethodDecl=prop:81:23 [Overrides @76:6] Extent=[81:23 - 81:27]
+// CHECK: overrides.m:81:23: ObjCInstanceMethodDecl=setProp::81:23 [Overrides @77:8] Extent=[81:23 - 81:27]
+// CHECK: overrides.m:92:8: ObjCInstanceMethodDecl=meth:92:8 Extent=[92:1 - 92:13]
+// CHECK: overrides.m:95:17: ObjCImplementationDecl=I5:95:17 (Definition) Extent=[95:1 - 97:2]
+// CHECK: overrides.m:96:9: ObjCInstanceMethodDecl=meth:96:9 (Definition) [Overrides @92:8] Extent=[96:1 - 96:14]
Modified: cfe/branches/tooling/test/PCH/exprs.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/PCH/exprs.h?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/PCH/exprs.h (original)
+++ cfe/branches/tooling/test/PCH/exprs.h Tue May 15 13:51:08 2012
@@ -87,7 +87,7 @@
int x;
float y;
} designated_inits[3] = { [0].y = 17,
- [2].x = 12.3, // expected-warning {{implicit conversion turns literal floating-point number into integer}}
+ [2].x = 12.3, // expected-warning {{implicit conversion from 'double' to 'int' changes value from 12.3 to 12}}
3.5 };
// TypesCompatibleExpr
Modified: cfe/branches/tooling/test/Parser/MicrosoftExtensions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Parser/MicrosoftExtensions.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/Parser/MicrosoftExtensions.cpp (original)
+++ cfe/branches/tooling/test/Parser/MicrosoftExtensions.cpp Tue May 15 13:51:08 2012
@@ -151,11 +151,24 @@
class AAAA { };
+template <typename T>
+class SimpleTemplate {};
+
template <class T>
void redundant_typename() {
typename T t;// expected-warning {{expected a qualified name after 'typename'}}
typename AAAA a;// expected-warning {{expected a qualified name after 'typename'}}
+
t = 3;
+
+ typedef typename T* pointerT;// expected-warning {{expected a qualified name after 'typename'}}
+ typedef typename SimpleTemplate<int> templateT;// expected-warning {{expected a qualified name after 'typename'}}
+
+ pointerT pT = &t;
+ *pT = 4;
+
+ int var;
+ int k = typename var;// expected-error {{expected a qualified name after 'typename'}}
}
Modified: cfe/branches/tooling/test/Parser/altivec.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Parser/altivec.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/Parser/altivec.c (original)
+++ cfe/branches/tooling/test/Parser/altivec.c Tue May 15 13:51:08 2012
@@ -76,6 +76,16 @@
vector bool long v_bl; // expected-error {{cannot use 'long' with '__vector bool'}}
vector bool long long v_bll; // expected-error {{cannot use 'long long' with '__vector bool'}}
+typedef char i8;
+typedef short i16;
+typedef int i32;
+struct S {
+ // i8, i16, i32 here are field names, not type names.
+ vector bool i8; // expected-error {{requires a specifier or qualifier}}
+ vector pixel i16;
+ vector long i32; // expected-warning {{deprecated}}
+};
+
void f() {
__vector unsigned int v = {0,0,0,0};
__vector int v__cast = (__vector int)v;
Modified: cfe/branches/tooling/test/Parser/cxx-throw.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Parser/cxx-throw.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/Parser/cxx-throw.cpp (original)
+++ cfe/branches/tooling/test/Parser/cxx-throw.cpp Tue May 15 13:51:08 2012
@@ -13,3 +13,5 @@
__extension__ throw 1; // expected-error {{expected expression}}
(void)throw; // expected-error {{expected expression}}
}
+
+void f() throw(static); // expected-error {{expected a type}} expected-error {{does not allow storage class}}
Modified: cfe/branches/tooling/test/Parser/cxx11-type-specifier.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Parser/cxx11-type-specifier.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/Parser/cxx11-type-specifier.cpp (original)
+++ cfe/branches/tooling/test/Parser/cxx11-type-specifier.cpp Tue May 15 13:51:08 2012
@@ -18,3 +18,10 @@
(void) new struct S {}; // expected-error{{'S' can not be defined in a type specifier}}
(void) new enum E { e }; // expected-error{{'E' can not be defined in a type specifier}}
}
+
+// And for trailing-type-specifier-seq
+
+// FIXME: Don't treat an ill-formed trailing-return-type the same as no
+// trailing-return-type, and avoid the second diagnostic.
+auto f() -> unknown; // expected-error{{unknown type name 'unknown'}} \
+ expected-error{{'auto' return without trailing return type}}
Modified: cfe/branches/tooling/test/Preprocessor/mmx.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Preprocessor/mmx.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/Preprocessor/mmx.c (original)
+++ cfe/branches/tooling/test/Preprocessor/mmx.c Tue May 15 13:51:08 2012
@@ -1,8 +1,11 @@
// RUN: %clang -march=i386 -m32 -E -dM %s -msse -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=SSE_AND_MMX
// RUN: %clang -march=i386 -m32 -E -dM %s -msse -mno-mmx -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=SSE_NO_MMX
// RUN: %clang -march=i386 -m32 -E -dM %s -mno-mmx -msse -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=SSE_NO_MMX
// SSE_AND_MMX: #define __MMX__
Modified: cfe/branches/tooling/test/Preprocessor/pp-record.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Preprocessor/pp-record.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/Preprocessor/pp-record.c (original)
+++ cfe/branches/tooling/test/Preprocessor/pp-record.c Tue May 15 13:51:08 2012
@@ -10,3 +10,14 @@
#include STRINGIZE(INC)
CAKE;
+
+#define DIR 1
+#define FNM(x) x
+
+FNM(
+#if DIR
+ int a;
+#else
+ int b;
+#endif
+)
Modified: cfe/branches/tooling/test/Preprocessor/predefined-arch-macros.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Preprocessor/predefined-arch-macros.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/Preprocessor/predefined-arch-macros.c (original)
+++ cfe/branches/tooling/test/Preprocessor/predefined-arch-macros.c Tue May 15 13:51:08 2012
@@ -4,16 +4,19 @@
// Begin X86/GCC/Linux tests ----------------
//
// RUN: %clang -march=i386 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_I386_M32
// CHECK_I386_M32: #define __i386 1
// CHECK_I386_M32: #define __i386__ 1
// CHECK_I386_M32: #define __tune_i386__ 1
// CHECK_I386_M32: #define i386 1
// RUN: %clang -march=i386 -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_I386_M64
// CHECK_I386_M64: error:
//
// RUN: %clang -march=i486 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_I486_M32
// CHECK_I486_M32: #define __i386 1
// CHECK_I486_M32: #define __i386__ 1
@@ -22,10 +25,12 @@
// CHECK_I486_M32: #define __tune_i486__ 1
// CHECK_I486_M32: #define i386 1
// RUN: %clang -march=i486 -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_I486_M64
// CHECK_I486_M64: error:
//
// RUN: %clang -march=i586 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_I586_M32
// CHECK_I586_M32: #define __i386 1
// CHECK_I586_M32: #define __i386__ 1
@@ -37,10 +42,12 @@
// CHECK_I586_M32: #define __tune_pentium__ 1
// CHECK_I586_M32: #define i386 1
// RUN: %clang -march=i586 -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_I586_M64
// CHECK_I586_M64: error:
//
// RUN: %clang -march=pentium -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM_M32
// CHECK_PENTIUM_M32: #define __i386 1
// CHECK_PENTIUM_M32: #define __i386__ 1
@@ -52,10 +59,12 @@
// CHECK_PENTIUM_M32: #define __tune_pentium__ 1
// CHECK_PENTIUM_M32: #define i386 1
// RUN: %clang -march=pentium -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM_M64
// CHECK_PENTIUM_M64: error:
//
// RUN: %clang -march=pentium-mmx -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM_MMX_M32
// CHECK_PENTIUM_MMX_M32: #define __MMX__ 1
// CHECK_PENTIUM_MMX_M32: #define __i386 1
@@ -70,10 +79,12 @@
// CHECK_PENTIUM_MMX_M32: #define __tune_pentium_mmx__ 1
// CHECK_PENTIUM_MMX_M32: #define i386 1
// RUN: %clang -march=pentium-mmx -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM_MMX_M64
// CHECK_PENTIUM_MMX_M64: error:
//
// RUN: %clang -march=winchip-c6 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_WINCHIP_C6_M32
// CHECK_WINCHIP_C6_M32: #define __MMX__ 1
// CHECK_WINCHIP_C6_M32: #define __i386 1
@@ -83,10 +94,12 @@
// CHECK_WINCHIP_C6_M32: #define __tune_i486__ 1
// CHECK_WINCHIP_C6_M32: #define i386 1
// RUN: %clang -march=winchip-c6 -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_WINCHIP_C6_M64
// CHECK_WINCHIP_C6_M64: error:
//
// RUN: %clang -march=winchip2 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_WINCHIP2_M32
// CHECK_WINCHIP2_M32: #define __3dNOW__ 1
// CHECK_WINCHIP2_M32: #define __MMX__ 1
@@ -97,10 +110,12 @@
// CHECK_WINCHIP2_M32: #define __tune_i486__ 1
// CHECK_WINCHIP2_M32: #define i386 1
// RUN: %clang -march=winchip2 -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_WINCHIP2_M64
// CHECK_WINCHIP2_M64: error:
//
// RUN: %clang -march=c3 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_C3_M32
// CHECK_C3_M32: #define __3dNOW__ 1
// CHECK_C3_M32: #define __MMX__ 1
@@ -111,10 +126,12 @@
// CHECK_C3_M32: #define __tune_i486__ 1
// CHECK_C3_M32: #define i386 1
// RUN: %clang -march=c3 -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_C3_M64
// CHECK_C3_M64: error:
//
// RUN: %clang -march=c3-2 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_C3_2_M32
// CHECK_C3_2_M32: #define __MMX__ 1
// CHECK_C3_2_M32: #define __SSE__ 1
@@ -129,10 +146,12 @@
// CHECK_C3_2_M32: #define __tune_pentiumpro__ 1
// CHECK_C3_2_M32: #define i386 1
// RUN: %clang -march=c3-2 -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_C3_2_M64
// CHECK_C3_2_M64: error:
//
// RUN: %clang -march=i686 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_I686_M32
// CHECK_I686_M32: #define __i386 1
// CHECK_I686_M32: #define __i386__ 1
@@ -142,10 +161,12 @@
// CHECK_I686_M32: #define __pentiumpro__ 1
// CHECK_I686_M32: #define i386 1
// RUN: %clang -march=i686 -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_I686_M64
// CHECK_I686_M64: error:
//
// RUN: %clang -march=pentiumpro -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUMPRO_M32
// CHECK_PENTIUMPRO_M32: #define __i386 1
// CHECK_PENTIUMPRO_M32: #define __i386__ 1
@@ -157,10 +178,12 @@
// CHECK_PENTIUMPRO_M32: #define __tune_pentiumpro__ 1
// CHECK_PENTIUMPRO_M32: #define i386 1
// RUN: %clang -march=pentiumpro -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUMPRO_M64
// CHECK_PENTIUMPRO_M64: error:
//
// RUN: %clang -march=pentium2 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM2_M32
// CHECK_PENTIUM2_M32: #define __MMX__ 1
// CHECK_PENTIUM2_M32: #define __i386 1
@@ -174,10 +197,12 @@
// CHECK_PENTIUM2_M32: #define __tune_pentiumpro__ 1
// CHECK_PENTIUM2_M32: #define i386 1
// RUN: %clang -march=pentium2 -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM2_M64
// CHECK_PENTIUM2_M64: error:
//
// RUN: %clang -march=pentium3 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM3_M32
// CHECK_PENTIUM3_M32: #define __MMX__ 1
// CHECK_PENTIUM3_M32: #define __SSE__ 1
@@ -193,10 +218,12 @@
// CHECK_PENTIUM3_M32: #define __tune_pentiumpro__ 1
// CHECK_PENTIUM3_M32: #define i386 1
// RUN: %clang -march=pentium3 -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM3_M64
// CHECK_PENTIUM3_M64: error:
//
// RUN: %clang -march=pentium3m -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM3M_M32
// CHECK_PENTIUM3M_M32: #define __MMX__ 1
// CHECK_PENTIUM3M_M32: #define __SSE__ 1
@@ -210,10 +237,12 @@
// CHECK_PENTIUM3M_M32: #define __tune_pentiumpro__ 1
// CHECK_PENTIUM3M_M32: #define i386 1
// RUN: %clang -march=pentium3m -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM3M_M64
// CHECK_PENTIUM3M_M64: error:
//
// RUN: %clang -march=pentium-m -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM_M_M32
// CHECK_PENTIUM_M_M32: #define __MMX__ 1
// CHECK_PENTIUM_M_M32: #define __SSE2__ 1
@@ -228,10 +257,12 @@
// CHECK_PENTIUM_M_M32: #define __tune_pentiumpro__ 1
// CHECK_PENTIUM_M_M32: #define i386 1
// RUN: %clang -march=pentium-m -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM_M_M64
// CHECK_PENTIUM_M_M64: error:
//
// RUN: %clang -march=pentium4 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM4_M32
// CHECK_PENTIUM4_M32: #define __MMX__ 1
// CHECK_PENTIUM4_M32: #define __SSE2__ 1
@@ -243,10 +274,12 @@
// CHECK_PENTIUM4_M32: #define __tune_pentium4__ 1
// CHECK_PENTIUM4_M32: #define i386 1
// RUN: %clang -march=pentium4 -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM4_M64
// CHECK_PENTIUM4_M64: error:
//
// RUN: %clang -march=pentium4m -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM4M_M32
// CHECK_PENTIUM4M_M32: #define __MMX__ 1
// CHECK_PENTIUM4M_M32: #define __SSE2__ 1
@@ -258,10 +291,12 @@
// CHECK_PENTIUM4M_M32: #define __tune_pentium4__ 1
// CHECK_PENTIUM4M_M32: #define i386 1
// RUN: %clang -march=pentium4m -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM4M_M64
// CHECK_PENTIUM4M_M64: error:
//
// RUN: %clang -march=prescott -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PRESCOTT_M32
// CHECK_PRESCOTT_M32: #define __MMX__ 1
// CHECK_PRESCOTT_M32: #define __SSE2__ 1
@@ -274,10 +309,12 @@
// CHECK_PRESCOTT_M32: #define __tune_nocona__ 1
// CHECK_PRESCOTT_M32: #define i386 1
// RUN: %clang -march=prescott -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PRESCOTT_M64
// CHECK_PRESCOTT_M64: error:
//
// RUN: %clang -march=nocona -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_NOCONA_M32
// CHECK_NOCONA_M32: #define __MMX__ 1
// CHECK_NOCONA_M32: #define __SSE2__ 1
@@ -290,6 +327,7 @@
// CHECK_NOCONA_M32: #define __tune_nocona__ 1
// CHECK_NOCONA_M32: #define i386 1
// RUN: %clang -march=nocona -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_NOCONA_M64
// CHECK_NOCONA_M64: #define __MMX__ 1
// CHECK_NOCONA_M64: #define __SSE2_MATH__ 1
@@ -306,6 +344,7 @@
// CHECK_NOCONA_M64: #define __x86_64__ 1
//
// RUN: %clang -march=core2 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_CORE2_M32
// CHECK_CORE2_M32: #define __MMX__ 1
// CHECK_CORE2_M32: #define __SSE2__ 1
@@ -319,6 +358,7 @@
// CHECK_CORE2_M32: #define __tune_core2__ 1
// CHECK_CORE2_M32: #define i386 1
// RUN: %clang -march=core2 -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_CORE2_M64
// CHECK_CORE2_M64: #define __MMX__ 1
// CHECK_CORE2_M64: #define __SSE2_MATH__ 1
@@ -336,6 +376,7 @@
// CHECK_CORE2_M64: #define __x86_64__ 1
//
// RUN: %clang -march=corei7 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_COREI7_M32
// CHECK_COREI7_M32: #define __MMX__ 1
// CHECK_COREI7_M32: #define __SSE2__ 1
@@ -351,6 +392,7 @@
// CHECK_COREI7_M32: #define __tune_corei7__ 1
// CHECK_COREI7_M32: #define i386 1
// RUN: %clang -march=corei7 -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_COREI7_M64
// CHECK_COREI7_M64: #define __MMX__ 1
// CHECK_COREI7_M64: #define __SSE2_MATH__ 1
@@ -370,6 +412,7 @@
// CHECK_COREI7_M64: #define __x86_64__ 1
//
// RUN: %clang -march=corei7-avx -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_COREI7_AVX_M32
// CHECK_COREI7_AVX_M32: #define __AES__ 1
// CHECK_COREI7_AVX_M32: #define __AVX__ 1
@@ -387,6 +430,7 @@
// CHECK_COREI7_AVX_M32: #define __tune_corei7__ 1
// CHECK_COREI7_AVX_M32: #define i386 1
// RUN: %clang -march=corei7-avx -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_COREI7_AVX_M64
// CHECK_COREI7_AVX_M64: #define __AES__ 1
// CHECK_COREI7_AVX_M64: #define __AVX__ 1
@@ -408,6 +452,7 @@
// CHECK_COREI7_AVX_M64: #define __x86_64__ 1
//
// RUN: %clang -march=core-avx-i -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_CORE_AVX_I_M32
// CHECK_CORE_AVX_I_M32: #define __AES__ 1
// CHECK_CORE_AVX_I_M32: #define __AVX__ 1
@@ -425,6 +470,7 @@
// CHECK_CORE_AVX_I_M32: #define __tune_corei7__ 1
// CHECK_CORE_AVX_I_M32: #define i386 1
// RUN: %clang -march=core-avx-i -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_CORE_AVX_I_M64
// CHECK_CORE_AVX_I_M64: #define __AES__ 1
// CHECK_CORE_AVX_I_M64: #define __AVX__ 1
@@ -446,6 +492,7 @@
// CHECK_CORE_AVX_I_M64: #define __x86_64__ 1
//
// RUN: %clang -march=atom -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATOM_M32
// CHECK_ATOM_M32: #define __MMX__ 1
// CHECK_ATOM_M32: #define __SSE2__ 1
@@ -459,6 +506,7 @@
// CHECK_ATOM_M32: #define __tune_atom__ 1
// CHECK_ATOM_M32: #define i386 1
// RUN: %clang -march=atom -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATOM_M64
// CHECK_ATOM_M64: #define __MMX__ 1
// CHECK_ATOM_M64: #define __SSE2_MATH__ 1
@@ -476,6 +524,7 @@
// CHECK_ATOM_M64: #define __x86_64__ 1
//
// RUN: %clang -march=geode -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_GEODE_M32
// CHECK_GEODE_M32: #define __3dNOW_A__ 1
// CHECK_GEODE_M32: #define __3dNOW__ 1
@@ -487,10 +536,12 @@
// CHECK_GEODE_M32: #define __tune_geode__ 1
// CHECK_GEODE_M32: #define i386 1
// RUN: %clang -march=geode -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_GEODE_M64
// CHECK_GEODE_M64: error:
//
// RUN: %clang -march=k6 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_K6_M32
// CHECK_K6_M32: #define __MMX__ 1
// CHECK_K6_M32: #define __i386 1
@@ -500,10 +551,12 @@
// CHECK_K6_M32: #define __tune_k6__ 1
// CHECK_K6_M32: #define i386 1
// RUN: %clang -march=k6 -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_K6_M64
// CHECK_K6_M64: error:
//
// RUN: %clang -march=k6-2 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_K6_2_M32
// CHECK_K6_2_M32: #define __3dNOW__ 1
// CHECK_K6_2_M32: #define __MMX__ 1
@@ -516,10 +569,12 @@
// CHECK_K6_2_M32: #define __tune_k6__ 1
// CHECK_K6_2_M32: #define i386 1
// RUN: %clang -march=k6-2 -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_K6_2_M64
// CHECK_K6_2_M64: error:
//
// RUN: %clang -march=k6-3 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_K6_3_M32
// CHECK_K6_3_M32: #define __3dNOW__ 1
// CHECK_K6_3_M32: #define __MMX__ 1
@@ -532,10 +587,12 @@
// CHECK_K6_3_M32: #define __tune_k6__ 1
// CHECK_K6_3_M32: #define i386 1
// RUN: %clang -march=k6-3 -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_K6_3_M64
// CHECK_K6_3_M64: error:
//
// RUN: %clang -march=athlon -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_M32
// CHECK_ATHLON_M32: #define __3dNOW_A__ 1
// CHECK_ATHLON_M32: #define __3dNOW__ 1
@@ -547,10 +604,12 @@
// CHECK_ATHLON_M32: #define __tune_athlon__ 1
// CHECK_ATHLON_M32: #define i386 1
// RUN: %clang -march=athlon -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_M64
// CHECK_ATHLON_M64: error:
//
// RUN: %clang -march=athlon-tbird -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_TBIRD_M32
// CHECK_ATHLON_TBIRD_M32: #define __3dNOW_A__ 1
// CHECK_ATHLON_TBIRD_M32: #define __3dNOW__ 1
@@ -562,10 +621,12 @@
// CHECK_ATHLON_TBIRD_M32: #define __tune_athlon__ 1
// CHECK_ATHLON_TBIRD_M32: #define i386 1
// RUN: %clang -march=athlon-tbird -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_TBIRD_M64
// CHECK_ATHLON_TBIRD_M64: error:
//
// RUN: %clang -march=athlon-4 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_4_M32
// CHECK_ATHLON_4_M32: #define __3dNOW_A__ 1
// CHECK_ATHLON_4_M32: #define __3dNOW__ 1
@@ -580,10 +641,12 @@
// CHECK_ATHLON_4_M32: #define __tune_athlon_sse__ 1
// CHECK_ATHLON_4_M32: #define i386 1
// RUN: %clang -march=athlon-4 -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_4_M64
// CHECK_ATHLON_4_M64: error:
//
// RUN: %clang -march=athlon-xp -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_XP_M32
// CHECK_ATHLON_XP_M32: #define __3dNOW_A__ 1
// CHECK_ATHLON_XP_M32: #define __3dNOW__ 1
@@ -598,10 +661,12 @@
// CHECK_ATHLON_XP_M32: #define __tune_athlon_sse__ 1
// CHECK_ATHLON_XP_M32: #define i386 1
// RUN: %clang -march=athlon-xp -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_XP_M64
// CHECK_ATHLON_XP_M64: error:
//
// RUN: %clang -march=athlon-mp -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_MP_M32
// CHECK_ATHLON_MP_M32: #define __3dNOW_A__ 1
// CHECK_ATHLON_MP_M32: #define __3dNOW__ 1
@@ -616,10 +681,12 @@
// CHECK_ATHLON_MP_M32: #define __tune_athlon_sse__ 1
// CHECK_ATHLON_MP_M32: #define i386 1
// RUN: %clang -march=athlon-mp -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_MP_M64
// CHECK_ATHLON_MP_M64: error:
//
// RUN: %clang -march=x86-64 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_X86_64_M32
// CHECK_X86_64_M32: #define __MMX__ 1
// CHECK_X86_64_M32: #define __SSE2__ 1
@@ -630,6 +697,7 @@
// CHECK_X86_64_M32: #define __k8__ 1
// CHECK_X86_64_M32: #define i386 1
// RUN: %clang -march=x86-64 -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_X86_64_M64
// CHECK_X86_64_M64: #define __MMX__ 1
// CHECK_X86_64_M64: #define __SSE2_MATH__ 1
@@ -644,6 +712,7 @@
// CHECK_X86_64_M64: #define __x86_64__ 1
//
// RUN: %clang -march=k8 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_K8_M32
// CHECK_K8_M32: #define __3dNOW_A__ 1
// CHECK_K8_M32: #define __3dNOW__ 1
@@ -657,6 +726,7 @@
// CHECK_K8_M32: #define __tune_k8__ 1
// CHECK_K8_M32: #define i386 1
// RUN: %clang -march=k8 -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_K8_M64
// CHECK_K8_M64: #define __3dNOW_A__ 1
// CHECK_K8_M64: #define __3dNOW__ 1
@@ -674,6 +744,7 @@
// CHECK_K8_M64: #define __x86_64__ 1
//
// RUN: %clang -march=k8-sse3 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_K8_SSE3_M32
// CHECK_K8_SSE3_M32: #define __3dNOW_A__ 1
// CHECK_K8_SSE3_M32: #define __3dNOW__ 1
@@ -688,6 +759,7 @@
// CHECK_K8_SSE3_M32: #define __tune_k8__ 1
// CHECK_K8_SSE3_M32: #define i386 1
// RUN: %clang -march=k8-sse3 -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_K8_SSE3_M64
// CHECK_K8_SSE3_M64: #define __3dNOW_A__ 1
// CHECK_K8_SSE3_M64: #define __3dNOW__ 1
@@ -706,6 +778,7 @@
// CHECK_K8_SSE3_M64: #define __x86_64__ 1
//
// RUN: %clang -march=opteron -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_OPTERON_M32
// CHECK_OPTERON_M32: #define __3dNOW_A__ 1
// CHECK_OPTERON_M32: #define __3dNOW__ 1
@@ -719,6 +792,7 @@
// CHECK_OPTERON_M32: #define __tune_k8__ 1
// CHECK_OPTERON_M32: #define i386 1
// RUN: %clang -march=opteron -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_OPTERON_M64
// CHECK_OPTERON_M64: #define __3dNOW_A__ 1
// CHECK_OPTERON_M64: #define __3dNOW__ 1
@@ -736,6 +810,7 @@
// CHECK_OPTERON_M64: #define __x86_64__ 1
//
// RUN: %clang -march=opteron-sse3 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_OPTERON_SSE3_M32
// CHECK_OPTERON_SSE3_M32: #define __3dNOW_A__ 1
// CHECK_OPTERON_SSE3_M32: #define __3dNOW__ 1
@@ -750,6 +825,7 @@
// CHECK_OPTERON_SSE3_M32: #define __tune_k8__ 1
// CHECK_OPTERON_SSE3_M32: #define i386 1
// RUN: %clang -march=opteron-sse3 -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_OPTERON_SSE3_M64
// CHECK_OPTERON_SSE3_M64: #define __3dNOW_A__ 1
// CHECK_OPTERON_SSE3_M64: #define __3dNOW__ 1
@@ -768,6 +844,7 @@
// CHECK_OPTERON_SSE3_M64: #define __x86_64__ 1
//
// RUN: %clang -march=athlon64 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON64_M32
// CHECK_ATHLON64_M32: #define __3dNOW_A__ 1
// CHECK_ATHLON64_M32: #define __3dNOW__ 1
@@ -781,6 +858,7 @@
// CHECK_ATHLON64_M32: #define __tune_k8__ 1
// CHECK_ATHLON64_M32: #define i386 1
// RUN: %clang -march=athlon64 -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON64_M64
// CHECK_ATHLON64_M64: #define __3dNOW_A__ 1
// CHECK_ATHLON64_M64: #define __3dNOW__ 1
@@ -798,6 +876,7 @@
// CHECK_ATHLON64_M64: #define __x86_64__ 1
//
// RUN: %clang -march=athlon64-sse3 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON64_SSE3_M32
// CHECK_ATHLON64_SSE3_M32: #define __3dNOW_A__ 1
// CHECK_ATHLON64_SSE3_M32: #define __3dNOW__ 1
@@ -812,6 +891,7 @@
// CHECK_ATHLON64_SSE3_M32: #define __tune_k8__ 1
// CHECK_ATHLON64_SSE3_M32: #define i386 1
// RUN: %clang -march=athlon64-sse3 -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON64_SSE3_M64
// CHECK_ATHLON64_SSE3_M64: #define __3dNOW_A__ 1
// CHECK_ATHLON64_SSE3_M64: #define __3dNOW__ 1
@@ -830,6 +910,7 @@
// CHECK_ATHLON64_SSE3_M64: #define __x86_64__ 1
//
// RUN: %clang -march=athlon-fx -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_FX_M32
// CHECK_ATHLON_FX_M32: #define __3dNOW_A__ 1
// CHECK_ATHLON_FX_M32: #define __3dNOW__ 1
@@ -843,6 +924,7 @@
// CHECK_ATHLON_FX_M32: #define __tune_k8__ 1
// CHECK_ATHLON_FX_M32: #define i386 1
// RUN: %clang -march=athlon-fx -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_FX_M64
// CHECK_ATHLON_FX_M64: #define __3dNOW_A__ 1
// CHECK_ATHLON_FX_M64: #define __3dNOW__ 1
Modified: cfe/branches/tooling/test/Rewriter/objc-modern-boxing.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Rewriter/objc-modern-boxing.mm?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/Rewriter/objc-modern-boxing.mm (original)
+++ cfe/branches/tooling/test/Rewriter/objc-modern-boxing.mm Tue May 15 13:51:08 2012
@@ -54,6 +54,9 @@
NSNumber *piFloat = @(3.141592654F); // equivalent to [NSNumber numberWithFloat:(3.141592654F)]
NSNumber *piDouble = @(3.1415926535); // equivalent to [NSNumber numberWithDouble:(3.1415926535)]
+ BOOL b;
+ NSNumber *nsb = @(b);
+
// Strings.
NSString *duplicateString = @(strdup("Hello"));
}
@@ -65,4 +68,5 @@
// CHECK: NSNumber *fortyTwoLongLong = ((NSNumber *(*)(id, SEL, long long))(void *)objc_msgSend)(objc_getClass("NSNumber"), sel_registerName("numberWithLongLong:"), (42LL));
// CHECK: NSNumber *piFloat = ((NSNumber *(*)(id, SEL, float))(void *)objc_msgSend)(objc_getClass("NSNumber"), sel_registerName("numberWithFloat:"), (3.1415927));
// CHECK: NSNumber *piDouble = ((NSNumber *(*)(id, SEL, double))(void *)objc_msgSend)(objc_getClass("NSNumber"), sel_registerName("numberWithDouble:"), (3.1415926535));
+// CHECK: NSNumber *nsb = ((NSNumber *(*)(id, SEL, BOOL))(void *)objc_msgSend)(objc_getClass("NSNumber"), sel_registerName("numberWithBool:"), (BOOL)(b));
// CHECK: NSString *duplicateString = ((NSString *(*)(id, SEL, const char *))(void *)objc_msgSend)(objc_getClass("NSString"), sel_registerName("stringWithUTF8String:"), (const char *)(strdup("Hello")));
Modified: cfe/branches/tooling/test/Sema/array-bounds-ptr-arith.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/array-bounds-ptr-arith.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/array-bounds-ptr-arith.c (original)
+++ cfe/branches/tooling/test/Sema/array-bounds-ptr-arith.c Tue May 15 13:51:08 2012
@@ -19,3 +19,21 @@
int a[10];
int *p = a - s->n;
}
+
+// Test case reduced from <rdar://problem/11387038>. This resulted in
+// an assertion failure because of the typedef instead of an explicit
+// constant array type.
+struct RDar11387038 {};
+typedef struct RDar11387038 RDar11387038Array[1];
+struct RDar11387038_Table {
+ RDar11387038Array z;
+};
+typedef struct RDar11387038_Table * TPtr;
+typedef TPtr *TabHandle;
+struct RDar11387038_B { TabHandle x; };
+typedef struct RDar11387038_B RDar11387038_B;
+
+void radar11387038() {
+ RDar11387038_B *pRDar11387038_B;
+ struct RDar11387038* y = &(*pRDar11387038_B->x)->z[4];
+}
Modified: cfe/branches/tooling/test/Sema/array-init.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/array-init.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/array-init.c (original)
+++ cfe/branches/tooling/test/Sema/array-init.c Tue May 15 13:51:08 2012
@@ -50,7 +50,7 @@
static long x2[3] = { 1.0,
"abc", // expected-warning{{incompatible pointer to integer conversion initializing 'long' with an expression of type 'char [4]'}}
- 5.8 }; // expected-warning {{implicit conversion turns literal floating-point number into integer}}
+ 5.8 }; // expected-warning {{implicit conversion from 'double' to 'long' changes value from 5.8 to 5}}
}
void test() {
Modified: cfe/branches/tooling/test/Sema/attr-aligned.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/attr-aligned.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/attr-aligned.c (original)
+++ cfe/branches/tooling/test/Sema/attr-aligned.c Tue May 15 13:51:08 2012
@@ -32,7 +32,7 @@
char d1[__alignof__(d) == 2 ?: -1] = {0};
char d2[__alignof__(d.member) == 2 ?: -1] = {0};
-struct E { int member __attribute__((aligned(2))); } __attribute__((packed));
+struct E { int member __attribute__((align(2))); } __attribute__((packed));
struct E e;
char e1[__alignof__(e) == 2 ?: -1] = {0};
char e2[__alignof__(e.member) == 2 ?: -1] = {0};
Modified: cfe/branches/tooling/test/Sema/attr-section.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/attr-section.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/attr-section.c (original)
+++ cfe/branches/tooling/test/Sema/attr-section.c Tue May 15 13:51:08 2012
@@ -13,3 +13,7 @@
__attribute__((section("NEAR,x"))) int n1; // expected-error {{'section' attribute is not valid on local variables}}
__attribute__((section("NEAR,x"))) static int n2; // ok.
}
+
+// pr9356
+void __attribute__((section("foo,zed"))) test2(void); // expected-note {{previous attribute is here}}
+void __attribute__((section("bar,zed"))) test2(void) {} // expected-warning {{section does not match previous declaration}}
Modified: cfe/branches/tooling/test/Sema/attr-visibility.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/attr-visibility.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/attr-visibility.c (original)
+++ cfe/branches/tooling/test/Sema/attr-visibility.c Tue May 15 13:51:08 2012
@@ -17,3 +17,8 @@
void test6() __attribute__((visibility("hidden"), // expected-note {{previous attribute is here}}
visibility("default"))); // expected-error {{visibility does not match previous declaration}}
+
+extern int test7 __attribute__((visibility("default"))); // expected-note {{previous attribute is here}}
+extern int test7 __attribute__((visibility("hidden"))); // expected-error {{visibility does not match previous declaration}}
+
+typedef int __attribute__((visibility("default"))) bar; // expected-warning {{visibility attribute ignored}}
Modified: cfe/branches/tooling/test/Sema/dllimport-dllexport.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/dllimport-dllexport.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/dllimport-dllexport.c (original)
+++ cfe/branches/tooling/test/Sema/dllimport-dllexport.c Tue May 15 13:51:08 2012
@@ -38,3 +38,6 @@
void __attribute__((dllimport)) foo13(); // expected-warning{{dllimport attribute ignored}}
void __attribute__((dllexport)) foo13();
+
+extern int foo14 __attribute__((dllexport));
+extern int foo14 __attribute__((dllimport)); // expected-warning{{dllimport attribute ignored}}
Modified: cfe/branches/tooling/test/Sema/exprs.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/exprs.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/exprs.c (original)
+++ cfe/branches/tooling/test/Sema/exprs.c Tue May 15 13:51:08 2012
@@ -162,11 +162,20 @@
x = sizeof(x/0); // no warning.
}
-// PR6501
+// PR6501 & PR11857
void test18_a(int a); // expected-note 2 {{'test18_a' declared here}}
+void test18_b(int); // expected-note {{'test18_b' declared here}}
+void test18_c(int a, int b); // expected-note 2 {{'test18_c' declared here}}
+void test18_d(int a, ...); // expected-note {{'test18_d' declared here}}
+void test18_e(int a, int b, ...); // expected-note {{'test18_e' declared here}}
void test18(int b) {
- test18_a(b, b); // expected-error {{too many arguments to function call, expected 1, have 2}}
- test18_a(); // expected-error {{too few arguments to function call, expected 1, have 0}}
+ test18_a(b, b); // expected-error {{too many arguments to function call, expected single argument 'a', have 2}}
+ test18_a(); // expected-error {{too few arguments to function call, single argument 'a' was not specified}}
+ test18_b(); // expected-error {{too few arguments to function call, expected 1, have 0}}
+ test18_c(b); // expected-error {{too few arguments to function call, expected 2, have 1}}
+ test18_c(b, b, b); // expected-error {{too many arguments to function call, expected 2, have 3}}
+ test18_d(); // expected-error {{too few arguments to function call, at least argument 'a' must be specified}}
+ test18_e(); // expected-error {{too few arguments to function call, expected at least 2, have 0}}
}
// PR7569
Modified: cfe/branches/tooling/test/Sema/format-strings.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/format-strings.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/format-strings.c (original)
+++ cfe/branches/tooling/test/Sema/format-strings.c Tue May 15 13:51:08 2012
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -verify -Wformat-nonliteral -isystem %S/Inputs %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wformat-nonliteral -isystem %S/Inputs -fno-signed-char %s
#define __need_wint_t
#include <stdarg.h>
@@ -499,6 +500,10 @@
printf(kFormat17, (int[]){0}); // expected-warning{{format specifies type 'unsigned short' but the argument}}
printf("%a", (long double)0); // expected-warning{{format specifies type 'double' but the argument has type 'long double'}}
+
+ // Test braced char[] initializers.
+ const char kFormat18[] = { "%lld" }; // expected-note{{format string is defined here}}}
+ printf(kFormat18, 0); // expected-warning{{format specifies type}}
}
// PR 9466: clang: doesn't know about %Lu, %Ld, and %Lx
@@ -530,3 +535,25 @@
void test_unused_system_args(int x) {
PRINT1("%d\n", x); // no-warning{{extra argument is system header is OK}}
}
+
+void pr12761(char c) {
+ // This should not warn even with -fno-signed-char.
+ printf("%hhx", c);
+}
+
+
+// Test that we correctly merge the format in both orders.
+extern void test14_foo(const char *, const char *, ...)
+ __attribute__((__format__(__printf__, 1, 3)));
+extern void test14_foo(const char *, const char *, ...)
+ __attribute__((__format__(__scanf__, 2, 3)));
+
+extern void test14_bar(const char *, const char *, ...)
+ __attribute__((__format__(__scanf__, 2, 3)));
+extern void test14_bar(const char *, const char *, ...)
+ __attribute__((__format__(__printf__, 1, 3)));
+
+void test14_zed(int *p) {
+ test14_foo("%", "%d", p); // expected-warning{{incomplete format specifier}}
+ test14_bar("%", "%d", p); // expected-warning{{incomplete format specifier}}
+}
Modified: cfe/branches/tooling/test/Sema/implicit-builtin-decl.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/implicit-builtin-decl.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/implicit-builtin-decl.c (original)
+++ cfe/branches/tooling/test/Sema/implicit-builtin-decl.c Tue May 15 13:51:08 2012
@@ -55,3 +55,5 @@
// PR8316
void longjmp(); // expected-warning{{declaration of built-in function 'longjmp' requires inclusion of the header <setjmp.h>}}
+
+extern float fmaxf(float, float);
Modified: cfe/branches/tooling/test/Sema/knr-def-call.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/Sema/knr-def-call.c?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/Sema/knr-def-call.c (original)
+++ cfe/branches/tooling/test/Sema/knr-def-call.c Tue May 15 13:51:08 2012
@@ -36,6 +36,6 @@
}
void use_proto() {
- proto(42.1); // expected-warning{{implicit conversion turns literal floating-point number into integer}}
- (&proto)(42.1); // expected-warning{{implicit conversion turns literal floating-point number into integer}}
+ proto(42.1); // expected-warning{{implicit conversion from 'double' to 'int' changes value from 42.1 to 42}}
+ (&proto)(42.1); // expected-warning{{implicit conversion from 'double' to 'int' changes value from 42.1 to 42}}
}
Modified: cfe/branches/tooling/test/SemaCXX/PR10243.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/PR10243.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/PR10243.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/PR10243.cpp Tue May 15 13:51:08 2012
@@ -9,12 +9,12 @@
struct T1 {
S s; // expected-error{{field has incomplete type 'S'}}
- T1(T1&) = default;
+ T1(const T1&) = default;
};
struct T2 {
S s; // expected-error{{field has incomplete type 'S'}}
- T2& operator=(T2&) = default;
+ T2& operator=(const T2&) = default;
};
struct T3 {
Modified: cfe/branches/tooling/test/SemaCXX/altivec.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/altivec.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/altivec.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/altivec.cpp Tue May 15 13:51:08 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -faltivec -fno-lax-vector-conversions -triple powerpc-unknown-unknown -verify %s
+// RUN: %clang_cc1 -faltivec -fno-lax-vector-conversions -triple powerpc-unknown-unknown -fcxx-exceptions -verify %s
typedef int V4i __attribute__((vector_size(16)));
@@ -76,3 +76,8 @@
vector float initFloat = (vector float)(Struct().f); // expected-error {{did you mean to call it}}
vector int initInt = (vector int)(Struct().n); // expected-error {{did you mean to call it}}
}
+
+void f() {
+ try {}
+ catch (vector pixel px) {}
+};
Modified: cfe/branches/tooling/test/SemaCXX/bool.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/bool.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/bool.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/bool.cpp Tue May 15 13:51:08 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-constant-conversion %s
// Bool literals can be enum values.
enum {
Modified: cfe/branches/tooling/test/SemaCXX/constant-expression-cxx11.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/constant-expression-cxx11.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/constant-expression-cxx11.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/constant-expression-cxx11.cpp Tue May 15 13:51:08 2012
@@ -1258,3 +1258,11 @@
auto& b = y.b;
}
}
+
+// Indirectly test that an implicit lvalue to xvalue conversion performed for
+// an NRVO move operation isn't implemented as CK_LValueToRValue.
+namespace PR12826 {
+ struct Foo {};
+ constexpr Foo id(Foo x) { return x; }
+ constexpr Foo res(id(Foo()));
+}
Modified: cfe/branches/tooling/test/SemaCXX/conversion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/conversion.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/conversion.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/conversion.cpp Tue May 15 13:51:08 2012
@@ -65,7 +65,7 @@
int c = ((((NULL)))); // expected-warning {{implicit conversion of NULL constant to 'int'}}
int d;
d = ((((NULL)))); // expected-warning {{implicit conversion of NULL constant to 'int'}}
- bool bl = NULL; // FIXME: this should warn but we currently suppress a bunch of conversion-to-bool warnings including this one
+ bool bl = NULL; // expected-warning {{implicit conversion of NULL constant to 'bool'}}
char ch = NULL; // expected-warning {{implicit conversion of NULL constant to 'char'}}
unsigned char uch = NULL; // expected-warning {{implicit conversion of NULL constant to 'unsigned char'}}
short sh = NULL; // expected-warning {{implicit conversion of NULL constant to 'short'}}
@@ -104,3 +104,12 @@
tmpl2<int*>();
}
}
+
+namespace test5 {
+ template<int I>
+ void func() {
+ bool b = I;
+ }
+
+ template void func<3>();
+}
Modified: cfe/branches/tooling/test/SemaCXX/cxx0x-cursory-default-delete.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/cxx0x-cursory-default-delete.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/cxx0x-cursory-default-delete.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/cxx0x-cursory-default-delete.cpp Tue May 15 13:51:08 2012
@@ -7,11 +7,14 @@
};
struct non_const_copy {
- non_const_copy(non_const_copy&) = default; // expected-note {{not viable}}
- non_const_copy& operator = (non_const_copy&) & = default; // expected-note {{not viable}}
- non_const_copy& operator = (non_const_copy&) && = default; // expected-note {{not viable}}
+ non_const_copy(non_const_copy&);
+ non_const_copy& operator = (non_const_copy&) &;
+ non_const_copy& operator = (non_const_copy&) &&;
non_const_copy() = default; // expected-note {{not viable}}
};
+non_const_copy::non_const_copy(non_const_copy&) = default; // expected-note {{not viable}}
+non_const_copy& non_const_copy::operator = (non_const_copy&) & = default; // expected-note {{not viable}}
+non_const_copy& non_const_copy::operator = (non_const_copy&) && = default; // expected-note {{not viable}}
void fn1 () {
non_copiable nc;
@@ -32,9 +35,9 @@
};
struct bad_decls {
- bad_decls(volatile bad_decls&) = default; // expected-error {{may not be volatile}}
- bad_decls&& operator = (bad_decls) = default; // expected-error 2{{lvalue reference}}
- bad_decls& operator = (volatile bad_decls&) = default; // expected-error {{may not be volatile}}
+ bad_decls(volatile bad_decls&) = default; // expected-error {{may not be volatile}} expected-error {{must be defaulted outside the class}}
+ bad_decls&& operator = (bad_decls) = default; // expected-error {{lvalue reference}} expected-error {{must return 'bad_decls &'}}
+ bad_decls& operator = (volatile bad_decls&) = default; // expected-error {{may not be volatile}} expected-error {{must be defaulted outside the class}}
bad_decls& operator = (const bad_decls&) const = default; // expected-error {{may not have 'const', 'constexpr' or 'volatile' qualifiers}}
};
@@ -72,4 +75,3 @@
// (but not normal definitions)
struct S { S(); };
S::S() __attribute((pure)) = default;
-
Modified: cfe/branches/tooling/test/SemaCXX/cxx0x-defaulted-functions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/cxx0x-defaulted-functions.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/cxx0x-defaulted-functions.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/cxx0x-defaulted-functions.cpp Tue May 15 13:51:08 2012
@@ -6,26 +6,26 @@
foo() = default;
foo(const foo&) = default;
- foo(foo&) = default;
+ foo(foo&&) = default;
foo& operator = (const foo&) = default;
- foo& operator = (foo&) = default;
+ foo& operator = (foo&&) = default;
~foo() = default;
};
struct bar {
bar();
bar(const bar&);
- bar(bar&);
+ bar(bar&&);
bar& operator = (const bar&);
- bar& operator = (bar&);
+ bar& operator = (bar&&);
~bar();
};
bar::bar() = default;
bar::bar(const bar&) = default;
-bar::bar(bar&) = default;
+bar::bar(bar&&) = default;
bar& bar::operator = (const bar&) = default;
-bar& bar::operator = (bar&) = default;
+bar& bar::operator = (bar&&) = default;
bar::~bar() = default;
static_assert(__is_trivial(foo), "foo should be trivial");
Modified: cfe/branches/tooling/test/SemaCXX/default1.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/default1.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/default1.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/default1.cpp Tue May 15 13:51:08 2012
@@ -47,6 +47,13 @@
void j (int f = 4);
{
void j (int f); // expected-note{{'j' declared here}}
- j(); // expected-error{{too few arguments to function call, expected 1, have 0}}
+ j(); // expected-error{{too few arguments to function call, single argument 'f' was not specified}}
+ }
+}
+
+int i2() {
+ void j(int f = 4); // expected-note{{'j' declared here}}
+ {
+ j(2, 3); // expected-error{{too many arguments to function call, expected at most single argument 'f', have 2}}
}
}
Modified: cfe/branches/tooling/test/SemaCXX/expressions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/expressions.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/expressions.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/expressions.cpp Tue May 15 13:51:08 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-constant-conversion %s
void choice(int);
int choice(bool);
Modified: cfe/branches/tooling/test/SemaCXX/member-init.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/member-init.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/member-init.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/member-init.cpp Tue May 15 13:51:08 2012
@@ -28,7 +28,7 @@
const int C = 0, D = 0;
struct S {
int as[] = { decltype(x)::B<C, D>(0) }; // expected-error {{array bound cannot be deduced from an in-class initializer}}
- T<sizeof(as) / sizeof(int)> x; // expected-error {{requires a type specifier}}
+ T<sizeof(as) / sizeof(int)> x;
// test that we handle invalid array bound deductions without crashing when the declarator name is itself invalid
operator int[](){}; // expected-error {{'operator int' cannot be the name of a variable or data member}} \
// expected-error {{array bound cannot be deduced from an in-class initializer}}
Modified: cfe/branches/tooling/test/SemaCXX/overload-call.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/overload-call.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/overload-call.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/overload-call.cpp Tue May 15 13:51:08 2012
@@ -233,7 +233,7 @@
void intref_test() {
float* ir1 = intref(5);
- float* ir2 = intref(5.5); // expected-warning{{implicit conversion turns literal floating-point number into integer}}
+ float* ir2 = intref(5.5); // expected-warning{{implicit conversion from 'double' to 'int' changes value from 5.5 to 5}}
}
void derived5(C&); // expected-note{{candidate function not viable: cannot bind base class object of type 'A' to derived class reference 'C &' for 1st argument}}
@@ -319,14 +319,20 @@
namespace test1 {
template <class T> void foo(T t, unsigned N); // expected-note {{candidate function [with T = int] not viable: no known conversion from 'const char [6]' to 'unsigned int' for 2nd argument}}
void foo(int n, char N); // expected-note {{candidate function not viable: no known conversion from 'const char [6]' to 'char' for 2nd argument}}
- void foo(int n); // expected-note {{candidate function not viable: requires 1 argument, but 2 were provided}}
- void foo(unsigned n = 10); // expected-note {{candidate function not viable: requires at most 1 argument, but 2 were provided}}
void foo(int n, const char *s, int t); // expected-note {{candidate function not viable: requires 3 arguments, but 2 were provided}}
void foo(int n, const char *s, int t, ...); // expected-note {{candidate function not viable: requires at least 3 arguments, but 2 were provided}}
void foo(int n, const char *s, int t, int u = 0); // expected-note {{candidate function not viable: requires at least 3 arguments, but 2 were provided}}
+ // PR 11857
+ void foo(int n); // expected-note {{candidate function not viable: requires single argument 'n', but 2 arguments were provided}}
+ void foo(unsigned n = 10); // expected-note {{candidate function not viable: allows at most single argument 'n', but 2 arguments were provided}}
+ void bar(int n, int u = 0); // expected-note {{candidate function not viable: requires at least argument 'n', but no arguments were provided}}
+ void baz(int n = 0, int u = 0); // expected-note {{candidate function not viable: requires at most 2 arguments, but 3 were provided}}
+
void test() {
foo(4, "hello"); //expected-error {{no matching function for call to 'foo'}}
+ bar(); //expected-error {{no matching function for call to 'bar'}}
+ baz(3, 4, 5); // expected-error {{no matching function for call to 'baz'}}
}
}
Modified: cfe/branches/tooling/test/SemaCXX/overload-member-call.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/overload-member-call.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/overload-member-call.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/overload-member-call.cpp Tue May 15 13:51:08 2012
@@ -72,8 +72,6 @@
class A {
template <class T> void foo(T t, unsigned N); // expected-note {{candidate function [with T = int] not viable: no known conversion from 'const char [6]' to 'unsigned int' for 2nd argument}}
void foo(int n, char N); // expected-note {{candidate function not viable: no known conversion from 'const char [6]' to 'char' for 2nd argument}}
- void foo(int n); // expected-note {{candidate function not viable: requires 1 argument, but 2 were provided}}
- void foo(unsigned n = 10); // expected-note {{candidate function not viable: requires at most 1 argument, but 2 were provided}}
void foo(int n, const char *s, int t); // expected-note {{candidate function not viable: requires 3 arguments, but 2 were provided}}
void foo(int n, const char *s, int t, ...); // expected-note {{candidate function not viable: requires at least 3 arguments, but 2 were provided}}
void foo(int n, const char *s, int t, int u = 0); // expected-note {{candidate function not viable: requires at least 3 arguments, but 2 were provided}}
@@ -83,6 +81,14 @@
void baz(A &d); // expected-note {{candidate function not viable: 1st argument ('const test1::A') would lose const qualifier}}
void baz(int i); // expected-note {{candidate function not viable: no known conversion from 'const test1::A' to 'int' for 1st argument}}
+
+ // PR 11857
+ void foo(int n); // expected-note {{candidate function not viable: requires single argument 'n', but 2 arguments were provided}}
+ void foo(unsigned n = 10); // expected-note {{candidate function not viable: allows at most single argument 'n', but 2 arguments were provided}}
+ void rab(double n, int u = 0); // expected-note {{candidate function not viable: requires at least argument 'n', but no arguments were provided}}
+ void rab(int n, int u = 0); // expected-note {{candidate function not viable: requires at least argument 'n', but no arguments were provided}}
+ void zab(double n = 0.0, int u = 0); // expected-note {{candidate function not viable: requires at most 2 arguments, but 3 were provided}}
+ void zab(int n = 0, int u = 0); // expected-note {{candidate function not viable: requires at most 2 arguments, but 3 were provided}}
};
void test() {
@@ -93,6 +99,9 @@
b.bar(0); //expected-error {{no matching member function for call to 'bar'}}
a.baz(b); //expected-error {{no matching member function for call to 'baz'}}
+
+ a.rab(); //expected-error {{no matching member function for call to 'rab'}}
+ a.zab(3, 4, 5); //expected-error {{no matching member function for call to 'zab'}}
}
}
Modified: cfe/branches/tooling/test/SemaCXX/uninitialized.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/uninitialized.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/uninitialized.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/uninitialized.cpp Tue May 15 13:51:08 2012
@@ -10,9 +10,6 @@
int a = a; // no-warning: used to signal intended lack of initialization.
int b = b + 1; // expected-warning {{variable 'b' is uninitialized when used within its own initialization}}
int c = (c + c); // expected-warning 2 {{variable 'c' is uninitialized when used within its own initialization}}
-void test() {
- int d = ({ d + d ;}); // expected-warning {{variable 'd' is uninitialized when used within its own initialization}}
-}
int e = static_cast<long>(e) + 1; // expected-warning {{variable 'e' is uninitialized when used within its own initialization}}
int f = foo(f); // expected-warning {{variable 'f' is uninitialized when used within its own initialization}}
@@ -24,6 +21,51 @@
int j = far(j);
int k = __alignof__(k);
+int l = k ? l : l; // expected-warning 2{{variable 'l' is uninitialized when used within its own initialization}}
+int m = 1 + (k ? m : m); // expected-warning 2{{variable 'm' is uninitialized when used within its own initialization}}
+int n = -n; // expected-warning {{variable 'n' is uninitialized when used within its own initialization}}
+
+void test () {
+ int a = a; // no-warning: used to signal intended lack of initialization.
+ int b = b + 1; // expected-warning {{variable 'b' is uninitialized when used within its own initialization}}
+ int c = (c + c); // expected-warning {{variable 'c' is uninitialized when used within its own initialization}}
+ int d = ({ d + d ;}); // expected-warning {{variable 'd' is uninitialized when used within its own initialization}}
+ int e = static_cast<long>(e) + 1; // expected-warning {{variable 'e' is uninitialized when used within its own initialization}}
+ int f = foo(f); // expected-warning {{variable 'f' is uninitialized when used within its own initialization}}
+
+ // Thes don't warn as they don't require the value.
+ int g = sizeof(g);
+ void* ptr = &ptr;
+ int h = bar(&h);
+ int i = boo(i);
+ int j = far(j);
+ int k = __alignof__(k);
+
+ int l = k ? l : l; // FIXME: warn here
+ int m = 1 + (k ? m : m); // FIXME: warn here
+ int n = -n; // expected-warning {{variable 'n' is uninitialized when used within its own initialization}}
+
+ for (;;) {
+ int a = a; // no-warning: used to signal intended lack of initialization.
+ int b = b + 1; // expected-warning {{variable 'b' is uninitialized when used within its own initialization}}
+ int c = (c + c); // expected-warning {{variable 'c' is uninitialized when used within its own initialization}}
+ int d = ({ d + d ;}); // expected-warning {{variable 'd' is uninitialized when used within its own initialization}}
+ int e = static_cast<long>(e) + 1; // expected-warning {{variable 'e' is uninitialized when used within its own initialization}}
+ int f = foo(f); // expected-warning {{variable 'f' is uninitialized when used within its own initialization}}
+
+ // Thes don't warn as they don't require the value.
+ int g = sizeof(g);
+ void* ptr = &ptr;
+ int h = bar(&h);
+ int i = boo(i);
+ int j = far(j);
+ int k = __alignof__(k);
+
+ int l = k ? l : l; // FIXME: warn here
+ int m = 1 + (k ? m : m); // FIXME: warn here
+ int n = -n; // expected-warning {{variable 'n' is uninitialized when used within its own initialization}}
+ }
+}
// Test self-references with record types.
class A {
@@ -48,8 +90,9 @@
A getA() { return A(); }
A getA(int x) { return A(); }
A getA(A* a) { return A(); }
+A getA(A a) { return A(); }
-void setupA() {
+void setupA(bool x) {
A a1;
a1.set(a1.get());
A a2(a1.get());
@@ -69,6 +112,8 @@
A a15 = getA(a15.num); // expected-warning {{variable 'a15' is uninitialized when used within its own initialization}}
A a16(&a16.num); // expected-warning {{variable 'a16' is uninitialized when used within its own initialization}}
A a17(a17.get2()); // expected-warning {{variable 'a17' is uninitialized when used within its own initialization}}
+ A a18 = x ? a18 : a17; // expected-warning {{variable 'a18' is uninitialized when used within its own initialization}}
+ A a19 = getA(x ? a19 : a17); // expected-warning {{variable 'a19' is uninitialized when used within its own initialization}}
}
struct B {
@@ -97,6 +142,7 @@
B b7(b7); // expected-warning {{variable 'b7' is uninitialized when used within its own initialization}}
B b8 = getB(b8.x); // expected-warning {{variable 'b8' is uninitialized when used within its own initialization}}
B b9 = getB(b9.y); // expected-warning {{variable 'b9' is uninitialized when used within its own initialization}}
+ B b10 = getB(-b10.x); // expected-warning {{variable 'b10' is uninitialized when used within its own initialization}}
}
// Also test similar constructs in a field's initializer.
Modified: cfe/branches/tooling/test/SemaCXX/warn-literal-conversion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaCXX/warn-literal-conversion.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaCXX/warn-literal-conversion.cpp (original)
+++ cfe/branches/tooling/test/SemaCXX/warn-literal-conversion.cpp Tue May 15 13:51:08 2012
@@ -5,29 +5,29 @@
// Warn when a literal float or double is assigned or bound to an integer.
void test0() {
// Float
- int y0 = 1.2222F; // expected-warning {{implicit conversion turns literal floating-point number into integer}}
- int y1 = (1.2222F); // expected-warning {{implicit conversion turns literal floating-point number into integer}}
- int y2 = (((1.2222F))); // expected-warning {{implicit conversion turns literal floating-point number into integer}}
- int y3 = 12E-1F; // expected-warning {{implicit conversion turns literal floating-point number into integer}}
- int y4 = 1.23E1F; // expected-warning {{implicit conversion turns literal floating-point number into integer}}
+ int y0 = 1.2222F; // expected-warning {{implicit conversion from 'float' to 'int' changes value from 1.2222 to 1}}
+ int y1 = (1.2222F); // expected-warning {{implicit conversion from 'float' to 'int' changes value from 1.2222 to 1}}
+ int y2 = (((1.2222F))); // expected-warning {{implicit conversion from 'float' to 'int' changes value from 1.2222 to 1}}
+ int y3 = 12E-1F; // expected-warning {{implicit conversion from 'float' to 'int' changes value from 1.2 to 1}}
+ int y4 = 1.23E1F; // expected-warning {{implicit conversion from 'float' to 'int' changes value from 12.3 to 12}}
// Double
- int y5 = 1.2222; // expected-warning {{implicit conversion turns literal floating-point number into integer}}
- int y6 = 12E-1; // expected-warning {{implicit conversion turns literal floating-point number into integer}}
- int y7 = 1.23E1; // expected-warning {{implicit conversion turns literal floating-point number into integer}}
- int y8 = (1.23E1); // expected-warning {{implicit conversion turns literal floating-point number into integer}}
+ int y5 = 1.2222; // expected-warning {{implicit conversion from 'double' to 'int' changes value from 1.2222 to 1}}
+ int y6 = 12E-1; // expected-warning {{implicit conversion from 'double' to 'int' changes value from 1.2 to 1}}
+ int y7 = 1.23E1; // expected-warning {{implicit conversion from 'double' to 'int' changes value from 12.3 to 12}}
+ int y8 = (1.23E1); // expected-warning {{implicit conversion from 'double' to 'int' changes value from 12.3 to 12}}
// Test assignment to an existing variable.
- y8 = 2.22F; // expected-warning {{implicit conversion turns literal floating-point number into integer}}
+ y8 = 2.22F; // expected-warning {{implicit conversion from 'float' to 'int' changes value from 2.22 to 2}}
// Test direct initialization.
- int y9(1.23F); // expected-warning {{implicit conversion turns literal floating-point number into integer}}
+ int y9(1.23F); // expected-warning {{implicit conversion from 'float' to 'int' changes value from 1.23 to 1}}
// Test passing a literal floating-point value to a function that takes an integer.
- foo(1.2F); // expected-warning {{implicit conversion turns literal floating-point number into integer}}
+ foo(1.2F); // expected-warning {{implicit conversion from 'float' to 'int' changes value from 1.2 to 1}}
- int y10 = -1.2F; // expected-warning {{implicit conversion turns literal floating-point number into integer}}
+ int y10 = -1.2F; // expected-warning {{implicit conversion from 'float' to 'int' changes value from 1.2 to 1}}
- // -Wconversion-literal does NOT catch const values.
+ // -Wliteral-conversion does NOT catch const values.
// (-Wconversion DOES catch them.)
static const float sales_tax_rate = .095F;
int z = sales_tax_rate;
Propchange: cfe/branches/tooling/test/SemaCXX/warn-unreachable.cpp
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue May 15 13:51:08 2012
@@ -1,2 +1,2 @@
/cfe/branches/type-system-rewrite/test/SemaCXX/warn-unreachable.cpp:134693-134817
-/cfe/trunk/test/SemaCXX/warn-unreachable.cpp:121961,146581-156373
+/cfe/trunk/test/SemaCXX/warn-unreachable.cpp:121961,146581-156833
Modified: cfe/branches/tooling/test/SemaObjC/arc-property.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/arc-property.m?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/arc-property.m (original)
+++ cfe/branches/tooling/test/SemaObjC/arc-property.m Tue May 15 13:51:08 2012
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fobjc-runtime-has-weak -fsyntax-only -fobjc-arc -fblocks -verify -Wno-objc-root-class %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fobjc-runtime-has-weak -fsyntax-only -fobjc-arc -fblocks -fobjc-exceptions -verify -Wno-objc-root-class %s
// rdar://9309489
@interface MyClass {
@@ -55,3 +55,11 @@
@implementation Test2
@synthesize test2;
@end
+
+// rdar://problem/11144407
+ at interface Test3
+ at property (strong) id exception;
+ at end
+void test3(Test3 *t3) {
+ @throw t3.exception;
+}
Modified: cfe/branches/tooling/test/SemaObjC/boxing-illegal-types.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/boxing-illegal-types.m?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/boxing-illegal-types.m (original)
+++ cfe/branches/tooling/test/SemaObjC/boxing-illegal-types.m Tue May 15 13:51:08 2012
@@ -15,3 +15,7 @@
int numbers[] = { 0, 1, 2 };
id boxed_numbers = @(numbers); // expected-error {{illegal type 'int *' used in a boxed expression}}
}
+
+void testInvalid() {
+ @(not_defined); // expected-error {{use of undeclared identifier 'not_defined'}}
+}
Modified: cfe/branches/tooling/test/SemaObjC/id.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/id.m?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/id.m (original)
+++ cfe/branches/tooling/test/SemaObjC/id.m Tue May 15 13:51:08 2012
@@ -16,6 +16,16 @@
}
// Test attempt to redefine 'id' in an incompatible fashion.
-typedef int id; // FIXME: Decide how we want to deal with this (now that 'id' is more of a built-in type).
+// rdar://11356439
+typedef int id; // expected-error {{typedef redefinition with different types ('int' vs 'id')}}
id b;
+typedef double id; // expected-error {{typedef redefinition with different types ('double' vs 'id')}}
+
+typedef char *id; // expected-error {{typedef redefinition with different types ('char *' vs 'id')}}
+
+typedef union U{ int iu; } *id; // expected-error {{typedef redefinition with different types ('union U *' vs 'id')}}
+
+void test11356439(id o) {
+ o->x; // expected-error {{member reference base type 'id' is not a structure or union}}
+}
Modified: cfe/branches/tooling/test/SemaObjC/objc-literal-nsnumber.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/objc-literal-nsnumber.m?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/objc-literal-nsnumber.m (original)
+++ cfe/branches/tooling/test/SemaObjC/objc-literal-nsnumber.m Tue May 15 13:51:08 2012
@@ -83,3 +83,7 @@
BOOL radar11231426() {
return __objc_yes;
}
+
+id stringBoxingNoSuchMethod(const char *str) {
+ return @(str); // expected-error {{declaration of 'stringWithUTF8String:' is missing in NSString class}}
+}
Modified: cfe/branches/tooling/test/SemaObjC/objc-literal-sig.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/objc-literal-sig.m?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/objc-literal-sig.m (original)
+++ cfe/branches/tooling/test/SemaObjC/objc-literal-sig.m Tue May 15 13:51:08 2012
@@ -16,25 +16,36 @@
+ (NSNumber *)numberWithUnsignedLongLong:(unsigned long long)value;
+ (NSNumber *)numberWithFloat:(float)value;
+ (NSNumber *)numberWithDouble:(double)value;
-+ (int)numberWithBool:(BOOL)value; // expected-note{{method returns unexpected type 'int' (should be an object type)}}
++ (int)numberWithBool:(BOOL)value; // expected-note 2 {{method returns unexpected type 'int' (should be an object type)}}
+ at end
+
+ at interface NSString
++ (char)stringWithUTF8String:(const char *)value; // expected-note 2 {{method returns unexpected type 'char' (should be an object type)}}
@end
@interface NSArray
@end
@interface NSArray (NSArrayCreation)
-+ (id)arrayWithObjects:(const int [])objects // expected-note{{first parameter has unexpected type 'const int *' (should be 'const id *')}}
++ (id)arrayWithObjects:(const int [])objects // expected-note 2 {{first parameter has unexpected type 'const int *' (should be 'const id *')}}
count:(unsigned long)cnt;
@end
@interface NSDictionary
+ (id)dictionaryWithObjects:(const id [])objects
- forKeys:(const int [])keys // expected-note{{second parameter has unexpected type 'const int *' (should be 'const id *')}}
+ forKeys:(const int [])keys // expected-note 2 {{second parameter has unexpected type 'const int *' (should be 'const id *')}}
count:(unsigned long)cnt;
@end
+// All tests are doubled to make sure that a bad method is not saved
+// and then used un-checked.
void test_sig() {
(void)@__objc_yes; // expected-error{{literal construction method 'numberWithBool:' has incompatible signature}}
+ (void)@__objc_yes; // expected-error{{literal construction method 'numberWithBool:' has incompatible signature}}
id array = @[ @17 ]; // expected-error{{literal construction method 'arrayWithObjects:count:' has incompatible signature}}
+ id array2 = @[ @17 ]; // expected-error{{literal construction method 'arrayWithObjects:count:' has incompatible signature}}
id dict = @{ @"hello" : @17 }; // expected-error{{literal construction method 'dictionaryWithObjects:forKeys:count:' has incompatible signature}}
+ id dict2 = @{ @"hello" : @17 }; // expected-error{{literal construction method 'dictionaryWithObjects:forKeys:count:' has incompatible signature}}
+ id str = @("hello"); // expected-error{{literal construction method 'stringWithUTF8String:' has incompatible signature}}
+ id str2 = @("hello"); // expected-error{{literal construction method 'stringWithUTF8String:' has incompatible signature}}
}
Modified: cfe/branches/tooling/test/SemaObjC/property-ivar-mismatch.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaObjC/property-ivar-mismatch.m?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaObjC/property-ivar-mismatch.m (original)
+++ cfe/branches/tooling/test/SemaObjC/property-ivar-mismatch.m Tue May 15 13:51:08 2012
@@ -12,3 +12,15 @@
@synthesize prop = ivar; // expected-error {{type of property 'prop' ('int') does not match type of ivar 'ivar' ('char')}}
@end
+
+ at interface Test5
+{
+ void * _P; // expected-note {{ivar is declared here}}
+}
+ at property int P;
+ at end
+
+ at implementation Test5
+ at synthesize P=_P; // expected-error {{ype of property 'P' ('int') does not match type of ivar '_P' ('void *')}}
+ at end
+
Modified: cfe/branches/tooling/test/SemaTemplate/dependent-base-classes.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaTemplate/dependent-base-classes.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaTemplate/dependent-base-classes.cpp (original)
+++ cfe/branches/tooling/test/SemaTemplate/dependent-base-classes.cpp Tue May 15 13:51:08 2012
@@ -32,8 +32,7 @@
template <class TT>
struct FI2
{
- C<typename FI2::type> a; // expected-error{{no type named 'type' in 'FI2<TT>'}} \
- // expected-error{{C++ requires a type specifier for all declarations}}
+ C<typename FI2::type> a; // expected-error{{no type named 'type' in 'FI2<TT>'}}
};
template<typename T>
Modified: cfe/branches/tooling/test/SemaTemplate/member-template-access-expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaTemplate/member-template-access-expr.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaTemplate/member-template-access-expr.cpp (original)
+++ cfe/branches/tooling/test/SemaTemplate/member-template-access-expr.cpp Tue May 15 13:51:08 2012
@@ -60,7 +60,7 @@
void test_X1(X1 x1) {
float *fp1 = x1.f1<>(17);
- float *fp2 = x1.f1<int>(3.14); // expected-warning {{implicit conversion turns literal floating-point number into integer}}
+ float *fp2 = x1.f1<int>(3.14); // expected-warning {{implicit conversion from 'double' to 'int' changes value from 3.14 to 3}}
int *ip1 = x1.f1(17);
float *ip2 = x1.f1(3.14);
Modified: cfe/branches/tooling/test/SemaTemplate/overload-candidates.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/test/SemaTemplate/overload-candidates.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/test/SemaTemplate/overload-candidates.cpp (original)
+++ cfe/branches/tooling/test/SemaTemplate/overload-candidates.cpp Tue May 15 13:51:08 2012
@@ -40,3 +40,25 @@
void test_X_min(X x) {
(void)x.min(1, 2l); // expected-error{{no matching member function for call to 'min'}}
}
+
+namespace boost {
+ template<bool, typename = void> struct enable_if {};
+ template<typename T> struct enable_if<true, T> { typedef T type; };
+}
+template<typename T> typename boost::enable_if<sizeof(T) == 4, int>::type if_size_4(); // expected-note{{candidate template ignored: disabled by 'enable_if' [with T = char]}}
+int k = if_size_4<char>(); // expected-error{{no matching function}}
+
+namespace llvm {
+ template<typename Cond, typename T = void> struct enable_if : boost::enable_if<Cond::value, T> {};
+}
+template<typename T> struct is_int { enum { value = false }; };
+template<> struct is_int<int> { enum { value = true }; };
+template<typename T> typename llvm::enable_if<is_int<T> >::type if_int(); // expected-note{{candidate template ignored: disabled by 'enable_if' [with T = char]}}
+void test_if_int() {
+ if_int<char>(); // expected-error{{no matching function}}
+}
+
+template<typename T> struct NonTemplateFunction {
+ typename boost::enable_if<sizeof(T) == 4, int>::type f(); // expected-error{{no type named 'type' in 'boost::enable_if<false, int>'; 'enable_if' cannot be used to disable this declaration}}
+};
+NonTemplateFunction<char> NTFC; // expected-note{{here}}
Modified: cfe/branches/tooling/tools/driver/cc1as_main.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/driver/cc1as_main.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/tools/driver/cc1as_main.cpp (original)
+++ cfe/branches/tooling/tools/driver/cc1as_main.cpp Tue May 15 13:51:08 2012
@@ -328,7 +328,7 @@
MCCodeEmitter *CE = 0;
MCAsmBackend *MAB = 0;
if (Opts.ShowEncoding) {
- CE = TheTarget->createMCCodeEmitter(*MCII, *STI, Ctx);
+ CE = TheTarget->createMCCodeEmitter(*MCII, *MRI, *STI, Ctx);
MAB = TheTarget->createMCAsmBackend(Opts.Triple);
}
Str.reset(TheTarget->createAsmStreamer(Ctx, *Out, /*asmverbose*/true,
@@ -342,7 +342,7 @@
} else {
assert(Opts.OutputType == AssemblerInvocation::FT_Obj &&
"Invalid file type!");
- MCCodeEmitter *CE = TheTarget->createMCCodeEmitter(*MCII, *STI, Ctx);
+ MCCodeEmitter *CE = TheTarget->createMCCodeEmitter(*MCII, *MRI, *STI, Ctx);
MCAsmBackend *MAB = TheTarget->createMCAsmBackend(Opts.Triple);
Str.reset(TheTarget->createMCObjectStreamer(Opts.Triple, Ctx, *MAB, *Out,
CE, Opts.RelaxAll,
Modified: cfe/branches/tooling/tools/libclang/CIndexDiagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/libclang/CIndexDiagnostic.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/tools/libclang/CIndexDiagnostic.cpp (original)
+++ cfe/branches/tooling/tools/libclang/CIndexDiagnostic.cpp Tue May 15 13:51:08 2012
@@ -86,11 +86,10 @@
class CXDiagnosticRenderer : public DiagnosticNoteRenderer {
public:
- CXDiagnosticRenderer(const SourceManager &SM,
- const LangOptions &LangOpts,
+ CXDiagnosticRenderer(const LangOptions &LangOpts,
const DiagnosticOptions &DiagOpts,
CXDiagnosticSetImpl *mainSet)
- : DiagnosticNoteRenderer(SM, LangOpts, DiagOpts),
+ : DiagnosticNoteRenderer(LangOpts, DiagOpts),
CurrentSet(mainSet), MainSet(mainSet) {}
virtual ~CXDiagnosticRenderer() {}
@@ -116,26 +115,38 @@
DiagnosticsEngine::Level Level,
StringRef Message,
ArrayRef<CharSourceRange> Ranges,
+ const SourceManager *SM,
DiagOrStoredDiag D) {
if (!D.isNull())
return;
- CXSourceLocation L = translateSourceLocation(SM, LangOpts, Loc);
+ CXSourceLocation L;
+ if (SM)
+ L = translateSourceLocation(*SM, LangOpts, Loc);
+ else
+ L = clang_getNullLocation();
CXDiagnosticImpl *CD = new CXDiagnosticCustomNoteImpl(Message, L);
CurrentSet->appendDiagnostic(CD);
}
virtual void emitDiagnosticLoc(SourceLocation Loc, PresumedLoc PLoc,
DiagnosticsEngine::Level Level,
- ArrayRef<CharSourceRange> Ranges) {}
+ ArrayRef<CharSourceRange> Ranges,
+ const SourceManager &SM) {}
virtual void emitCodeContext(SourceLocation Loc,
DiagnosticsEngine::Level Level,
SmallVectorImpl<CharSourceRange>& Ranges,
- ArrayRef<FixItHint> Hints) {}
+ ArrayRef<FixItHint> Hints,
+ const SourceManager &SM) {}
- virtual void emitNote(SourceLocation Loc, StringRef Message) {
- CXSourceLocation L = translateSourceLocation(SM, LangOpts, Loc);
+ virtual void emitNote(SourceLocation Loc, StringRef Message,
+ const SourceManager *SM) {
+ CXSourceLocation L;
+ if (SM)
+ L = translateSourceLocation(*SM, LangOpts, Loc);
+ else
+ L = clang_getNullLocation();
CurrentSet->appendDiagnostic(new CXDiagnosticCustomNoteImpl(Message,
L));
}
@@ -181,8 +192,7 @@
CXDiagnosticSetImpl *Set = new CXDiagnosticSetImpl();
TU->Diagnostics = Set;
DiagnosticOptions DOpts;
- CXDiagnosticRenderer Renderer(AU->getSourceManager(),
- AU->getASTContext().getLangOpts(),
+ CXDiagnosticRenderer Renderer(AU->getASTContext().getLangOpts(),
DOpts, Set);
for (ASTUnit::stored_diag_iterator it = AU->stored_diag_begin(),
Modified: cfe/branches/tooling/tools/libclang/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/libclang/CMakeLists.txt?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/tools/libclang/CMakeLists.txt (original)
+++ cfe/branches/tooling/tools/libclang/CMakeLists.txt Tue May 15 13:51:08 2012
@@ -53,11 +53,19 @@
set(SHARED_LIBRARY TRUE)
add_clang_library(libclang ${SOURCES})
- set_target_properties(libclang
- PROPERTIES
- OUTPUT_NAME "libclang"
- VERSION ${LIBCLANG_LIBRARY_VERSION}
- DEFINE_SYMBOL _CINDEX_LIB_)
+ if(WIN32)
+ set_target_properties(libclang
+ PROPERTIES
+ OUTPUT_NAME "libclang"
+ VERSION ${LIBCLANG_LIBRARY_VERSION}
+ DEFINE_SYMBOL _CINDEX_LIB_)
+ else()
+ set_target_properties(libclang
+ PROPERTIES
+ OUTPUT_NAME "clang"
+ VERSION ${LIBCLANG_LIBRARY_VERSION}
+ DEFINE_SYMBOL _CINDEX_LIB_)
+ endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(LIBCLANG_LINK_FLAGS
@@ -86,5 +94,5 @@
set_target_properties(${LIBCLANG_STATIC_TARGET_NAME}
PROPERTIES
- OUTPUT_NAME "libclang")
+ OUTPUT_NAME "clang")
endif()
Modified: cfe/branches/tooling/tools/libclang/CXCursor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/tools/libclang/CXCursor.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/tools/libclang/CXCursor.cpp (original)
+++ cfe/branches/tooling/tools/libclang/CXCursor.cpp Tue May 15 13:51:08 2012
@@ -864,27 +864,10 @@
/*MovedToSuper=*/false);
}
-void cxcursor::getOverriddenCursors(CXCursor cursor,
- SmallVectorImpl<CXCursor> &overridden) {
- assert(clang_isDeclaration(cursor.kind));
- Decl *D = getCursorDecl(cursor);
- if (!D)
- return;
-
- // Handle C++ member functions.
- CXTranslationUnit TU = getCursorTU(cursor);
- if (CXXMethodDecl *CXXMethod = dyn_cast<CXXMethodDecl>(D)) {
- for (CXXMethodDecl::method_iterator
- M = CXXMethod->begin_overridden_methods(),
- MEnd = CXXMethod->end_overridden_methods();
- M != MEnd; ++M)
- overridden.push_back(MakeCXCursor(const_cast<CXXMethodDecl*>(*M), TU));
- return;
- }
-
- ObjCMethodDecl *Method = dyn_cast<ObjCMethodDecl>(D);
- if (!Method)
- return;
+static void collectOverriddenMethodsSlow(CXTranslationUnit TU,
+ ObjCMethodDecl *Method,
+ SmallVectorImpl<CXCursor> &overridden) {
+ assert(Method->isOverriding());
if (ObjCProtocolDecl *
ProtD = dyn_cast<ObjCProtocolDecl>(Method->getDeclContext())) {
@@ -921,6 +904,83 @@
}
}
+static void collectOnCategoriesAfterLocation(SourceLocation Loc,
+ ObjCInterfaceDecl *Class,
+ CXTranslationUnit TU,
+ ObjCMethodDecl *Method,
+ SmallVectorImpl<CXCursor> &Methods) {
+ if (!Class)
+ return;
+
+ SourceManager &SM = static_cast<ASTUnit *>(TU->TUData)->getSourceManager();
+ for (ObjCCategoryDecl *Category = Class->getCategoryList();
+ Category; Category = Category->getNextClassCategory())
+ if (SM.isBeforeInTranslationUnit(Loc, Category->getLocation()))
+ CollectOverriddenMethodsRecurse(TU, Category, Method, Methods, true);
+
+ collectOnCategoriesAfterLocation(Loc, Class->getSuperClass(), TU,
+ Method, Methods);
+}
+
+/// \brief Faster collection that is enabled when ObjCMethodDecl::isOverriding()
+/// returns false.
+/// You'd think that in that case there are no overrides but categories can
+/// "introduce" new overridden methods that are missed by Sema because the
+/// overrides lookup that it does for methods, inside implementations, will
+/// stop at the interface level (if there is a method there) and not look
+/// further in super classes.
+static void collectOverriddenMethodsFast(CXTranslationUnit TU,
+ ObjCMethodDecl *Method,
+ SmallVectorImpl<CXCursor> &Methods) {
+ assert(!Method->isOverriding());
+
+ ObjCContainerDecl *ContD = cast<ObjCContainerDecl>(Method->getDeclContext());
+ if (isa<ObjCInterfaceDecl>(ContD) || isa<ObjCProtocolDecl>(ContD))
+ return;
+ ObjCInterfaceDecl *Class = Method->getClassInterface();
+ if (!Class)
+ return;
+
+ collectOnCategoriesAfterLocation(Class->getLocation(), Class->getSuperClass(),
+ TU, Method, Methods);
+}
+
+void cxcursor::getOverriddenCursors(CXCursor cursor,
+ SmallVectorImpl<CXCursor> &overridden) {
+ assert(clang_isDeclaration(cursor.kind));
+ Decl *D = getCursorDecl(cursor);
+ if (!D)
+ return;
+
+ // Handle C++ member functions.
+ CXTranslationUnit TU = getCursorTU(cursor);
+ if (CXXMethodDecl *CXXMethod = dyn_cast<CXXMethodDecl>(D)) {
+ for (CXXMethodDecl::method_iterator
+ M = CXXMethod->begin_overridden_methods(),
+ MEnd = CXXMethod->end_overridden_methods();
+ M != MEnd; ++M)
+ overridden.push_back(MakeCXCursor(const_cast<CXXMethodDecl*>(*M), TU));
+ return;
+ }
+
+ ObjCMethodDecl *Method = dyn_cast<ObjCMethodDecl>(D);
+ if (!Method)
+ return;
+
+ if (Method->isRedeclaration()) {
+ Method = cast<ObjCContainerDecl>(Method->getDeclContext())->
+ getMethod(Method->getSelector(), Method->isInstanceMethod());
+ }
+
+ if (!Method->isOverriding()) {
+ collectOverriddenMethodsFast(TU, Method, overridden);
+ } else {
+ collectOverriddenMethodsSlow(TU, Method, overridden);
+ assert(!overridden.empty() &&
+ "ObjCMethodDecl's overriding bit is not as expected");
+ }
+}
+
std::pair<int, SourceLocation>
cxcursor::getSelectorIdentifierIndexAndLoc(CXCursor cursor) {
if (cursor.kind == CXCursor_ObjCMessageExpr) {
Modified: cfe/branches/tooling/unittests/Tooling/CompilationDatabaseTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/unittests/Tooling/CompilationDatabaseTest.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/unittests/Tooling/CompilationDatabaseTest.cpp (original)
+++ cfe/branches/tooling/unittests/Tooling/CompilationDatabaseTest.cpp Tue May 15 13:51:08 2012
@@ -18,6 +18,26 @@
namespace clang {
namespace tooling {
+static void expectFailure(StringRef JSONDatabase, StringRef Explanation) {
+ std::string ErrorMessage;
+ EXPECT_EQ(NULL, JSONCompilationDatabase::loadFromBuffer(JSONDatabase,
+ ErrorMessage))
+ << "Expected an error because of: " << Explanation;
+}
+
+TEST(JSONCompilationDatabase, ErrsOnInvalidFormat) {
+ expectFailure("", "Empty database");
+ expectFailure("{", "Invalid JSON");
+ expectFailure("[[]]", "Array instead of object");
+ expectFailure("[{\"a\":[]}]", "Array instead of value");
+ expectFailure("[{\"a\":\"b\"}]", "Unknown key");
+ expectFailure("[{[]:\"\"}]", "Incorrectly typed entry");
+ expectFailure("[{}]", "Empty entry");
+ expectFailure("[{\"directory\":\"\",\"command\":\"\"}]", "Missing file");
+ expectFailure("[{\"directory\":\"\",\"file\":\"\"}]", "Missing command");
+ expectFailure("[{\"command\":\"\",\"file\":\"\"}]", "Missing directory");
+}
+
static CompileCommand findCompileArgsInJsonDatabase(StringRef FileName,
StringRef JSONDatabase,
std::string &ErrorMessage) {
Modified: cfe/branches/tooling/unittests/Tooling/RecursiveASTVisitorTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/unittests/Tooling/RecursiveASTVisitorTest.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/unittests/Tooling/RecursiveASTVisitorTest.cpp (original)
+++ cfe/branches/tooling/unittests/Tooling/RecursiveASTVisitorTest.cpp Tue May 15 13:51:08 2012
@@ -301,6 +301,19 @@
"}\n"));
}
+TEST(RecursiveASTVisitor, VisitsExplicitTemplateSpecialization) {
+ CXXMemberCallVisitor Visitor;
+ Visitor.ExpectMatch("A::f", 4, 5);
+ EXPECT_TRUE(Visitor.runOver(
+ "struct A {\n"
+ " void f() const {}\n"
+ " template<class T> void g(const T& t) const {\n"
+ " t.f();\n"
+ " }\n"
+ "};\n"
+ "template void A::g(const A& a) const;\n"));
+}
+
TEST(RecursiveASTVisitor, VisitsPartialTemplateSpecialization) {
// From cfe-commits/Week-of-Mon-20100830/033998.html
// Contrary to the approach sugggested in that email, we visit all
Modified: cfe/branches/tooling/utils/TableGen/ClangAttrEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/utils/TableGen/ClangAttrEmitter.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/utils/TableGen/ClangAttrEmitter.cpp (original)
+++ cfe/branches/tooling/utils/TableGen/ClangAttrEmitter.cpp Tue May 15 13:51:08 2012
@@ -1004,6 +1004,14 @@
continue;
OS << " case attr::" << R.getName() << ": {\n";
+ bool ShouldClone = R.getValueAsBit("Clone");
+
+ if (!ShouldClone) {
+ OS << " return NULL;\n";
+ OS << " }\n";
+ continue;
+ }
+
OS << " const " << R.getName() << "Attr *A = cast<"
<< R.getName() << "Attr>(At);\n";
bool TDependent = R.getValueAsBit("TemplateDependent");
@@ -1062,7 +1070,8 @@
Record &Attr = **I;
bool SemaHandler = Attr.getValueAsBit("SemaHandler");
-
+ bool DistinctSpellings = Attr.getValueAsBit("DistinctSpellings");
+
if (SemaHandler) {
std::vector<StringRef> Spellings =
getValueAsListOfStrings(Attr, "Spellings");
@@ -1079,6 +1088,9 @@
ProcessedAttrs.insert(AttrName);
OS << "PARSED_ATTR(" << AttrName << ")\n";
+
+ if (!DistinctSpellings)
+ break;
}
}
}
@@ -1097,23 +1109,23 @@
bool SemaHandler = Attr.getValueAsBit("SemaHandler");
bool Ignored = Attr.getValueAsBit("Ignored");
-
+ bool DistinctSpellings = Attr.getValueAsBit("DistinctSpellings");
if (SemaHandler || Ignored) {
std::vector<StringRef> Spellings =
getValueAsListOfStrings(Attr, "Spellings");
for (std::vector<StringRef>::const_iterator I = Spellings.begin(),
E = Spellings.end(); I != E; ++I) {
- StringRef AttrName = *I, Spelling = *I;
-
- AttrName = NormalizeAttrName(AttrName);
- Spelling = NormalizeAttrSpelling(Spelling);
+ StringRef AttrName = NormalizeAttrName(DistinctSpellings
+ ? *I
+ : Spellings.front());
+ StringRef Spelling = NormalizeAttrSpelling(*I);
if (SemaHandler)
Matches.push_back(
- StringMatcher::StringPair(Spelling,
- std::string("return AttributeList::AT_") +
- AttrName.str() + ";"));
+ StringMatcher::StringPair(
+ Spelling,
+ std::string("return AttributeList::AT_")+AttrName.str() + ";"));
else
Matches.push_back(
StringMatcher::StringPair(
Modified: cfe/branches/tooling/utils/TableGen/NeonEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/utils/TableGen/NeonEmitter.cpp?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/utils/TableGen/NeonEmitter.cpp (original)
+++ cfe/branches/tooling/utils/TableGen/NeonEmitter.cpp Tue May 15 13:51:08 2012
@@ -1012,7 +1012,7 @@
StringRef outTypeStr, StringRef inTypeStr,
OpKind kind, ClassKind classKind) {
assert(!proto.empty() && "");
- bool define = UseMacro(proto);
+ bool define = UseMacro(proto) && kind != OpUnavailable;
std::string s;
// static always inline + return type
@@ -1040,9 +1040,11 @@
if (define) {
s += " __extension__ ({ \\\n ";
s += GenMacroLocals(proto, inTypeStr);
- } else {
+ } else if (kind == OpUnavailable) {
+ s += " __attribute__((unavailable));\n";
+ return s;
+ } else
s += " { \\\n ";
- }
if (kind != OpNone)
s += GenOpString(kind, proto, outTypeStr);
@@ -1238,7 +1240,7 @@
/// runHeader - Emit a file with sections defining:
/// 1. the NEON section of BuiltinsARM.def.
/// 2. the SemaChecking code for the type overload checking.
-/// 3. the SemaChecking code for validation of intrinsic immedate arguments.
+/// 3. the SemaChecking code for validation of intrinsic immediate arguments.
void NeonEmitter::runHeader(raw_ostream &OS) {
std::vector<Record*> RV = Records.getAllDerivedDefinitions("Inst");
@@ -1551,6 +1553,8 @@
ParseTypes(R, Types, TypeVec);
OpKind kind = OpMap[R->getValueAsDef("Operand")->getName()];
+ if (kind == OpUnavailable)
+ continue;
for (unsigned ti = 0, te = TypeVec.size(); ti != te; ++ti) {
if (kind == OpReinterpret) {
bool outQuad = false;
Modified: cfe/branches/tooling/utils/TableGen/NeonEmitter.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/utils/TableGen/NeonEmitter.h?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/utils/TableGen/NeonEmitter.h (original)
+++ cfe/branches/tooling/utils/TableGen/NeonEmitter.h Tue May 15 13:51:08 2012
@@ -23,6 +23,7 @@
enum OpKind {
OpNone,
+ OpUnavailable,
OpAdd,
OpAddl,
OpAddw,
@@ -130,6 +131,7 @@
public:
NeonEmitter(RecordKeeper &R) : Records(R) {
OpMap["OP_NONE"] = OpNone;
+ OpMap["OP_UNAVAILABLE"] = OpUnavailable;
OpMap["OP_ADD"] = OpAdd;
OpMap["OP_ADDL"] = OpAddl;
OpMap["OP_ADDW"] = OpAddw;
Modified: cfe/branches/tooling/www/analyzer/available_checks.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/www/analyzer/available_checks.html?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/www/analyzer/available_checks.html (original)
+++ cfe/branches/tooling/www/analyzer/available_checks.html Tue May 15 13:51:08 2012
@@ -74,9 +74,11 @@
<tr>
<td><b>deadcode.DeadStores</b></td><td>Check for values stored to variables that are never read afterwards.</td>
</tr>
+<!--
<tr>
<td><b>deadcode.IdempotentOperations</b></td><td>Warn about idempotent operations.</td>
</tr>
+-->
<tr>
<td><b>osx.API</b></td><td>Check for proper uses of various Mac OS X APIs.</td>
</tr>
@@ -108,6 +110,9 @@
<td><b>osx.cocoa.RetainCount</b></td><td>Check for leaks and improper reference count management.</td>
</tr>
<tr>
+<td><b>osx.cocoa.SelfInit</b></td><td>Check that 'self' is properly initialized inside an initializer method.</td>
+</tr>
+<tr>
<td><b>osx.cocoa.UnusedIvars</b></td><td>Warn about private ivars that are never used.</td>
</tr>
<tr>
@@ -122,9 +127,52 @@
<tr>
<td><b>osx.coreFoundation.CFRetainRelease</b></td><td>Check for null arguments to CFRetain/CFRelease.</td>
</tr>
+<td><b>osx.coreFoundation.containers.OutOfBounds</b></td><td>Checks for index out-of-bounds when using 'CFArray' API.</td>
+</tr>
+<tr>
+<td><b>osx.coreFoundation.containers.PointerSizedValues</b></td><td>Warns if 'CFArray', 'CFDictionary', 'CFSet' are created with non-pointer-size values.</td>
+</tr>
+<tr>
+<td><b>security.FloatLoopCounter</b></td><td>Warn on using a floating point value as a loop counter (CERT: FLP30-C, FLP30-CPP).</td>
+</tr>
+<tr>
+<td><b>security.insecureAPI.UncheckedReturn</b></td><td>Warn on uses of functions whose return values must be always checked.</td>
+</tr>
+<tr>
+<td><b>security.insecureAPI.getpw</b></td><td>Warn on uses of the 'getpw' function.</td>
+</tr>
+<tr>
+<td><b>security.insecureAPI.gets</b></td><td>Warn on uses of the 'gets' function.</td>
+</tr>
+<tr>
+<td><b>security.insecureAPI.mkstemp</b></td><td>Warn when 'mkstemp' is passed fewer than 6 X's in the format string.</td>
+</tr>
+<tr>
+<td><b>security.insecureAPI.mktemp</b></td><td>Warn on uses of the 'mktemp' function.</td>
+</tr>
+<tr>
+<td><b>security.insecureAPI.rand</b></td><td>Warn on uses of the 'rand', 'random', and related functions.</td>
+</tr>
+<tr>
+<td><b>security.insecureAPI.strcpy</b></td><td>Warn on uses of the 'strcpy' and 'strcat' functions.</td>
+</tr>
+<tr>
+<td><b>security.insecureAPI.vfork</b></td><td>Warn on uses of the 'vfork' function.</td>
+</tr>
<tr>
<td><b>unix.API</b></td><td>Check calls to various UNIX/Posix functions.</td>
</tr>
+<tr>
+<td><b>unix.Malloc</b></td><td>Check for memory leaks, double free, and use-after-free problems.</td>
+</tr>
+<tr>
+<td><b>unix.MallocSizeof</b></td><td>Check for dubious malloc arguments involving sizeof.</td>
+</tr>
+<tr>
+<td><b>unix.cstring.BadSizeArg</b></td><td>Check the size argument passed into C string functions for common erroneous patterns.</td>
+</tr>
+<tr>
+<td><b>unix.cstring.NullArg</b></td><td>Check for null pointers being passed as arguments to C string functions.</td>
</table>
<p>In addition to these the analyzer contains numerous experimental (beta) checkers.</p>
Modified: cfe/branches/tooling/www/analyzer/latest_checker.html.incl
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/www/analyzer/latest_checker.html.incl?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/www/analyzer/latest_checker.html.incl (original)
+++ cfe/branches/tooling/www/analyzer/latest_checker.html.incl Tue May 15 13:51:08 2012
@@ -1 +1 @@
-<b><a href="http://bit.ly/JATSI8">checker-264.tar.bz2</a></b> (built April 26, 2012)
+<b><a href="http://bit.ly/JceZBE">checker-265.tar.bz2</a></b> (built May 8, 2012)
Modified: cfe/branches/tooling/www/analyzer/release_notes.html
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/tooling/www/analyzer/release_notes.html?rev=156839&r1=156838&r2=156839&view=diff
==============================================================================
--- cfe/branches/tooling/www/analyzer/release_notes.html (original)
+++ cfe/branches/tooling/www/analyzer/release_notes.html Tue May 15 13:51:08 2012
@@ -15,6 +15,17 @@
<h1>Release notes for <tt>checker-XXX</tt> builds</h1>
+<h4 id="checker_265">checker-265</h4>
+
+<p><b>built:</b> May 8, 2012</br>
+ <b>download:</b> <a href="http://bit.ly/JceZBE">checker-265.tar.bz2</a></p>
+ <p><b>highlights:</b></p>
+
+<p>This release contains a fix for a major crasher introduced in checker-264, and various refinements to
+improve the precision and reduce the false positive rate of the analyzer. It also enables a new unix.MallocSizeof check, which reports
+inconsistencies between the casted type of the return value of a 'malloc/calloc/realloc' call and the operand
+of sizeof expressions contained within its argument(s).</p>
+
<h4 id="checker_264">checker-264</h4>
<p><b>built:</b> April 26, 2012</br>
More information about the llvm-branch-commits
mailing list