2008-10-05 03:21:03 +08:00
|
|
|
//===--- ParsePragma.cpp - Language specific pragma parsing ---------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file implements the language specific #pragma handlers.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "ParsePragma.h"
|
2009-01-29 13:15:15 +08:00
|
|
|
#include "clang/Parse/ParseDiagnostic.h"
|
2009-03-24 06:28:25 +08:00
|
|
|
#include "clang/Parse/Parser.h"
|
2010-08-21 02:27:03 +08:00
|
|
|
#include "clang/Lex/Preprocessor.h"
|
2008-10-05 03:21:03 +08:00
|
|
|
using namespace clang;
|
|
|
|
|
2011-01-18 02:58:44 +08:00
|
|
|
/// \brief Handle the annotation token produced for #pragma unused(...)
|
|
|
|
///
|
|
|
|
/// Each annot_pragma_unused is followed by the argument token so e.g.
|
|
|
|
/// "#pragma unused(x,y)" becomes:
|
|
|
|
/// annot_pragma_unused 'x' annot_pragma_unused 'y'
|
|
|
|
void Parser::HandlePragmaUnused() {
|
|
|
|
assert(Tok.is(tok::annot_pragma_unused));
|
|
|
|
SourceLocation UnusedLoc = ConsumeToken();
|
|
|
|
Actions.ActOnPragmaUnused(Tok, getCurScope(), UnusedLoc);
|
|
|
|
ConsumeToken(); // The argument token.
|
|
|
|
}
|
2010-08-05 14:57:20 +08:00
|
|
|
|
|
|
|
// #pragma GCC visibility comes in two variants:
|
|
|
|
// 'push' '(' [visibility] ')'
|
|
|
|
// 'pop'
|
2010-09-10 06:45:38 +08:00
|
|
|
void PragmaGCCVisibilityHandler::HandlePragma(Preprocessor &PP,
|
|
|
|
PragmaIntroducerKind Introducer,
|
|
|
|
Token &VisTok) {
|
2010-08-05 14:57:20 +08:00
|
|
|
SourceLocation VisLoc = VisTok.getLocation();
|
|
|
|
|
|
|
|
Token Tok;
|
|
|
|
PP.Lex(Tok);
|
|
|
|
|
|
|
|
const IdentifierInfo *PushPop = Tok.getIdentifierInfo();
|
|
|
|
|
|
|
|
bool IsPush;
|
|
|
|
const IdentifierInfo *VisType;
|
|
|
|
if (PushPop && PushPop->isStr("pop")) {
|
|
|
|
IsPush = false;
|
|
|
|
VisType = 0;
|
|
|
|
} else if (PushPop && PushPop->isStr("push")) {
|
|
|
|
IsPush = true;
|
|
|
|
PP.Lex(Tok);
|
|
|
|
if (Tok.isNot(tok::l_paren)) {
|
|
|
|
PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_lparen)
|
|
|
|
<< "visibility";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
PP.Lex(Tok);
|
|
|
|
VisType = Tok.getIdentifierInfo();
|
|
|
|
if (!VisType) {
|
|
|
|
PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier)
|
|
|
|
<< "visibility";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
PP.Lex(Tok);
|
|
|
|
if (Tok.isNot(tok::r_paren)) {
|
|
|
|
PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_rparen)
|
|
|
|
<< "visibility";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier)
|
|
|
|
<< "visibility";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
PP.Lex(Tok);
|
|
|
|
if (Tok.isNot(tok::eom)) {
|
|
|
|
PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
|
|
|
|
<< "visibility";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
Actions.ActOnPragmaVisibility(IsPush, VisType, VisLoc);
|
|
|
|
}
|
|
|
|
|
2008-10-05 03:21:03 +08:00
|
|
|
// #pragma pack(...) comes in the following delicious flavors:
|
|
|
|
// pack '(' [integer] ')'
|
|
|
|
// pack '(' 'show' ')'
|
|
|
|
// pack '(' ('push' | 'pop') [',' identifier] [, integer] ')'
|
2010-09-10 06:45:38 +08:00
|
|
|
void PragmaPackHandler::HandlePragma(Preprocessor &PP,
|
|
|
|
PragmaIntroducerKind Introducer,
|
|
|
|
Token &PackTok) {
|
2008-10-05 03:21:03 +08:00
|
|
|
SourceLocation PackLoc = PackTok.getLocation();
|
|
|
|
|
|
|
|
Token Tok;
|
|
|
|
PP.Lex(Tok);
|
|
|
|
if (Tok.isNot(tok::l_paren)) {
|
2009-03-24 06:28:25 +08:00
|
|
|
PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_lparen) << "pack";
|
2008-10-05 03:21:03 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2010-08-27 07:41:50 +08:00
|
|
|
Sema::PragmaPackKind Kind = Sema::PPK_Default;
|
2008-10-05 03:21:03 +08:00
|
|
|
IdentifierInfo *Name = 0;
|
2010-08-24 14:29:42 +08:00
|
|
|
ExprResult Alignment;
|
2008-10-05 03:21:03 +08:00
|
|
|
SourceLocation LParenLoc = Tok.getLocation();
|
2009-09-09 23:08:12 +08:00
|
|
|
PP.Lex(Tok);
|
2008-10-05 03:21:03 +08:00
|
|
|
if (Tok.is(tok::numeric_constant)) {
|
|
|
|
Alignment = Actions.ActOnNumericConstant(Tok);
|
2008-12-09 21:15:23 +08:00
|
|
|
if (Alignment.isInvalid())
|
2008-10-05 03:21:03 +08:00
|
|
|
return;
|
|
|
|
|
|
|
|
PP.Lex(Tok);
|
|
|
|
} else if (Tok.is(tok::identifier)) {
|
|
|
|
const IdentifierInfo *II = Tok.getIdentifierInfo();
|
2008-11-24 05:45:46 +08:00
|
|
|
if (II->isStr("show")) {
|
2010-08-27 07:41:50 +08:00
|
|
|
Kind = Sema::PPK_Show;
|
2008-10-05 03:21:03 +08:00
|
|
|
PP.Lex(Tok);
|
|
|
|
} else {
|
2008-11-24 05:45:46 +08:00
|
|
|
if (II->isStr("push")) {
|
2010-08-27 07:41:50 +08:00
|
|
|
Kind = Sema::PPK_Push;
|
2008-11-24 05:45:46 +08:00
|
|
|
} else if (II->isStr("pop")) {
|
2010-08-27 07:41:50 +08:00
|
|
|
Kind = Sema::PPK_Pop;
|
2008-10-05 03:21:03 +08:00
|
|
|
} else {
|
|
|
|
PP.Diag(Tok.getLocation(), diag::warn_pragma_pack_invalid_action);
|
|
|
|
return;
|
2009-09-09 23:08:12 +08:00
|
|
|
}
|
2008-10-05 03:21:03 +08:00
|
|
|
PP.Lex(Tok);
|
2009-09-09 23:08:12 +08:00
|
|
|
|
2008-10-05 03:21:03 +08:00
|
|
|
if (Tok.is(tok::comma)) {
|
|
|
|
PP.Lex(Tok);
|
2009-09-09 23:08:12 +08:00
|
|
|
|
2008-10-05 03:21:03 +08:00
|
|
|
if (Tok.is(tok::numeric_constant)) {
|
|
|
|
Alignment = Actions.ActOnNumericConstant(Tok);
|
2008-12-09 21:15:23 +08:00
|
|
|
if (Alignment.isInvalid())
|
2008-10-05 03:21:03 +08:00
|
|
|
return;
|
|
|
|
|
|
|
|
PP.Lex(Tok);
|
|
|
|
} else if (Tok.is(tok::identifier)) {
|
|
|
|
Name = Tok.getIdentifierInfo();
|
|
|
|
PP.Lex(Tok);
|
2009-09-09 23:08:12 +08:00
|
|
|
|
2008-10-05 03:21:03 +08:00
|
|
|
if (Tok.is(tok::comma)) {
|
|
|
|
PP.Lex(Tok);
|
2009-09-09 23:08:12 +08:00
|
|
|
|
2008-10-05 03:21:03 +08:00
|
|
|
if (Tok.isNot(tok::numeric_constant)) {
|
2008-11-24 05:45:46 +08:00
|
|
|
PP.Diag(Tok.getLocation(), diag::warn_pragma_pack_malformed);
|
2008-10-05 03:21:03 +08:00
|
|
|
return;
|
|
|
|
}
|
2009-09-09 23:08:12 +08:00
|
|
|
|
2008-10-05 03:21:03 +08:00
|
|
|
Alignment = Actions.ActOnNumericConstant(Tok);
|
2008-12-09 21:15:23 +08:00
|
|
|
if (Alignment.isInvalid())
|
2008-10-05 03:21:03 +08:00
|
|
|
return;
|
|
|
|
|
|
|
|
PP.Lex(Tok);
|
|
|
|
}
|
|
|
|
} else {
|
2008-11-24 05:45:46 +08:00
|
|
|
PP.Diag(Tok.getLocation(), diag::warn_pragma_pack_malformed);
|
2008-10-05 03:21:03 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2008-12-09 21:15:23 +08:00
|
|
|
}
|
2008-10-05 03:21:03 +08:00
|
|
|
|
|
|
|
if (Tok.isNot(tok::r_paren)) {
|
2009-03-24 06:28:25 +08:00
|
|
|
PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_rparen) << "pack";
|
2008-10-05 03:21:03 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2010-05-27 07:29:06 +08:00
|
|
|
SourceLocation RParenLoc = Tok.getLocation();
|
2009-06-05 08:49:58 +08:00
|
|
|
PP.Lex(Tok);
|
|
|
|
if (Tok.isNot(tok::eom)) {
|
|
|
|
PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol) << "pack";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2008-12-10 08:02:53 +08:00
|
|
|
Actions.ActOnPragmaPack(Kind, Name, Alignment.release(), PackLoc,
|
2008-10-05 03:21:03 +08:00
|
|
|
LParenLoc, RParenLoc);
|
|
|
|
}
|
|
|
|
|
2010-08-01 03:17:07 +08:00
|
|
|
// #pragma 'align' '=' {'native','natural','mac68k','power','reset'}
|
|
|
|
// #pragma 'options 'align' '=' {'native','natural','mac68k','power','reset'}
|
2010-08-27 07:41:50 +08:00
|
|
|
static void ParseAlignPragma(Sema &Actions, Preprocessor &PP, Token &FirstTok,
|
2010-08-01 03:17:07 +08:00
|
|
|
bool IsOptions) {
|
2010-05-27 07:29:06 +08:00
|
|
|
Token Tok;
|
2010-08-01 03:17:07 +08:00
|
|
|
|
|
|
|
if (IsOptions) {
|
|
|
|
PP.Lex(Tok);
|
|
|
|
if (Tok.isNot(tok::identifier) ||
|
|
|
|
!Tok.getIdentifierInfo()->isStr("align")) {
|
|
|
|
PP.Diag(Tok.getLocation(), diag::warn_pragma_options_expected_align);
|
|
|
|
return;
|
|
|
|
}
|
2010-05-27 07:29:06 +08:00
|
|
|
}
|
2010-05-28 02:42:09 +08:00
|
|
|
|
2010-05-27 07:29:06 +08:00
|
|
|
PP.Lex(Tok);
|
|
|
|
if (Tok.isNot(tok::equal)) {
|
2010-08-01 03:17:07 +08:00
|
|
|
PP.Diag(Tok.getLocation(), diag::warn_pragma_align_expected_equal)
|
|
|
|
<< IsOptions;
|
2010-05-27 07:29:06 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
PP.Lex(Tok);
|
|
|
|
if (Tok.isNot(tok::identifier)) {
|
|
|
|
PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier)
|
2010-08-01 03:17:07 +08:00
|
|
|
<< (IsOptions ? "options" : "align");
|
2010-05-27 07:29:06 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2010-08-27 07:41:50 +08:00
|
|
|
Sema::PragmaOptionsAlignKind Kind = Sema::POAK_Natural;
|
2010-05-27 07:29:06 +08:00
|
|
|
const IdentifierInfo *II = Tok.getIdentifierInfo();
|
2010-05-28 02:42:09 +08:00
|
|
|
if (II->isStr("native"))
|
2010-08-27 07:41:50 +08:00
|
|
|
Kind = Sema::POAK_Native;
|
2010-05-28 02:42:09 +08:00
|
|
|
else if (II->isStr("natural"))
|
2010-08-27 07:41:50 +08:00
|
|
|
Kind = Sema::POAK_Natural;
|
2010-05-28 02:42:17 +08:00
|
|
|
else if (II->isStr("packed"))
|
2010-08-27 07:41:50 +08:00
|
|
|
Kind = Sema::POAK_Packed;
|
2010-05-27 07:29:06 +08:00
|
|
|
else if (II->isStr("power"))
|
2010-08-27 07:41:50 +08:00
|
|
|
Kind = Sema::POAK_Power;
|
2010-05-27 07:29:06 +08:00
|
|
|
else if (II->isStr("mac68k"))
|
2010-08-27 07:41:50 +08:00
|
|
|
Kind = Sema::POAK_Mac68k;
|
2010-05-27 07:29:06 +08:00
|
|
|
else if (II->isStr("reset"))
|
2010-08-27 07:41:50 +08:00
|
|
|
Kind = Sema::POAK_Reset;
|
2010-05-27 07:29:06 +08:00
|
|
|
else {
|
2010-08-01 03:17:07 +08:00
|
|
|
PP.Diag(Tok.getLocation(), diag::warn_pragma_align_invalid_option)
|
|
|
|
<< IsOptions;
|
2010-05-27 07:29:06 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
SourceLocation KindLoc = Tok.getLocation();
|
|
|
|
PP.Lex(Tok);
|
|
|
|
if (Tok.isNot(tok::eom)) {
|
|
|
|
PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol)
|
2010-08-01 03:17:07 +08:00
|
|
|
<< (IsOptions ? "options" : "align");
|
2010-05-27 07:29:06 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2010-08-01 03:17:07 +08:00
|
|
|
Actions.ActOnPragmaOptionsAlign(Kind, FirstTok.getLocation(), KindLoc);
|
|
|
|
}
|
|
|
|
|
2010-09-10 06:45:38 +08:00
|
|
|
void PragmaAlignHandler::HandlePragma(Preprocessor &PP,
|
|
|
|
PragmaIntroducerKind Introducer,
|
|
|
|
Token &AlignTok) {
|
2010-08-01 03:17:07 +08:00
|
|
|
ParseAlignPragma(Actions, PP, AlignTok, /*IsOptions=*/false);
|
|
|
|
}
|
|
|
|
|
2010-09-10 06:45:38 +08:00
|
|
|
void PragmaOptionsHandler::HandlePragma(Preprocessor &PP,
|
|
|
|
PragmaIntroducerKind Introducer,
|
|
|
|
Token &OptionsTok) {
|
2010-08-01 03:17:07 +08:00
|
|
|
ParseAlignPragma(Actions, PP, OptionsTok, /*IsOptions=*/true);
|
2010-05-27 07:29:06 +08:00
|
|
|
}
|
|
|
|
|
2009-03-24 06:28:25 +08:00
|
|
|
// #pragma unused(identifier)
|
2010-09-10 06:45:38 +08:00
|
|
|
void PragmaUnusedHandler::HandlePragma(Preprocessor &PP,
|
|
|
|
PragmaIntroducerKind Introducer,
|
|
|
|
Token &UnusedTok) {
|
2009-03-24 06:28:25 +08:00
|
|
|
// FIXME: Should we be expanding macros here? My guess is no.
|
|
|
|
SourceLocation UnusedLoc = UnusedTok.getLocation();
|
2009-09-09 23:08:12 +08:00
|
|
|
|
2009-03-24 06:28:25 +08:00
|
|
|
// Lex the left '('.
|
|
|
|
Token Tok;
|
|
|
|
PP.Lex(Tok);
|
|
|
|
if (Tok.isNot(tok::l_paren)) {
|
|
|
|
PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_lparen) << "unused";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
SourceLocation LParenLoc = Tok.getLocation();
|
2009-09-09 23:08:12 +08:00
|
|
|
|
2009-03-24 06:28:25 +08:00
|
|
|
// Lex the declaration reference(s).
|
2009-08-04 07:24:57 +08:00
|
|
|
llvm::SmallVector<Token, 5> Identifiers;
|
2009-03-24 06:28:25 +08:00
|
|
|
SourceLocation RParenLoc;
|
|
|
|
bool LexID = true;
|
2009-09-09 23:08:12 +08:00
|
|
|
|
2009-03-24 06:28:25 +08:00
|
|
|
while (true) {
|
|
|
|
PP.Lex(Tok);
|
2009-09-09 23:08:12 +08:00
|
|
|
|
2009-03-24 06:28:25 +08:00
|
|
|
if (LexID) {
|
2009-09-09 23:08:12 +08:00
|
|
|
if (Tok.is(tok::identifier)) {
|
2009-08-04 07:24:57 +08:00
|
|
|
Identifiers.push_back(Tok);
|
2009-03-24 06:28:25 +08:00
|
|
|
LexID = false;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2009-08-04 07:24:57 +08:00
|
|
|
// Illegal token!
|
2009-03-24 06:28:25 +08:00
|
|
|
PP.Diag(Tok.getLocation(), diag::warn_pragma_unused_expected_var);
|
|
|
|
return;
|
|
|
|
}
|
2009-09-09 23:08:12 +08:00
|
|
|
|
2009-03-24 06:28:25 +08:00
|
|
|
// We are execting a ')' or a ','.
|
|
|
|
if (Tok.is(tok::comma)) {
|
|
|
|
LexID = true;
|
|
|
|
continue;
|
|
|
|
}
|
2009-09-09 23:08:12 +08:00
|
|
|
|
2009-03-24 06:28:25 +08:00
|
|
|
if (Tok.is(tok::r_paren)) {
|
|
|
|
RParenLoc = Tok.getLocation();
|
|
|
|
break;
|
|
|
|
}
|
2009-09-09 23:08:12 +08:00
|
|
|
|
2009-08-04 07:24:57 +08:00
|
|
|
// Illegal token!
|
2009-03-24 06:28:25 +08:00
|
|
|
PP.Diag(Tok.getLocation(), diag::warn_pragma_unused_expected_punc);
|
|
|
|
return;
|
|
|
|
}
|
2009-06-05 08:49:58 +08:00
|
|
|
|
|
|
|
PP.Lex(Tok);
|
|
|
|
if (Tok.isNot(tok::eom)) {
|
|
|
|
PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol) <<
|
|
|
|
"unused";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2009-03-24 06:28:25 +08:00
|
|
|
// Verify that we have a location for the right parenthesis.
|
|
|
|
assert(RParenLoc.isValid() && "Valid '#pragma unused' must have ')'");
|
2009-08-04 07:24:57 +08:00
|
|
|
assert(!Identifiers.empty() && "Valid '#pragma unused' must have arguments");
|
2009-03-24 06:28:25 +08:00
|
|
|
|
2011-01-18 02:58:44 +08:00
|
|
|
// For each identifier token, insert into the token stream a
|
|
|
|
// annot_pragma_unused token followed by the identifier token.
|
|
|
|
// This allows us to cache a "#pragma unused" that occurs inside an inline
|
|
|
|
// C++ member function.
|
|
|
|
|
|
|
|
Token *Toks = new Token[2*Identifiers.size()];
|
|
|
|
for (unsigned i=0; i != Identifiers.size(); i++) {
|
|
|
|
Token &pragmaUnusedTok = Toks[2*i], &idTok = Toks[2*i+1];
|
|
|
|
pragmaUnusedTok.startToken();
|
|
|
|
pragmaUnusedTok.setKind(tok::annot_pragma_unused);
|
|
|
|
pragmaUnusedTok.setLocation(UnusedLoc);
|
|
|
|
idTok = Identifiers[i];
|
|
|
|
}
|
|
|
|
PP.EnterTokenStream(Toks, 2*Identifiers.size(), /*DisableMacroExpansion=*/true, /*OwnsTokens=*/true);
|
2009-03-24 06:28:25 +08:00
|
|
|
}
|
2009-06-05 08:49:58 +08:00
|
|
|
|
|
|
|
// #pragma weak identifier
|
|
|
|
// #pragma weak identifier '=' identifier
|
2010-09-10 06:45:38 +08:00
|
|
|
void PragmaWeakHandler::HandlePragma(Preprocessor &PP,
|
|
|
|
PragmaIntroducerKind Introducer,
|
|
|
|
Token &WeakTok) {
|
2009-06-05 08:49:58 +08:00
|
|
|
// FIXME: Should we be expanding macros here? My guess is no.
|
|
|
|
SourceLocation WeakLoc = WeakTok.getLocation();
|
|
|
|
|
|
|
|
Token Tok;
|
|
|
|
PP.Lex(Tok);
|
|
|
|
if (Tok.isNot(tok::identifier)) {
|
|
|
|
PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier) << "weak";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
IdentifierInfo *WeakName = Tok.getIdentifierInfo(), *AliasName = 0;
|
|
|
|
SourceLocation WeakNameLoc = Tok.getLocation(), AliasNameLoc;
|
|
|
|
|
|
|
|
PP.Lex(Tok);
|
|
|
|
if (Tok.is(tok::equal)) {
|
|
|
|
PP.Lex(Tok);
|
|
|
|
if (Tok.isNot(tok::identifier)) {
|
2009-09-09 23:08:12 +08:00
|
|
|
PP.Diag(Tok.getLocation(), diag::warn_pragma_expected_identifier)
|
2009-06-05 08:49:58 +08:00
|
|
|
<< "weak";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
AliasName = Tok.getIdentifierInfo();
|
|
|
|
AliasNameLoc = Tok.getLocation();
|
|
|
|
PP.Lex(Tok);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (Tok.isNot(tok::eom)) {
|
|
|
|
PP.Diag(Tok.getLocation(), diag::warn_pragma_extra_tokens_at_eol) << "weak";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (AliasName) {
|
|
|
|
Actions.ActOnPragmaWeakAlias(WeakName, AliasName, WeakLoc, WeakNameLoc,
|
|
|
|
AliasNameLoc);
|
|
|
|
} else {
|
|
|
|
Actions.ActOnPragmaWeakID(WeakName, WeakLoc, WeakNameLoc);
|
|
|
|
}
|
|
|
|
}
|