llvm.org GIT mirror llvm / 079b6f5
Add an "ATTRIBUTE_UNUSED" macro (and use it). It's for variables which are mainly used in debugging and/or assert situations. It should make the compiler and the static analyzer stop nagging us about them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92181 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 10 years ago
2 changed file(s) with 8 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
2626 #define ATTRIBUTE_USED __attribute__((__used__))
2727 #else
2828 #define ATTRIBUTE_USED
29 #endif
30
31 #if (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
32 #define ATTRIBUTE_UNUSED __attribute__((__unused__))
33 #else
34 #define ATTRIBUTE_UNUSED
2935 #endif
3036
3137 #ifdef __GNUC__ // aka 'ATTRIBUTE_CONST' but following LLVM Conventions.
1414 #include "llvm/MC/MCStreamer.h"
1515 #include "llvm/MC/MCExpr.h"
1616 #include "llvm/MC/MCInst.h"
17 #include "llvm/Support/Compiler.h"
1718 #include "llvm/Support/SourceMgr.h"
1819 #include "llvm/Target/TargetRegistry.h"
1920 #include "llvm/Target/TargetAsmParser.h"
665666 const AsmToken &Tok = getLexer().getTok();
666667 if (Tok.isNot(AsmToken::Identifier) && Tok.isNot(AsmToken::String))
667668 return Error(L, "unexpected token in .syntax directive");
668 StringRef SymbolName = getLexer().getTok().getIdentifier();
669 StringRef ATTRIBUTE_UNUSED SymbolName = getLexer().getTok().getIdentifier();
669670 getLexer().Lex(); // Consume the identifier token.
670671
671672 if (getLexer().isNot(AsmToken::EndOfStatement))