mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Bug 316076. Added IFunction.isNoReturn() method.
Change-Id: Idfa2aa067e9c956b9a990980797a41277a84cc58 Reviewed-on: https://git.eclipse.org/r/5584 Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com> IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com> Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
This commit is contained in:
parent
33374d0a51
commit
20ea7546f8
22 changed files with 171 additions and 47 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2006, 2008 IBM Corporation.
|
* Copyright (c) 2006, 2012 IBM Corporation.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM Corporation - initial API and implementation
|
* IBM Corporation - initial API and implementation
|
||||||
|
* Sergey Prigogin (Google)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.pdom.tests;
|
package org.eclipse.cdt.internal.pdom.tests;
|
||||||
|
|
||||||
|
@ -74,6 +75,12 @@ public class CFunctionTests extends PDOMTestBase {
|
||||||
assertTrue(((IFunction) bindings[0]).takesVarArgs());
|
assertTrue(((IFunction) bindings[0]).takesVarArgs());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testNoReturnCFunction() throws Exception {
|
||||||
|
IBinding[] bindings = findQualifiedName(pdom, "noReturnCFunction");
|
||||||
|
assertEquals(1, bindings.length);
|
||||||
|
assertTrue(((IFunction) bindings[0]).isNoReturn());
|
||||||
|
}
|
||||||
|
|
||||||
public void testKnRStyleFunctionWithProblemParameters() throws Exception {
|
public void testKnRStyleFunctionWithProblemParameters() throws Exception {
|
||||||
IBinding[] bindings = findQualifiedName(pdom, "KnRfunctionWithProblemParameters");
|
IBinding[] bindings = findQualifiedName(pdom, "KnRfunctionWithProblemParameters");
|
||||||
assertEquals(1, bindings.length);
|
assertEquals(1, bindings.length);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2006, 2010 IBM Corporation.
|
* Copyright (c) 2006, 2012 IBM Corporation.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,6 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM Corporation - initial API and implementation
|
* IBM Corporation - initial API and implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
|
* Sergey Prigogin (Google)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.pdom.tests;
|
package org.eclipse.cdt.internal.pdom.tests;
|
||||||
|
|
||||||
|
@ -38,7 +39,6 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
*/
|
*/
|
||||||
public class CPPFunctionTests extends PDOMTestBase {
|
public class CPPFunctionTests extends PDOMTestBase {
|
||||||
protected ICProject project;
|
protected ICProject project;
|
||||||
|
|
||||||
protected PDOM pdom;
|
protected PDOM pdom;
|
||||||
|
|
||||||
public static Test suite() {
|
public static Test suite() {
|
||||||
|
@ -144,6 +144,12 @@ public class CPPFunctionTests extends PDOMTestBase {
|
||||||
assertTrue(((ICPPFunction) bindings[0]).takesVarArgs());
|
assertTrue(((ICPPFunction) bindings[0]).takesVarArgs());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testNoReturnCPPFunction() throws Exception {
|
||||||
|
IBinding[] bindings = findQualifiedName(pdom, "noReturnCPPFunction");
|
||||||
|
assertEquals(1, bindings.length);
|
||||||
|
assertTrue(((ICPPFunction) bindings[0]).isNoReturn());
|
||||||
|
}
|
||||||
|
|
||||||
public void testForwardDeclarationType() throws Exception {
|
public void testForwardDeclarationType() throws Exception {
|
||||||
assertType(pdom, "forwardDeclaration", ICPPFunction.class);
|
assertType(pdom, "forwardDeclaration", ICPPFunction.class);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ void varArgsCFunction(int p1, ...);
|
||||||
const void constCFunction();
|
const void constCFunction();
|
||||||
volatile void volatileCFunction();
|
volatile void volatileCFunction();
|
||||||
void storageClassCFunction(register int p1, int p2);
|
void storageClassCFunction(register int p1, int p2);
|
||||||
|
void noReturnCFunction() __attribute__((noreturn));
|
||||||
|
|
||||||
void voidCFunction();
|
void voidCFunction();
|
||||||
int intCFunction();
|
int intCFunction();
|
||||||
|
|
|
@ -4,6 +4,7 @@ static int staticCPPFunction(double p1);
|
||||||
extern float externCPPFunction(int p1);
|
extern float externCPPFunction(int p1);
|
||||||
inline void inlineCPPFunction(long p1);
|
inline void inlineCPPFunction(long p1);
|
||||||
void varArgsCPPFunction(int p1, ...);
|
void varArgsCPPFunction(int p1, ...);
|
||||||
|
void noReturnCPPFunction() __attribute__((noreturn));
|
||||||
|
|
||||||
void voidCPPFunction();
|
void voidCPPFunction();
|
||||||
int intCPPFunction();
|
int intCPPFunction();
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Doug Schaefer (IBM) - Initial API and implementation
|
* Doug Schaefer (IBM) - Initial API and implementation
|
||||||
|
* Sergey Prigogin (Google)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
|
@ -51,4 +52,11 @@ public interface IFunction extends IBinding {
|
||||||
* Returns {@code true} if this function takes variable arguments.
|
* Returns {@code true} if this function takes variable arguments.
|
||||||
*/
|
*/
|
||||||
public boolean takesVarArgs();
|
public boolean takesVarArgs();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns {@code true} if this function never returns. Based on 'noreturn' attribute in
|
||||||
|
* the function declaration.
|
||||||
|
* @since 5.4
|
||||||
|
*/
|
||||||
|
public boolean isNoReturn();
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.ICompositeType;
|
import org.eclipse.cdt.core.dom.ast.ICompositeType;
|
||||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||||
|
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
|
||||||
import org.eclipse.cdt.internal.core.dom.Linkage;
|
import org.eclipse.cdt.internal.core.dom.Linkage;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.IASTInternalNameOwner;
|
import org.eclipse.cdt.internal.core.dom.parser.IASTInternalNameOwner;
|
||||||
|
@ -33,7 +34,6 @@ import org.eclipse.cdt.internal.core.dom.parser.IASTInternalNameOwner;
|
||||||
public class CASTName extends ASTNode implements IASTName, IASTCompletionContext {
|
public class CASTName extends ASTNode implements IASTName, IASTCompletionContext {
|
||||||
private final char[] name;
|
private final char[] name;
|
||||||
|
|
||||||
private static final char[] EMPTY_CHAR_ARRAY = {};
|
|
||||||
private static final String EMPTY_STRING = ""; //$NON-NLS-1$
|
private static final String EMPTY_STRING = ""; //$NON-NLS-1$
|
||||||
|
|
||||||
private IBinding binding;
|
private IBinding binding;
|
||||||
|
@ -43,7 +43,7 @@ public class CASTName extends ASTNode implements IASTName, IASTCompletionContext
|
||||||
}
|
}
|
||||||
|
|
||||||
public CASTName() {
|
public CASTName() {
|
||||||
name = EMPTY_CHAR_ARRAY;
|
name = CharArrayUtils.EMPTY_CHAR_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -107,7 +107,7 @@ public class CASTName extends ASTNode implements IASTName, IASTCompletionContext
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
if (name == EMPTY_CHAR_ARRAY)
|
if (name == CharArrayUtils.EMPTY_CHAR_ARRAY)
|
||||||
return EMPTY_STRING;
|
return EMPTY_STRING;
|
||||||
return new String(name);
|
return new String(name);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2010 IBM Corporation and others.
|
* Copyright (c) 2004, 2012 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,6 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM Rational Software - Initial API and implementation
|
* IBM Rational Software - Initial API and implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
|
* Sergey Prigogin (Google)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.c;
|
package org.eclipse.cdt.internal.core.dom.parser.c;
|
||||||
|
|
||||||
|
@ -34,6 +35,7 @@ import org.eclipse.cdt.core.dom.ast.gnu.c.ICASTKnRFunctionDeclarator;
|
||||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||||
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
|
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
|
||||||
import org.eclipse.cdt.internal.core.dom.Linkage;
|
import org.eclipse.cdt.internal.core.dom.Linkage;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.parser.ASTAttribute;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTQueries;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTQueries;
|
||||||
import org.eclipse.core.runtime.PlatformObject;
|
import org.eclipse.core.runtime.PlatformObject;
|
||||||
|
|
||||||
|
@ -48,7 +50,7 @@ public class CFunction extends PlatformObject implements IFunction, ICInternalFu
|
||||||
private static final int RESOLUTION_IN_PROGRESS = 1 << 1;
|
private static final int RESOLUTION_IN_PROGRESS = 1 << 1;
|
||||||
private int bits = 0;
|
private int bits = 0;
|
||||||
|
|
||||||
protected IFunctionType type = null;
|
protected IFunctionType type;
|
||||||
|
|
||||||
public CFunction(IASTDeclarator declarator) {
|
public CFunction(IASTDeclarator declarator) {
|
||||||
storeDeclarator(declarator);
|
storeDeclarator(declarator);
|
||||||
|
@ -469,12 +471,12 @@ public class CFunction extends PlatformObject implements IFunction, ICInternalFu
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IASTNode[] getDeclarations() {
|
public IASTDeclarator[] getDeclarations() {
|
||||||
return declarators;
|
return declarators;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IASTNode getDefinition() {
|
public IASTFunctionDeclarator getDefinition() {
|
||||||
return definition;
|
return definition;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -482,4 +484,25 @@ public class CFunction extends PlatformObject implements IFunction, ICInternalFu
|
||||||
public IBinding getOwner() {
|
public IBinding getOwner() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isNoReturn() {
|
||||||
|
IASTFunctionDeclarator dtor = getPreferredDtor();
|
||||||
|
return dtor != null && ASTAttribute.hasNoreturnAttribute(dtor);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected IASTFunctionDeclarator getPreferredDtor() {
|
||||||
|
IASTFunctionDeclarator dtor = getDefinition();
|
||||||
|
if (dtor != null)
|
||||||
|
return dtor;
|
||||||
|
|
||||||
|
IASTDeclarator[] dtors = getDeclarations();
|
||||||
|
if (dtors != null) {
|
||||||
|
for (IASTDeclarator declarator : dtors) {
|
||||||
|
if (declarator instanceof IASTFunctionDeclarator)
|
||||||
|
return (IASTFunctionDeclarator) declarator;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2010 IBM Corporation and others.
|
* Copyright (c) 2004, 2012 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,6 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Andrew Niefer (IBM Corporation) - initial API and implementation
|
* Andrew Niefer (IBM Corporation) - initial API and implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
|
* Sergey Prigogin (Google)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
|
@ -45,6 +46,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter;
|
||||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||||
import org.eclipse.cdt.internal.core.dom.Linkage;
|
import org.eclipse.cdt.internal.core.dom.Linkage;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.parser.ASTAttribute;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTQueries;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTQueries;
|
||||||
|
@ -593,4 +595,10 @@ public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInt
|
||||||
ICPPParameter[] pars= getParameters();
|
ICPPParameter[] pars= getParameters();
|
||||||
return pars.length > 0 && pars[pars.length - 1].isParameterPack();
|
return pars.length > 0 && pars[pars.length - 1].isParameterPack();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isNoReturn() {
|
||||||
|
ICPPASTFunctionDeclarator dtor = getPreferredDtor();
|
||||||
|
return dtor != null && ASTAttribute.hasNoreturnAttribute(dtor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2005, 2010 IBM Corporation and others.
|
* Copyright (c) 2005, 2012 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -9,6 +9,7 @@
|
||||||
* Andrew Niefer (IBM) - Initial API and implementation
|
* Andrew Niefer (IBM) - Initial API and implementation
|
||||||
* Bryan Wilkinson (QNX)
|
* Bryan Wilkinson (QNX)
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
|
* Sergey Prigogin (Google)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
|
@ -210,6 +211,14 @@ public class CPPFunctionSpecialization extends CPPSpecialization implements ICPP
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isNoReturn() {
|
||||||
|
ICPPFunction f = (ICPPFunction) getSpecializedBinding();
|
||||||
|
if (f != null)
|
||||||
|
return f.isNoReturn();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBinding resolveParameter(CPPParameter param) {
|
public IBinding resolveParameter(CPPParameter param) {
|
||||||
int pos= param.getParameterPosition();
|
int pos= param.getParameterPosition();
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Andrew Niefer (IBM) - Initial API and implementation
|
* Andrew Niefer (IBM) - Initial API and implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
|
* Sergey Prigogin (Google)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
|
@ -35,6 +36,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPParameter;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.parser.ASTAttribute;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTQueries;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTQueries;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ProblemFunctionType;
|
import org.eclipse.cdt.internal.core.dom.parser.ProblemFunctionType;
|
||||||
|
@ -338,6 +340,15 @@ public class CPPFunctionTemplate extends CPPTemplateDefinition
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isNoReturn() {
|
||||||
|
ICPPASTFunctionDeclarator fdecl= getFirstFunctionDtor();
|
||||||
|
if (fdecl != null) {
|
||||||
|
return ASTAttribute.hasNoreturnAttribute(fdecl);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private IASTDeclarator getDeclaratorByName(IASTNode node) {
|
private IASTDeclarator getDeclaratorByName(IASTNode node) {
|
||||||
// Skip qualified names and nested declarators.
|
// Skip qualified names and nested declarators.
|
||||||
while (node != null) {
|
while (node != null) {
|
||||||
|
|
|
@ -69,8 +69,6 @@ public class CPPNamespace extends PlatformObject implements ICPPNamespace, ICPPI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final char[] EMPTY_CHAR_ARRAY = {};
|
|
||||||
|
|
||||||
IASTName[] namespaceDefinitions;
|
IASTName[] namespaceDefinitions;
|
||||||
ICPPNamespaceScope scope;
|
ICPPNamespaceScope scope;
|
||||||
ICPPASTTranslationUnit tu;
|
ICPPASTTranslationUnit tu;
|
||||||
|
@ -251,7 +249,7 @@ public class CPPNamespace extends PlatformObject implements ICPPNamespace, ICPPI
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public char[] getNameCharArray() {
|
public char[] getNameCharArray() {
|
||||||
return tu != null ? EMPTY_CHAR_ARRAY : namespaceDefinitions[0].getSimpleID();
|
return tu != null ? CharArrayUtils.EMPTY_CHAR_ARRAY : namespaceDefinitions[0].getSimpleID();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2008, 2010 Wind River Systems, Inc. and others.
|
* Copyright (c) 2008, 2012 Wind River Systems, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -107,6 +107,11 @@ public class CPPUnknownFunction extends CPPUnknownBinding implements ICPPFunctio
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isNoReturn() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getRequiredArgumentCount() {
|
public int getRequiredArgumentCount() {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -167,4 +167,9 @@ class AutoTypeResolver implements ICPPFunctionTemplate {
|
||||||
public boolean isGloballyQualified() throws DOMException {
|
public boolean isGloballyQualified() throws DOMException {
|
||||||
throw new UnsupportedOperationException(UNEXPECTED_CALL);
|
throw new UnsupportedOperationException(UNEXPECTED_CALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isNoReturn() {
|
||||||
|
throw new UnsupportedOperationException(UNEXPECTED_CALL);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007, 2010 Symbian Software Systems and others.
|
* Copyright (c) 2007, 2012 Symbian Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Andrew Ferguson (Symbian) - Initial implementation
|
* Andrew Ferguson (Symbian) - Initial implementation
|
||||||
|
* Sergey Prigogin (Google)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.index.composite.c;
|
package org.eclipse.cdt.internal.core.index.composite.c;
|
||||||
|
|
||||||
|
@ -74,4 +75,9 @@ class CompositeCFunction extends CompositeCBinding implements IFunction {
|
||||||
public boolean takesVarArgs() {
|
public boolean takesVarArgs() {
|
||||||
return ((IFunction) rbinding).takesVarArgs();
|
return ((IFunction) rbinding).takesVarArgs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isNoReturn() {
|
||||||
|
return ((IFunction) rbinding).isNoReturn();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007, 2010 Symbian Software Systems and others.
|
* Copyright (c) 2007, 2012 Symbian Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,6 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Andrew Ferguson (Symbian) - Initial implementation
|
* Andrew Ferguson (Symbian) - Initial implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
|
* Sergey Prigogin (Google)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.index.composite.cpp;
|
package org.eclipse.cdt.internal.core.index.composite.cpp;
|
||||||
|
|
||||||
|
@ -91,6 +92,11 @@ class CompositeCPPFunction extends CompositeCPPBinding implements ICPPFunction {
|
||||||
return ((ICPPFunction) rbinding).takesVarArgs();
|
return ((ICPPFunction) rbinding).takesVarArgs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isNoReturn() {
|
||||||
|
return ((ICPPFunction) rbinding).isNoReturn();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getRequiredArgumentCount() {
|
public int getRequiredArgumentCount() {
|
||||||
return ((ICPPFunction) rbinding).getRequiredArgumentCount();
|
return ((ICPPFunction) rbinding).getRequiredArgumentCount();
|
||||||
|
|
|
@ -84,7 +84,6 @@ public class CPreprocessor implements ILexerLog, IScanner, IAdaptable {
|
||||||
private static final int ORIGIN_PREPROCESSOR_DIRECTIVE = OffsetLimitReachedException.ORIGIN_PREPROCESSOR_DIRECTIVE;
|
private static final int ORIGIN_PREPROCESSOR_DIRECTIVE = OffsetLimitReachedException.ORIGIN_PREPROCESSOR_DIRECTIVE;
|
||||||
private static final int ORIGIN_INACTIVE_CODE = OffsetLimitReachedException.ORIGIN_INACTIVE_CODE;
|
private static final int ORIGIN_INACTIVE_CODE = OffsetLimitReachedException.ORIGIN_INACTIVE_CODE;
|
||||||
|
|
||||||
private static final char[] EMPTY_CHAR_ARRAY = new char[0];
|
|
||||||
private static final char[] ONE = "1".toCharArray(); //$NON-NLS-1$
|
private static final char[] ONE = "1".toCharArray(); //$NON-NLS-1$
|
||||||
|
|
||||||
|
|
||||||
|
@ -392,7 +391,7 @@ public class CPreprocessor implements ILexerLog, IScanner, IAdaptable {
|
||||||
}
|
}
|
||||||
|
|
||||||
private char[] nonNull(char[] array) {
|
private char[] nonNull(char[] array) {
|
||||||
return array == null ? EMPTY_CHAR_ARRAY : array;
|
return array == null ? CharArrayUtils.EMPTY_CHAR_ARRAY : array;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void configureIncludeSearchPath(File directory, IScannerInfo info) {
|
private void configureIncludeSearchPath(File directory, IScannerInfo info) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2006, 2010 IBM Corporation.
|
* Copyright (c) 2006, 2012 IBM Corporation.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,6 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM Corporation - initial API and implementation
|
* IBM Corporation - initial API and implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
|
* Sergey Prigogin (Google)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.pdom.dom.c;
|
package org.eclipse.cdt.internal.core.pdom.dom.c;
|
||||||
|
|
||||||
|
@ -30,6 +31,7 @@ public class PDOMCAnnotation {
|
||||||
public static final int REGISTER_OFFSET = 3;
|
public static final int REGISTER_OFFSET = 3;
|
||||||
public static final int STATIC_OFFSET = 4;
|
public static final int STATIC_OFFSET = 4;
|
||||||
public static final int VARARGS_OFFSET = 5;
|
public static final int VARARGS_OFFSET = 5;
|
||||||
|
public static final int NO_RETURN = 6;
|
||||||
|
|
||||||
// CV qualifiers
|
// CV qualifiers
|
||||||
public static final int CONST_OFFSET = 0;
|
public static final int CONST_OFFSET = 0;
|
||||||
|
@ -46,19 +48,20 @@ public class PDOMCAnnotation {
|
||||||
byte modifiers = 0;
|
byte modifiers = 0;
|
||||||
if (binding instanceof IVariable) {
|
if (binding instanceof IVariable) {
|
||||||
IVariable variable = (IVariable) binding;
|
IVariable variable = (IVariable) binding;
|
||||||
modifiers |= (variable.isAuto() ? 1 : 0) << PDOMCAnnotation.AUTO_OFFSET;
|
modifiers |= (variable.isAuto() ? 1 : 0) << AUTO_OFFSET;
|
||||||
modifiers |= (variable.isExtern() ? 1 : 0) << PDOMCAnnotation.EXTERN_OFFSET;
|
modifiers |= (variable.isExtern() ? 1 : 0) << EXTERN_OFFSET;
|
||||||
modifiers |= (variable.isRegister() ? 1 : 0) << PDOMCAnnotation.REGISTER_OFFSET;
|
modifiers |= (variable.isRegister() ? 1 : 0) << REGISTER_OFFSET;
|
||||||
modifiers |= (variable.isStatic() ? 1 : 0) << PDOMCAnnotation.STATIC_OFFSET;
|
modifiers |= (variable.isStatic() ? 1 : 0) << STATIC_OFFSET;
|
||||||
}
|
}
|
||||||
if (binding instanceof IFunction) {
|
if (binding instanceof IFunction) {
|
||||||
IFunction function = (IFunction) binding;
|
IFunction function = (IFunction) binding;
|
||||||
modifiers |= (function.isAuto() ? 1 : 0) << PDOMCAnnotation.AUTO_OFFSET;
|
modifiers |= (function.isAuto() ? 1 : 0) << AUTO_OFFSET;
|
||||||
modifiers |= (function.isExtern() ? 1 : 0) << PDOMCAnnotation.EXTERN_OFFSET;
|
modifiers |= (function.isExtern() ? 1 : 0) << EXTERN_OFFSET;
|
||||||
modifiers |= (function.isRegister() ? 1 : 0) << PDOMCAnnotation.REGISTER_OFFSET;
|
modifiers |= (function.isRegister() ? 1 : 0) << REGISTER_OFFSET;
|
||||||
modifiers |= (ASTInternal.isStatic(function, false) ? 1 : 0) << PDOMCAnnotation.STATIC_OFFSET;
|
modifiers |= (ASTInternal.isStatic(function, false) ? 1 : 0) << STATIC_OFFSET;
|
||||||
modifiers |= (function.isInline() ? 1 : 0) << PDOMCAnnotation.INLINE_OFFSET;
|
modifiers |= (function.isInline() ? 1 : 0) << INLINE_OFFSET;
|
||||||
modifiers |= (function.takesVarArgs() ? 1 : 0) << PDOMCAnnotation.VARARGS_OFFSET;
|
modifiers |= (function.takesVarArgs() ? 1 : 0) << VARARGS_OFFSET;
|
||||||
|
modifiers |= (function.isNoReturn() ? 1 : 0) << NO_RETURN;
|
||||||
}
|
}
|
||||||
return modifiers;
|
return modifiers;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2006, 2010 QNX Software Systems and others.
|
* Copyright (c) 2006, 2012 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -10,6 +10,7 @@
|
||||||
* IBM Corporation
|
* IBM Corporation
|
||||||
* Andrew Ferguson (Symbian)
|
* Andrew Ferguson (Symbian)
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
|
* Sergey Prigogin (Google)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.pdom.dom.c;
|
package org.eclipse.cdt.internal.core.pdom.dom.c;
|
||||||
|
|
||||||
|
@ -196,6 +197,11 @@ class PDOMCFunction extends PDOMBinding implements IFunction {
|
||||||
return getBit(getByte(record + ANNOTATIONS), PDOMCAnnotation.VARARGS_OFFSET);
|
return getBit(getByte(record + ANNOTATIONS), PDOMCAnnotation.VARARGS_OFFSET);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isNoReturn() {
|
||||||
|
return getBit(getByte(record + ANNOTATIONS), PDOMCAnnotation.NO_RETURN);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IScope getFunctionScope() {
|
public IScope getFunctionScope() {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2005, 2011 QNX Software Systems and others.
|
* Copyright (c) 2005, 2012 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -9,6 +9,7 @@
|
||||||
* Doug Schaefer (QNX) - Initial API and implementation
|
* Doug Schaefer (QNX) - Initial API and implementation
|
||||||
* IBM Corporation
|
* IBM Corporation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
|
* Sergey Prigogin (Google)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
|
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
|
||||||
|
|
||||||
|
@ -347,6 +348,11 @@ class PDOMCPPFunction extends PDOMCPPBinding implements ICPPFunction, IPDOMOverl
|
||||||
return getBit(getAnnotation(), PDOMCAnnotation.VARARGS_OFFSET);
|
return getBit(getAnnotation(), PDOMCAnnotation.VARARGS_OFFSET);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isNoReturn() {
|
||||||
|
return getBit(getAnnotation(), PDOMCAnnotation.NO_RETURN);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasParameterPack() {
|
public boolean hasParameterPack() {
|
||||||
return getBit(getAnnotation(), ANNOT_PARAMETER_PACK);
|
return getBit(getAnnotation(), ANNOT_PARAMETER_PACK);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007, 2011 QNX Software Systems and others.
|
* Copyright (c) 2007, 2012 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,6 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Bryan Wilkinson (QNX) - Initial API and implementation
|
* Bryan Wilkinson (QNX) - Initial API and implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
|
* Sergey Prigogin (Google)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
|
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
|
||||||
|
|
||||||
|
@ -244,6 +245,11 @@ class PDOMCPPFunctionSpecialization extends PDOMCPPSpecialization implements ICP
|
||||||
return getBit(readAnnotation(), PDOMCAnnotation.VARARGS_OFFSET);
|
return getBit(readAnnotation(), PDOMCAnnotation.VARARGS_OFFSET);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isNoReturn() {
|
||||||
|
return getBit(readAnnotation(), PDOMCAnnotation.NO_RETURN);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getRequiredArgumentCount() {
|
public int getRequiredArgumentCount() {
|
||||||
if (fRequiredArgCount == -1) {
|
if (fRequiredArgCount == -1) {
|
||||||
|
|
|
@ -19,6 +19,7 @@ import java.util.List;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.formatter.DefaultCodeFormatterConstants;
|
import org.eclipse.cdt.core.formatter.DefaultCodeFormatterConstants;
|
||||||
import org.eclipse.cdt.core.formatter.DefaultCodeFormatterOptions;
|
import org.eclipse.cdt.core.formatter.DefaultCodeFormatterOptions;
|
||||||
|
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
|
||||||
import org.eclipse.cdt.internal.formatter.align.Alignment;
|
import org.eclipse.cdt.internal.formatter.align.Alignment;
|
||||||
import org.eclipse.cdt.internal.formatter.align.AlignmentException;
|
import org.eclipse.cdt.internal.formatter.align.AlignmentException;
|
||||||
import org.eclipse.cdt.internal.formatter.scanner.Scanner;
|
import org.eclipse.cdt.internal.formatter.scanner.Scanner;
|
||||||
|
@ -35,7 +36,6 @@ import org.eclipse.text.edits.TextEdit;
|
||||||
*/
|
*/
|
||||||
public class Scribe {
|
public class Scribe {
|
||||||
private static final String EMPTY_STRING= ""; //$NON-NLS-1$
|
private static final String EMPTY_STRING= ""; //$NON-NLS-1$
|
||||||
private static final char[] EMPTY_CHAR_ARRAY= {};
|
|
||||||
private static final String SPACE= " "; //$NON-NLS-1$
|
private static final String SPACE= " "; //$NON-NLS-1$
|
||||||
|
|
||||||
private static final int INITIAL_SIZE= 100;
|
private static final int INITIAL_SIZE= 100;
|
||||||
|
@ -105,7 +105,7 @@ public class Scribe {
|
||||||
int currentIndentation;
|
int currentIndentation;
|
||||||
int indentation;
|
int indentation;
|
||||||
int lines;
|
int lines;
|
||||||
char[] leadingSpaces = EMPTY_CHAR_ARRAY;
|
char[] leadingSpaces = CharArrayUtils.EMPTY_CHAR_ARRAY;
|
||||||
}
|
}
|
||||||
final LineComment lastLineComment = new LineComment();
|
final LineComment lastLineComment = new LineComment();
|
||||||
|
|
||||||
|
@ -1082,7 +1082,7 @@ public class Scribe {
|
||||||
boolean hasComment= false;
|
boolean hasComment= false;
|
||||||
boolean hasLineComment= false;
|
boolean hasLineComment= false;
|
||||||
boolean hasWhitespace= false;
|
boolean hasWhitespace= false;
|
||||||
char[] whiteSpaces= EMPTY_CHAR_ARRAY;
|
char[] whiteSpaces= CharArrayUtils.EMPTY_CHAR_ARRAY;
|
||||||
int lines= 0;
|
int lines= 0;
|
||||||
while ((currentToken= scanner.nextToken()) != null) {
|
while ((currentToken= scanner.nextToken()) != null) {
|
||||||
if (skipOverInactive) {
|
if (skipOverInactive) {
|
||||||
|
@ -1243,7 +1243,7 @@ public class Scribe {
|
||||||
lastLineComment.leadingSpaces = whiteSpaces;
|
lastLineComment.leadingSpaces = whiteSpaces;
|
||||||
lastLineComment.lines = lines;
|
lastLineComment.lines = lines;
|
||||||
}
|
}
|
||||||
whiteSpaces= EMPTY_CHAR_ARRAY;
|
whiteSpaces= CharArrayUtils.EMPTY_CHAR_ARRAY;
|
||||||
hasWhitespace= false;
|
hasWhitespace= false;
|
||||||
printLineComment();
|
printLineComment();
|
||||||
currentTokenStartPosition= scanner.getCurrentPosition();
|
currentTokenStartPosition= scanner.getCurrentPosition();
|
||||||
|
@ -1260,7 +1260,7 @@ public class Scribe {
|
||||||
} else if (hasWhitespace) {
|
} else if (hasWhitespace) {
|
||||||
space();
|
space();
|
||||||
}
|
}
|
||||||
whiteSpaces= EMPTY_CHAR_ARRAY;
|
whiteSpaces= CharArrayUtils.EMPTY_CHAR_ARRAY;
|
||||||
hasWhitespace= false;
|
hasWhitespace= false;
|
||||||
printBlockComment(false);
|
printBlockComment(false);
|
||||||
currentTokenStartPosition= scanner.getCurrentPosition();
|
currentTokenStartPosition= scanner.getCurrentPosition();
|
||||||
|
@ -1280,7 +1280,7 @@ public class Scribe {
|
||||||
// printNewLine(scanner.getCurrentTokenStartPosition());
|
// printNewLine(scanner.getCurrentTokenStartPosition());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
whiteSpaces= EMPTY_CHAR_ARRAY;
|
whiteSpaces= CharArrayUtils.EMPTY_CHAR_ARRAY;
|
||||||
hasWhitespace= false;
|
hasWhitespace= false;
|
||||||
printPreprocessorDirective();
|
printPreprocessorDirective();
|
||||||
printNewLine();
|
printNewLine();
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2006, 2008 IBM Corporation and others.
|
* Copyright (c) 2006, 2012 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM Corporation - initial API and implementation
|
* IBM Corporation - initial API and implementation
|
||||||
|
* Sergey Prigogin (Google)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.lrparser.c99.bindings;
|
package org.eclipse.cdt.internal.core.dom.lrparser.c99.bindings;
|
||||||
|
|
||||||
|
@ -34,6 +35,7 @@ public class C99Function extends PlatformObject implements IC99Binding, IFunctio
|
||||||
private boolean isRegister;
|
private boolean isRegister;
|
||||||
private boolean isStatic;
|
private boolean isStatic;
|
||||||
private boolean isVarArgs;
|
private boolean isVarArgs;
|
||||||
|
private boolean isNoReturn;
|
||||||
|
|
||||||
// the scope that the function is in (must be the global scope, no?)
|
// the scope that the function is in (must be the global scope, no?)
|
||||||
private IScope scope;
|
private IScope scope;
|
||||||
|
@ -117,6 +119,14 @@ public class C99Function extends PlatformObject implements IC99Binding, IFunctio
|
||||||
this.isVarArgs = isVarArgs;
|
this.isVarArgs = isVarArgs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isNoReturn() {
|
||||||
|
return isNoReturn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNoReturn(boolean isNoReturn) {
|
||||||
|
this.isNoReturn = isNoReturn;
|
||||||
|
}
|
||||||
|
|
||||||
public ILinkage getLinkage() {
|
public ILinkage getLinkage() {
|
||||||
return Linkage.C_LINKAGE;
|
return Linkage.C_LINKAGE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue