Generalize target weirdness handling having proper layering in mind:
1. Add helper class for sema checks for target attributes
2. Add helper class for codegen of target attributes
As a proof-of-concept - implement msp430's 'interrupt' attribute.
llvm-svn: 93118
diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h
index 54dd060..f487fbe 100644
--- a/clang/lib/Sema/Sema.h
+++ b/clang/lib/Sema/Sema.h
@@ -101,6 +101,7 @@
class InitializationKind;
class InitializationSequence;
class VisibleDeclConsumer;
+ class TargetAttributesSema;
/// BlockSemaInfo - When a block is being parsed, this contains information
/// about the block. It is pointed to from Sema::CurBlock.
@@ -176,6 +177,7 @@
class Sema : public Action {
Sema(const Sema&); // DO NOT IMPLEMENT
void operator=(const Sema&); // DO NOT IMPLEMENT
+ mutable const TargetAttributesSema* TheTargetAttributesSema;
public:
const LangOptions &LangOpts;
Preprocessor &PP;
@@ -426,13 +428,12 @@
Sema(Preprocessor &pp, ASTContext &ctxt, ASTConsumer &consumer,
bool CompleteTranslationUnit = true,
CodeCompleteConsumer *CompletionConsumer = 0);
- ~Sema() {
- if (PackContext) FreePackedContext();
- }
+ ~Sema();
const LangOptions &getLangOptions() const { return LangOpts; }
Diagnostic &getDiagnostics() const { return Diags; }
SourceManager &getSourceManager() const { return SourceMgr; }
+ const TargetAttributesSema &getTargetAttributesSema() const;
/// \brief Helper class that creates diagnostics with optional
/// template instantiation stacks.